diff options
Diffstat (limited to 'newlib/libc/sys/linux/sys')
22 files changed, 0 insertions, 1214 deletions
diff --git a/newlib/libc/sys/linux/sys/_types.h b/newlib/libc/sys/linux/sys/_types.h deleted file mode 100644 index 15ccf1061..000000000 --- a/newlib/libc/sys/linux/sys/_types.h +++ /dev/null @@ -1,49 +0,0 @@ -/* ANSI C namespace clean utility typedefs */ - -/* This file defines various typedefs needed by the system calls that support - the C library. Basically, they're just the POSIX versions with an '_' - prepended. This file lives in the `sys' directory so targets can provide - their own if desired (or they can put target dependant conditionals here). -*/ - -#ifndef _SYS__TYPES_H -#define _SYS__TYPES_H - -typedef long _off_t; -__extension__ typedef long long _off64_t; - -#if defined(__INT_MAX__) && __INT_MAX__ == 2147483647 -typedef int _ssize_t; -#else -typedef long _ssize_t; -#endif - -#define __need_wint_t -#include <stddef.h> - -/* Conversion state information. */ -typedef struct -{ - int __count; - union - { - wint_t __wch; - unsigned char __wchb[4]; - } __value; /* Value so far. */ -} _mbstate_t; - -struct __flock_t_tmp; -typedef struct -{ - int __a; - int __b; - struct - { - long int __c1; - int __c2; - } __c; - int __d; - struct __flock_t_tmp * __e; -} _flock_t; - -#endif /* _SYS__TYPES_H */ diff --git a/newlib/libc/sys/linux/sys/cdefs.h b/newlib/libc/sys/linux/sys/cdefs.h deleted file mode 100644 index 459785bcb..000000000 --- a/newlib/libc/sys/linux/sys/cdefs.h +++ /dev/null @@ -1,230 +0,0 @@ -/* Copyright (C) 1992,93,94,95,96,97,98,99,2000,2001 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _SYS_CDEFS_H -#define _SYS_CDEFS_H 1 - -/* We are almost always included from features.h. */ -#ifndef _FEATURES_H -# include <features.h> -#endif - -/* The GNU libc does not support any K&R compilers or the traditional mode - of ISO C compilers anymore. Check for some of the combinations not - anymore supported. */ -#if defined __GNUC__ && !defined __STDC__ -# error "You need a ISO C conforming compiler to use the glibc headers" -#endif - -#define __FBSDID(x) /* nothing */ - -/* Some user header file might have defined this before. */ -#undef __P -#undef __PMT - -#ifdef __GNUC__ - -/* GCC can always grok prototypes. For C++ programs we add throw() - to help it optimize the function calls. But this works only with - gcc 2.8.x and egcs. */ -# if defined __cplusplus && __GNUC_PREREQ (2,8) -# define __THROW throw () -# else -# define __THROW -# endif -# define __P(args) args __THROW -/* This macro will be used for functions which might take C++ callback - functions. */ -# define __PMT(args) args - -#else /* Not GCC. */ - -# define __inline /* No inline functions. */ - -# define __THROW -# define __P(args) args -# define __PMT(args) args - -# define __const const -# define __signed signed -# define __volatile volatile - -#endif /* GCC. */ - -/* For these things, GCC behaves the ANSI way normally, - and the non-ANSI way under -traditional. */ - -#define __CONCAT(x,y) x ## y -#define __STRING(x) #x - -/* This is not a typedef so `const __ptr_t' does the right thing. */ -#define __ptr_t void * -#define __long_double_t long double - - -/* C++ needs to know that types and declarations are C, not C++. */ -#ifdef __cplusplus -# define __BEGIN_DECLS extern "C" { -# define __END_DECLS } -#else -# define __BEGIN_DECLS -# define __END_DECLS -#endif - - -/* Support for bounded pointers. */ -#ifndef __BOUNDED_POINTERS__ -# define __bounded /* nothing */ -# define __unbounded /* nothing */ -# define __ptrvalue /* nothing */ -#endif - - -/* Support for flexible arrays. */ -#if __GNUC_PREREQ (2,97) -/* GCC 2.97 supports C99 flexible array members. */ -# define __flexarr [] -#else -# ifdef __GNUC__ -# define __flexarr [0] -# else -# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L -# define __flexarr [] -# else -/* Some other non-C99 compiler. Approximate with [1]. */ -# define __flexarr [1] -# endif -# endif -#endif - - -/* __asm__ ("xyz") is used throughout the headers to rename functions - at the assembly language level. This is wrapped by the __REDIRECT - macro, in order to support compilers that can do this some other - way. When compilers don't support asm-names at all, we have to do - preprocessor tricks instead (which don't have exactly the right - semantics, but it's the best we can do). - - Example: - int __REDIRECT(setpgrp, (__pid_t pid, __pid_t pgrp), setpgid); */ - -#if defined __GNUC__ && __GNUC__ >= 2 - -# define __REDIRECT(name, proto, alias) name proto __asm__ (__ASMNAME (#alias)) -# define __ASMNAME(cname) __ASMNAME2 (__USER_LABEL_PREFIX__, cname) -# define __ASMNAME2(prefix, cname) __STRING (prefix) cname - -/* -#elif __SOME_OTHER_COMPILER__ - -# define __REDIRECT(name, proto, alias) name proto; \ - _Pragma("let " #name " = " #alias) -*/ -#endif - -/* GCC has various useful declarations that can be made with the - `__attribute__' syntax. All of the ways we use this do fine if - they are omitted for compilers that don't understand it. */ -#if !defined __GNUC__ || __GNUC__ < 2 -# define __attribute__(xyz) /* Ignore */ -#endif - -/* At some point during the gcc 2.96 development the `malloc' attribute - for functions was introduced. We don't want to use it unconditionally - (although this would be possible) since it generates warnings. */ -#if __GNUC_PREREQ (2,96) -# define __attribute_malloc__ __attribute__ ((__malloc__)) -#else -# define __attribute_malloc__ /* Ignore */ -#endif - -/* At some point during the gcc 2.96 development the `pure' attribute - for functions was introduced. We don't want to use it unconditionally - (although this would be possible) since it generates warnings. */ -#if __GNUC_PREREQ (2,96) -# define __attribute_pure__ __attribute__ ((__pure__)) -#else -# define __attribute_pure__ /* Ignore */ -#endif - -/* At some point during the gcc 3.1 development the `used' attribute - for functions was introduced. We don't want to use it unconditionally - (although this would be possible) since it generates warnings. */ -#if __GNUC_PREREQ (3,1) -# define __attribute_used__ __attribute__ ((__used__)) -# define __attribute_noinline__ __attribute__ ((__noinline__)) -#else -# define __attribute_used__ __attribute__ ((__unused__)) -# define __attribute_noinline__ /* Ignore */ -#endif - -/* At some point during the gcc 2.8 development the `format_arg' attribute - for functions was introduced. We don't want to use it unconditionally - (although this would be possible) since it generates warnings. - If several `format_arg' attributes are given for the same function, in - gcc-3.0 and older, all but the last one are ignored. In newer gccs, - all designated arguments are considered. */ -#if __GNUC_PREREQ (2,8) -# define __attribute_format_arg__(x) __attribute__ ((__format_arg__ (x))) -#else -# define __attribute_format_arg__(x) /* Ignore */ -#endif - -/* At some point during the gcc 2.97 development the `strfmon' format - attribute for functions was introduced. We don't want to use it - unconditionally (although this would be possible) since it - generates warnings. */ -#if __GNUC_PREREQ (2,97) -# define __attribute_format_strfmon__(a,b) \ - __attribute__ ((__format__ (__strfmon__, a, b))) -#else -# define __attribute_format_strfmon__(a,b) /* Ignore */ -#endif - -/* It is possible to compile containing GCC extensions even if GCC is - run in pedantic mode if the uses are carefully marked using the - `__extension__' keyword. But this is not generally available before - version 2.8. */ -#if !__GNUC_PREREQ (2,8) -# define __extension__ /* Ignore */ -#endif - -/* __restrict is known in EGCS 1.2 and above. */ -#if !__GNUC_PREREQ (2,92) -# define __restrict /* Ignore */ -#endif - -/* ISO C99 also allows to declare arrays as non-overlapping. The syntax is - array_name[restrict] - GCC 3.1 supports this. */ -#if __GNUC_PREREQ (3,1) && !defined __GNUG__ -# define __restrict_arr __restrict -#else -# ifdef __GNUC__ -# define __restrict_arr /* Not supported in old GCC. */ -# else -# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L -# define __restrict_arr restrict -# else -/* Some other non-C99 compiler. */ -# define __restrict_arr /* Not supported. */ -# endif -# endif -#endif - -#endif /* sys/cdefs.h */ diff --git a/newlib/libc/sys/linux/sys/dirent.h b/newlib/libc/sys/linux/sys/dirent.h deleted file mode 100644 index f9b6fec7a..000000000 --- a/newlib/libc/sys/linux/sys/dirent.h +++ /dev/null @@ -1,56 +0,0 @@ -/* libc/sys/linux/sys/dirent.h - Directory entry as returned by readdir */ - -/* Written 2000 by Werner Almesberger */ - - -#ifndef _SYS_DIRENT_H -#define _SYS_DIRENT_H - -#include <sys/types.h> -#include <linux/dirent.h> -#define _LIBC 1 -#include <sys/lock.h> -#undef _LIBC - -#define HAVE_NO_D_NAMLEN /* no struct dirent->d_namlen */ -#define HAVE_DD_LOCK /* have locking mechanism */ - -#define MAXNAMLEN 255 /* sizeof(struct dirent.d_name)-1 */ - - -typedef struct { - int dd_fd; /* directory file */ - int dd_loc; /* position in buffer */ - int dd_seek; - char *dd_buf; /* buffer */ - int dd_len; /* buffer length */ - int dd_size; /* amount of data in buffer */ - _LOCK_RECURSIVE_T dd_lock; -} DIR; - - -#define __dirfd(dir) (dir)->dd_fd - -/* --- redundant --- */ - -DIR *opendir(const char *); -struct dirent *readdir(DIR *); -void rewinddir(DIR *); -int closedir(DIR *); - -/* internal prototype */ -void _seekdir(DIR *dir,off_t offset); - -#ifndef _POSIX_SOURCE -long telldir (DIR *); -void seekdir (DIR *, off_t loc); - -int scandir (const char *__dir, - struct dirent ***__namelist, - int (*select) (const struct dirent *), - int (*compar) (const struct dirent **, const struct dirent **)); - -int alphasort (const struct dirent **__a, const struct dirent **__b); -#endif /* _POSIX_SOURCE */ - -#endif diff --git a/newlib/libc/sys/linux/sys/errno.h b/newlib/libc/sys/linux/sys/errno.h deleted file mode 100644 index 82c84c944..000000000 --- a/newlib/libc/sys/linux/sys/errno.h +++ /dev/null @@ -1,34 +0,0 @@ -/* libc/sys/linux/sys/errno.h - Errno variable and codes */ - -/* Written 2000 by Werner Almesberger */ - - -#ifndef _SYS_ERRNO_H -#define _SYS_ERRNO_H - -/* --- from newlin's sys/errno.h --- */ - -#include <sys/reent.h> - -#ifndef _REENT_ONLY -#define errno (*__errno()) -extern int *__errno _PARAMS ((void)); -#endif - -extern __IMPORT _CONST char * _CONST _sys_errlist[]; -extern __IMPORT int _sys_nerr; - -#define __errno_r(ptr) ((ptr)->_errno) - -/* --- end of slight redundancy (the use of struct _reent->_errno is - hard-coded in perror.c so why pretend anything else could work too ? */ - -#define __set_errno(x) (errno = (x)) - -#include <asm/errno.h> - -#define ENOTSUP EOPNOTSUPP -#define EFTYPE 79 /* Inappropriate file type or format */ -#define EILSEQ 84 - -#endif diff --git a/newlib/libc/sys/linux/sys/fcntl.h b/newlib/libc/sys/linux/sys/fcntl.h deleted file mode 100644 index 78914fd8f..000000000 --- a/newlib/libc/sys/linux/sys/fcntl.h +++ /dev/null @@ -1,29 +0,0 @@ -/* libc/sys/linux/sys/fcntl.h - File access */ - -/* Written 2000 by Werner Almesberger */ - - -#ifndef _SYS_FCNTL_H -#define _SYS_FCNTL_H - -#include <sys/types.h> -#include <linux/fcntl.h> - -/* --- redundant stuff below --- */ - -#include <_ansi.h> - -extern int creat _PARAMS ((const char *, mode_t)); -extern int _open _PARAMS ((const char *, int, ...)); - -#ifdef __KERNEL_PROTOTYPES -extern int open(const char *pathname, int flags, mode_t mode); -extern int fcntl(int fd, int cmd, long arg); -#else -extern int open _PARAMS ((const char *, int, ...)); -extern int fcntl _PARAMS ((int, int, ...)); -#endif - -extern int _fcntl _PARAMS ((int, int, ...)); - -#endif diff --git a/newlib/libc/sys/linux/sys/features.h b/newlib/libc/sys/linux/sys/features.h deleted file mode 100644 index 34cd0eb80..000000000 --- a/newlib/libc/sys/linux/sys/features.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef _SYS_FEATURES_H -#define _SYS_FEATURES_H - -#include <bits/posix_opt.h> - -/* We do not support asynchronous I/O. */ -#undef _POSIX_ASYNCHRONOUS_IO -#undef _POSIX_ASYNC_IO -#undef _LFS_ASYNCHRONOUS_IO -#undef _LFS64_ASYNCHRONOUS_IO - -/* POSIX message queues are supported. */ -#undef _POSIX_MESSAGE_PASSING -#define _POSIX_MESSAGE_PASSING 1 - -#endif /* _SYS_FEATURES_H */ diff --git a/newlib/libc/sys/linux/sys/file.h b/newlib/libc/sys/linux/sys/file.h deleted file mode 100644 index 875ee18c4..000000000 --- a/newlib/libc/sys/linux/sys/file.h +++ /dev/null @@ -1,13 +0,0 @@ -/* libc/sys/linux/sys/file.h - BSD compatibility */ - -/* Written 2000 by Werner Almesberger */ - - -#ifndef _SYS_FILE_H -#define _SYS_FILE_H - -#include <sys/fcntl.h> - -int flock(int fd,int operation); - -#endif diff --git a/newlib/libc/sys/linux/sys/ioctl.h b/newlib/libc/sys/linux/sys/ioctl.h deleted file mode 100644 index 12e0cd22d..000000000 --- a/newlib/libc/sys/linux/sys/ioctl.h +++ /dev/null @@ -1,11 +0,0 @@ -/* libc/sys/linux/sys/ioctl.h - ioctl prototype */ - -/* Written 2000 by Werner Almesberger */ - - -#ifndef _SYS_IOCTL_H -#define _SYS_IOCTL_H - -int ioctl(int fd,int request,...); - -#endif diff --git a/newlib/libc/sys/linux/sys/linux_time.h b/newlib/libc/sys/linux/sys/linux_time.h deleted file mode 100644 index e71f70bba..000000000 --- a/newlib/libc/sys/linux/sys/linux_time.h +++ /dev/null @@ -1,76 +0,0 @@ -#ifndef _LINUX_TIME_H -#define _LINUX_TIME_H - -#include <asm/param.h> -#include <sys/types.h> - -#ifndef _STRUCT_TIMESPEC -#define _STRUCT_TIMESPEC -struct timespec { - time_t tv_sec; /* seconds */ - long tv_nsec; /* nanoseconds */ -}; -#endif /* _STRUCT_TIMESPEC */ - -/* - * Change timeval to jiffies, trying to avoid the - * most obvious overflows.. - * - * And some not so obvious. - * - * Note that we don't want to return MAX_LONG, because - * for various timeout reasons we often end up having - * to wait "jiffies+1" in order to guarantee that we wait - * at _least_ "jiffies" - so "jiffies+1" had better still - * be positive. - */ -#define MAX_JIFFY_OFFSET ((~0UL >> 1)-1) - -static __inline__ unsigned long -timespec_to_jiffies(struct timespec *value) -{ - unsigned long sec = value->tv_sec; - long nsec = value->tv_nsec; - - if (sec >= (MAX_JIFFY_OFFSET / HZ)) - return MAX_JIFFY_OFFSET; - nsec += 1000000000L / HZ - 1; - nsec /= 1000000000L / HZ; - return HZ * sec + nsec; -} - -static __inline__ void -jiffies_to_timespec(unsigned long jiffies, struct timespec *value) -{ - value->tv_nsec = (jiffies % HZ) * (1000000000L / HZ); - value->tv_sec = jiffies / HZ; -} - -#ifndef _STRUCT_TIMEVAL -#define _STRUCT_TIMEVAL -struct timeval { - time_t tv_sec; /* seconds */ - suseconds_t tv_usec; /* microseconds */ -}; -#endif - -struct timezone { - int tz_minuteswest; /* minutes west of Greenwich */ - int tz_dsttime; /* type of dst correction */ -}; - -#define ITIMER_REAL 0 -#define ITIMER_VIRTUAL 1 -#define ITIMER_PROF 2 - -struct itimerspec { - struct timespec it_interval; /* timer period */ - struct timespec it_value; /* timer expiration */ -}; - -struct itimerval { - struct timeval it_interval; /* timer interval */ - struct timeval it_value; /* current value */ -}; - -#endif diff --git a/newlib/libc/sys/linux/sys/resource.h b/newlib/libc/sys/linux/sys/resource.h deleted file mode 100644 index f804731f9..000000000 --- a/newlib/libc/sys/linux/sys/resource.h +++ /dev/null @@ -1,12 +0,0 @@ -/* libc/sys/linux/sys/resource.h - Resource usage */ - -/* Written 2000 by Werner Almesberger */ - - -#ifndef _SYS_RESOURCE_H -#define _SYS_RESOURCE_H - -#include <sys/types.h> -#include <bits/resource.h> - -#endif diff --git a/newlib/libc/sys/linux/sys/select.h b/newlib/libc/sys/linux/sys/select.h deleted file mode 100644 index ddd2ac9d2..000000000 --- a/newlib/libc/sys/linux/sys/select.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef _SYS_SELECT_H -#define _SYS_SELECT_H 1 - -#include <sys/types.h> -#include <bits/sigset.h> -#include <time.h> - -extern int select (int __nfds, fd_set *__restrict __readfds, - fd_set *__restrict __writefds, - fd_set *__restrict __exceptfds, - struct timeval *__restrict __timeout) __THROW; - -#endif /* sys/select.h */ diff --git a/newlib/libc/sys/linux/sys/signal.h b/newlib/libc/sys/linux/sys/signal.h deleted file mode 100644 index cef7058cd..000000000 --- a/newlib/libc/sys/linux/sys/signal.h +++ /dev/null @@ -1,56 +0,0 @@ -/* libc/sys/linux/sys/signal.h - Signal handling */ - -/* Written 2000 by Werner Almesberger */ - - -#ifndef _SYS_SIGNAL_H -#define _SYS_SIGNAL_H -#define _SIGNAL_H - -#include <sys/types.h> -#include <bits/sigset.h> -#include <bits/signum.h> - -/* we want RT signals so we must override the definition of sigset_t - and NSIG */ - -#undef NSIG -#define NSIG _NSIG -#undef sigset_t -#define sigset_t __sigset_t - -typedef void (*_sig_func_ptr) (int); -typedef _sig_func_ptr __sighandler_t; - -#include <bits/siginfo.h> -#include <bits/sigaction.h> -#include <bits/sigstack.h> - -/* --- include/signal.h thinks it knows better :-( --- */ - -#undef SIG_DFL -#undef SIG_IGN -#undef SIG_ERR - -/* --- redundant stuff below --- */ - -#include <_ansi.h> - -int _EXFUN(kill, (int, int)); -_VOID _EXFUN(psignal, (int, const char *)); -int _EXFUN(sigaction, (int, const struct sigaction *, struct sigaction *)); -int _EXFUN(sigaddset, (sigset_t *, const int)); -int _EXFUN(sigdelset, (sigset_t *, const int)); -int _EXFUN(sigismember, (const sigset_t *, int)); -int _EXFUN(sigfillset, (sigset_t *)); -int _EXFUN(sigemptyset, (sigset_t *)); -int _EXFUN(sigpending, (sigset_t *)); -int _EXFUN(sigsuspend, (const sigset_t *)); -int _EXFUN(sigpause, (int)); - -#ifndef _POSIX_SOURCE -extern const char *const sys_siglist[]; -typedef __sighandler_t sig_t; /* BSDism */ -#endif - -#endif diff --git a/newlib/libc/sys/linux/sys/stat.h b/newlib/libc/sys/linux/sys/stat.h deleted file mode 100644 index 7bc06f7ae..000000000 --- a/newlib/libc/sys/linux/sys/stat.h +++ /dev/null @@ -1,32 +0,0 @@ -/* libc/sys/linux/sys/stat.h - Stat structure and macros */ - -/* Written 2000 by Werner Almesberger */ - - -#ifndef _SYS_STAT_H -#define _SYS_STAT_H - -#include <asm/stat.h> -#define __KERNEL__ -#include <linux/stat.h> -#undef __KERNEL__ - -/* --- redundant stuff below --- */ - -#include <_ansi.h> -#include <sys/types.h> - -int _EXFUN(fstat,( int __fd, struct stat *__sbuf )); -int _EXFUN(mkdir,( const char *_path, mode_t __mode )); -int _EXFUN(mkfifo,( const char *__path, mode_t __mode )); -int _EXFUN(stat,( const char *__path, struct stat *__sbuf )); -mode_t _EXFUN(umask,( mode_t __mask )); - -#ifndef _POSIX_SOURCE -int _EXFUN(fstat64,( int __fd, struct stat *__sbuf )); -int _EXFUN(lstat,( const char *file_name, struct stat *buf)); -int _EXFUN(lstat64,( const char *file_name, struct stat *buf)); -int _EXFUN(stat64,( const char *__path, struct stat *__sbuf )); -#endif /* _POSIX_SOURCE */ - -#endif /* _SYS_STAT_H */ diff --git a/newlib/libc/sys/linux/sys/stdio.h b/newlib/libc/sys/linux/sys/stdio.h deleted file mode 100644 index a99308161..000000000 --- a/newlib/libc/sys/linux/sys/stdio.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef _NEWLIB_STDIO_H -#define _NEWLIB_STDIO_H - -/* Internal locking macros, used to protect stdio functions. In the - linux case, expand to flockfile, and funlockfile, both defined in - LinuxThreads. */ -#if !defined(__SINGLE_THREAD__) -# if !defined(_flockfile) -# define _flockfile(fp) flockfile(fp) -# endif -# if !defined(_funlockfile) -# define _funlockfile(fp) funlockfile(fp) -# endif -#endif /* __SINGLE_THREAD__ */ - -#define getline __getline -#define getdelim __getdelim - -char * _EXFUN(ctermid, (char *)); - -#endif /* _NEWLIB_STDIO_H */ diff --git a/newlib/libc/sys/linux/sys/termios.h b/newlib/libc/sys/linux/sys/termios.h deleted file mode 100644 index ae053b5e4..000000000 --- a/newlib/libc/sys/linux/sys/termios.h +++ /dev/null @@ -1,17 +0,0 @@ -/* libc/sys/linux/sys/termios.h - Terminal control definitions */ - -/* Written 2000 by Werner Almesberger */ - - -#ifndef _SYS_TERMIOS_H -#define _SYS_TERMIOS_H - -#include <linux/termios.h> -#include <machine/termios.h> - -/* grr, this shouldn't have to be here */ - -int tcgetattr(int fd,struct termios *termios_p); -int tcsetattr(int fd,int optional_actions,const struct termios *termios_p); - -#endif diff --git a/newlib/libc/sys/linux/sys/time.h b/newlib/libc/sys/linux/sys/time.h deleted file mode 100644 index f2c656e5a..000000000 --- a/newlib/libc/sys/linux/sys/time.h +++ /dev/null @@ -1,94 +0,0 @@ -/* libc/sys/linux/sys/time.h - Time handling */ - -/* Written 2000 by Werner Almesberger */ - -/* - * Copyright (c) 1982, 1986, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)time.h 8.5 (Berkeley) 5/4/95 - * $FreeBSD: src/sys/sys/time.h,v 1.56 2002/05/05 04:33:09 bde Exp $ - */ - -#ifndef _SYS_TIME_H -#define _SYS_TIME_H - -#include <sys/types.h> -#include <sys/linux_time.h> - -/* Macros for converting between `struct timeval' and `struct timespec'. */ -# define TIMEVAL_TO_TIMESPEC(tv, ts) { \ - (ts)->tv_sec = (tv)->tv_sec; \ - (ts)->tv_nsec = (tv)->tv_usec * 1000; \ -} -# define TIMESPEC_TO_TIMEVAL(tv, ts) { \ - (tv)->tv_sec = (ts)->tv_sec; \ - (tv)->tv_usec = (ts)->tv_nsec / 1000; \ -} - -/* Convenience macros for operations on timevals. - NOTE: `timercmp' does not work for >= or <=. */ -# define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec) -# define timerclear(tvp) ((tvp)->tv_sec = (tvp)->tv_usec = 0) -# define timercmp(a, b, CMP) \ - (((a)->tv_sec == (b)->tv_sec) ? \ - ((a)->tv_usec CMP (b)->tv_usec) : \ - ((a)->tv_sec CMP (b)->tv_sec)) -# define timeradd(a, b, result) \ - do { \ - (result)->tv_sec = (a)->tv_sec + (b)->tv_sec; \ - (result)->tv_usec = (a)->tv_usec + (b)->tv_usec; \ - if ((result)->tv_usec >= 1000000) \ - { \ - ++(result)->tv_sec; \ - (result)->tv_usec -= 1000000; \ - } \ - } while (0) -# define timersub(a, b, result) \ - do { \ - (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \ - (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \ - if ((result)->tv_usec < 0) { \ - --(result)->tv_sec; \ - (result)->tv_usec += 1000000; \ - } \ - } while (0) -/* --- redundant stuff below --- */ - -#include <_ansi.h> - -int _EXFUN(gettimeofday, (struct timeval *__p, struct timezone *__z)); -int _EXFUN(settimeofday, (const struct timeval *, const struct timezone *)); -int _EXFUN(utimes, (const char *__path, const struct timeval __tvp[2])); -int _EXFUN(getitimer, (int __which, struct itimerval *__value)); -int _EXFUN(setitimer, (int __which, const struct itimerval *__value, - struct itimerval *__ovalue)); -#endif diff --git a/newlib/libc/sys/linux/sys/types.h b/newlib/libc/sys/linux/sys/types.h deleted file mode 100644 index 90011ea83..000000000 --- a/newlib/libc/sys/linux/sys/types.h +++ /dev/null @@ -1,176 +0,0 @@ -/* libc/sys/linux/sys/types.h - The usual type zoo */ - -/* Written 2000 by Werner Almesberger */ - -/*- - * Copyright (c) 1982, 1986, 1991, 1993, 1994 - * The Regents of the University of California. All rights reserved. - * (c) UNIX System Laboratories, Inc. - * All or some portions of this file are derived from material licensed - * to the University of California by American Telephone and Telegraph - * Co. or Unix System Laboratories, Inc. and are reproduced herein with - * the permission of UNIX System Laboratories, Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)types.h 8.6 (Berkeley) 2/19/95 - * $FreeBSD: src/sys/sys/types.h,v 1.60 2002/04/10 15:58:13 mike Exp $ - */ - -#ifndef _SYS_TYPES_H -#define _SYS_TYPES_H - -/* Newlib has it's own time_t and clock_t definitions in - * libc/include/sys/types.h. Repeat those here and - * skip the kernel's definitions. */ - -#include <sys/config.h> -#include <machine/types.h> -#include <sys/_types.h> - -#if !defined(__time_t_defined) && !defined(_TIME_T) -#define _TIME_T -#define __time_t_defined -typedef _TIME_T_ time_t; -#endif - -#if !defined(__clock_t_defined) && !defined(_CLOCK_T) -#define _CLOCK_T -#define __clock_t_defined -typedef _CLOCK_T_ clock_t; -#endif - -#ifndef _SSIZE_T -#define _SSIZE_T -typedef _ssize_t ssize_t; -#endif - -#ifndef __u_char_defined -#ifdef __GNUC__ -__extension__ typedef long long quad_t; -__extension__ typedef unsigned long long u_quad_t; -#else -typedef struct - { - long int __val[2]; - } quad_t; -typedef struct - { - unsigned long __val[2]; - } u_quad_t; -#endif -typedef struct - { - int __val[2]; - } fsid_t; -#define __u_char_defined -#endif - -typedef int clockid_t; - -# define _SYS_TYPES_FD_SET -# define NBBY 8 /* number of bits in a byte */ -/* - * Select uses bit masks of file descriptors in longs. - * These macros manipulate such bit fields (the filesystem macros use chars). - * FD_SETSIZE may be defined by the user, but the default here - * should be >= NOFILE (param.h). - */ -# ifndef FD_SETSIZE -# define FD_SETSIZE 64 -# endif - -typedef long fd_mask; -# define NFDBITS (sizeof (fd_mask) * NBBY) /* bits per mask */ -# ifndef howmany -# define howmany(x,y) (((x)+((y)-1))/(y)) -# endif - -#define fd_set _types_fd_set - -# define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1L << ((n) % NFDBITS))) -# define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1L << ((n) % NFDBITS))) -# define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1L << ((n) % NFDBITS))) -# define FD_ZERO(p) (__extension__ (void)({ \ - size_t __i; \ - char *__tmp = (char *)p; \ - for (__i = 0; __i < sizeof (*(p)); ++__i) \ - *__tmp++ = 0; \ -})) - -#include <linux/types.h> -#include <bits/types.h> -#define __mode_t_defined -#define __gid_t_defined -#define __uid_t_defined -#define __pid_t_defined -#define __ssize_t_defined -#define __key_t_defined -#define __off_t_defined -#define __off64_t_defined - -typedef __ino64_t ino64_t; -typedef __uint32_t uintptr_t; -typedef __int32_t intptr_t; -typedef __off64_t off64_t; -typedef __off_t off_t; - -#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE) -typedef struct _physadr { - int r[1]; -} *physadr; - -typedef struct label_t { - int val[6]; -} label_t; -#endif - -typedef unsigned int vm_offset_t; -typedef __int64_t vm_ooffset_t; -typedef unsigned int vm_pindex_t; -typedef unsigned int vm_size_t; - -typedef __int32_t register_t; -typedef __uint32_t u_register_t; - -#ifdef _KERNEL -typedef int intfptr_t; -typedef unsigned int uintfptr_t; -#endif - -/* Critical section value */ -typedef register_t critical_t; - -/* Interrupt mask (spl, xxx_imask, etc) */ -typedef __uint32_t intrmask_t; - -/* Interrupt handler function type. */ -typedef void ointhand2_t(int _device_id); - -#endif diff --git a/newlib/libc/sys/linux/sys/unistd.h b/newlib/libc/sys/linux/sys/unistd.h deleted file mode 100644 index dd3f0f7ea..000000000 --- a/newlib/libc/sys/linux/sys/unistd.h +++ /dev/null @@ -1,148 +0,0 @@ -#ifndef _UNISTD_H -#define _UNISTD_H - -#include <features.h> - -#ifdef __cplusplus -extern "C" { -#endif - -#include <_ansi.h> -#include <sys/types.h> -#include <sys/_types.h> -#define __need_size_t -#define __need_ptrdiff_t -#include <stddef.h> - -extern char **environ; - -void _EXFUN(_exit, (int __status ) _ATTRIBUTE ((noreturn))); - -int _EXFUN(access,(const char *__path, int __amode )); -unsigned _EXFUN(alarm, (unsigned __secs )); -int _EXFUN(chdir, (const char *__path )); -int _EXFUN(chmod, (const char *__path, mode_t __mode )); -int _EXFUN(chown, (const char *__path, uid_t __owner, gid_t __group )); -int _EXFUN(chroot, (const char *__path )); -int _EXFUN(close, (int __fildes )); -char _EXFUN(*ctermid, (char *__s )); -char _EXFUN(*cuserid, (char *__s )); -int _EXFUN(dup, (int __fildes )); -int _EXFUN(dup2, (int __fildes, int __fildes2 )); -#if defined(__CYGWIN__) -void _EXFUN(endusershell, (void)); -#endif -int _EXFUN(execl, (const char *__path, const char *, ... )); -int _EXFUN(execle, (const char *__path, const char *, ... )); -int _EXFUN(execlp, (const char *__file, const char *, ... )); -int _EXFUN(execv, (const char *__path, char * const __argv[] )); -int _EXFUN(execve, (const char *__path, char * const __argv[], char * const __envp[] )); -int _EXFUN(execvp, (const char *__file, char * const __argv[] )); -int _EXFUN(fchdir, (int __fildes)); -int _EXFUN(fchmod, (int __fildes, mode_t __mode )); -int _EXFUN(fchown, (int __fildes, uid_t __owner, gid_t __group )); -pid_t _EXFUN(fork, (void )); -long _EXFUN(fpathconf, (int __fd, int __name )); -int _EXFUN(fsync, (int __fd)); -char _EXFUN(*getcwd, (char *__buf, size_t __size )); -int _EXFUN(getdomainname ,(char *__name, size_t __len)); -gid_t _EXFUN(getegid, (void )); -uid_t _EXFUN(geteuid, (void )); -gid_t _EXFUN(getgid, (void )); -int _EXFUN(getgroups, (int __gidsetsize, gid_t __grouplist[] )); -char _EXFUN(*getlogin, (void )); -#if defined(_POSIX_THREAD_SAFE_FUNCTIONS) -int _EXFUN(getlogin_r, (char *name, size_t namesize) ); -#endif -char _EXFUN(*getpass, (__const char *__prompt)); -size_t _EXFUN(getpagesize, (void)); -pid_t _EXFUN(getpgid, (pid_t)); -pid_t _EXFUN(getpgrp, (void )); -pid_t _EXFUN(getpid, (void )); -pid_t _EXFUN(getppid, (void )); -uid_t _EXFUN(getuid, (void )); -char * _EXFUN(getusershell, (void)); -char _EXFUN(*getwd, (char *__buf )); -int _EXFUN(isatty, (int __fildes )); -int _EXFUN(lchown, (const char *__path, uid_t __owner, gid_t __group )); -int _EXFUN(link, (const char *__path1, const char *__path2 )); -int _EXFUN(nice, (int __nice_value )); -off_t _EXFUN(lseek, (int __fildes, off_t __offset, int __whence )); -long _EXFUN(pathconf, (const char *__path, int __name )); -int _EXFUN(pause, (void )); -#ifdef __CYGWIN__ -int _EXFUN(pthread_atfork, (void (*)(void), void (*)(void), void (*)(void))); -#endif -int _EXFUN(pipe, (int __fildes[2] )); -ssize_t _EXFUN(pread, (int __fd, void *__buf, size_t __nbytes, off_t __offset)); -ssize_t _EXFUN(pwrite, (int __fd, const void *__buf, size_t __nbytes, off_t __offset)); -_READ_WRITE_RETURN_TYPE _EXFUN(read, (int __fd, void *__buf, size_t __nbyte )); -int _EXFUN(rmdir, (const char *__path )); -void * _EXFUN(sbrk, (ptrdiff_t __incr)); -int _EXFUN(setegid, (gid_t __gid )); -int _EXFUN(seteuid, (uid_t __uid )); -int _EXFUN(setgid, (gid_t __gid )); -int _EXFUN(setpgid, (pid_t __pid, pid_t __pgid )); -int _EXFUN(setpgrp, (void )); -pid_t _EXFUN(setsid, (void )); -int _EXFUN(setuid, (uid_t __uid )); -unsigned _EXFUN(sleep, (unsigned int __seconds )); -void _EXFUN(swab, (const void *, void *, ssize_t)); -long _EXFUN(sysconf, (int __name )); -pid_t _EXFUN(tcgetpgrp, (int __fildes )); -int _EXFUN(tcsetpgrp, (int __fildes, pid_t __pgrp_id )); -char * _EXFUN(ttyname, (int __fildes )); -int _EXFUN(ttyname_r, (int __fildes, char *__buf, size_t __len)); -int _EXFUN(unlink, (const char *__path )); -int _EXFUN(vhangup, (void )); -_READ_WRITE_RETURN_TYPE _EXFUN(write, (int __fd, const void *__buf, size_t __nbyte )); - -extern char *optarg; /* getopt(3) external variables */ -extern int optind, opterr, optopt; -int getopt(int, char * const [], const char *); -extern int optreset; /* getopt(3) external variable */ - -#ifndef _POSIX_SOURCE -pid_t _EXFUN(vfork, (void )); - -extern char *suboptarg; /* getsubopt(3) external variable */ -int getsubopt(char **, char * const *, char **); -#endif /* _POSIX_SOURCE */ - -/* Provide prototypes for most of the _<systemcall> names that are - provided in newlib for some compilers. */ -int _EXFUN(_close, (int __fildes )); -pid_t _EXFUN(_fork, (void )); -pid_t _EXFUN(_getpid, (void )); -int _EXFUN(_link, (const char *__path1, const char *__path2 )); -off_t _EXFUN(_lseek, (int __fildes, off_t __offset, int __whence )); -_READ_WRITE_RETURN_TYPE _EXFUN(_read, (int __fd, void *__buf, size_t __nbyte )); -void * _EXFUN(_sbrk, (size_t __incr)); -int _EXFUN(_unlink, (const char *__path )); -_READ_WRITE_RETURN_TYPE _EXFUN(_write, (int __fd, const void *__buf, size_t __nbyte )); -int _EXFUN(_execve, (const char *__path, char * const __argv[], char * const __envp[] )); - -#define F_OK 0 -#define R_OK 4 -#define W_OK 2 -#define X_OK 1 - -# define SEEK_SET 0 -# define SEEK_CUR 1 -# define SEEK_END 2 - -#include <sys/features.h> - -#define STDIN_FILENO 0 /* standard input file descriptor */ -#define STDOUT_FILENO 1 /* standard output file descriptor */ -#define STDERR_FILENO 2 /* standard error file descriptor */ - -#include <bits/environments.h> -#include <bits/confname.h> - -# define MAXPATHLEN 1024 - -#ifdef __cplusplus -} -#endif -#endif /* _SYS_UNISTD_H */ diff --git a/newlib/libc/sys/linux/sys/utime.h b/newlib/libc/sys/linux/sys/utime.h deleted file mode 100644 index 7499cfe7e..000000000 --- a/newlib/libc/sys/linux/sys/utime.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef _SYS_UTIME_H -#define _SYS_UTIME_H 1 - -#include <sys/types.h> - -struct utimbuf - { - time_t actime; /* Access time. */ - time_t modtime; /* Modification time. */ - }; - -int _EXFUN(utime, (const char *__file, const struct utimbuf *__times)); - -#endif /* _SYS_UTIME_H */ diff --git a/newlib/libc/sys/linux/sys/utmp.h b/newlib/libc/sys/linux/sys/utmp.h deleted file mode 100644 index a837483a9..000000000 --- a/newlib/libc/sys/linux/sys/utmp.h +++ /dev/null @@ -1,54 +0,0 @@ -/* libc/sys/linux/sys/utmp.h - utmp structure */ - -/* Written 2000 by Werner Almesberger */ - - -/* Some things copied from glibc's /usr/include/bits/utmp.h */ - - -#ifndef _SYS_UTMP_H -#define _SYS_UTMP_H - - -#include <sys/types.h> - - -#define UTMP_FILE "/var/run/utmp" - -#define UT_LINESIZE 32 -#define UT_NAMESIZE 32 -#define UT_HOSTSIZE 256 - -struct utmp { - short int ut_type; - pid_t ut_pid; - char ut_line[UT_LINESIZE]; - char ut_id[4]; - char ut_user[UT_NAMESIZE]; - char ut_host[UT_HOSTSIZE]; - char __filler[52]; -}; - -#define RUN_LVL 1 -#define BOOT_TIME 2 -#define NEW_TIME 3 -#define OLD_TIME 4 - -#define INIT_PROCESS 5 -#define LOGIN_PROCESS 6 -#define USER_PROCESS 7 -#define DEAD_PROCESS 8 - - -/* --- redundant, from sys/cygwin/sys/utmp.h --- */ - -struct utmp *_getutline (struct utmp *); -struct utmp *getutent (void); -struct utmp *getutid (struct utmp *); -struct utmp *getutline (struct utmp *); -void endutent (void); -void pututline (struct utmp *); -void setutent (void); -void utmpname (const char *); - -#endif diff --git a/newlib/libc/sys/linux/sys/utsname.h b/newlib/libc/sys/linux/sys/utsname.h deleted file mode 100644 index 4de4c63be..000000000 --- a/newlib/libc/sys/linux/sys/utsname.h +++ /dev/null @@ -1,23 +0,0 @@ -/* libc/sys/linux/sys/utsname.h - System identification */ - -/* Written 2000 by Werner Almesberger */ - - -#ifndef _SYS_UTSNAME_H -#define _SYS_UTSNAME_H - -#define __UTSNAMELEN 65 /* synchronize with kernel */ - -struct utsname { - char sysname[__UTSNAMELEN]; - char nodename[__UTSNAMELEN]; - char release[__UTSNAMELEN]; - char version[__UTSNAMELEN]; - char machine[__UTSNAMELEN]; - char domainname[__UTSNAMELEN]; -}; - - -int uname(struct utsname *name); - -#endif diff --git a/newlib/libc/sys/linux/sys/wait.h b/newlib/libc/sys/linux/sys/wait.h deleted file mode 100644 index 4cc337783..000000000 --- a/newlib/libc/sys/linux/sys/wait.h +++ /dev/null @@ -1,40 +0,0 @@ -/* libc/sys/linux/sys/wait.h - Wait for children */ - -/* Written 2000 by Werner Almesberger */ - - -#ifndef _SYS_WAIT_H -#define _SYS_WAIT_H - -#include <linux/wait.h> - -#define WIFEXITED(status) (!WTERMSIG(status)) -#define WEXITSTATUS(status) (((status) >> 8) & 0xff) -#define WIFSIGNALED(status) (!WIFSTOPPED(status) && !WIFEXITED(status)) -#define WTERMSIG(status) ((status ) & 0x7f) -#define WIFSTOPPED(status) (((status) & 0xff) == 0x7f) -#define WSTOPSIG(status) WEXITSTATUS(status) - -#ifndef _POSIX_SOURCE -#define WCOREDUMP(status) ((status) & 0x80) -#endif - -/* --- redundant stuff below --- */ - -#include <_ansi.h> -#include <sys/types.h> - -pid_t wait (int *); -pid_t waitpid (pid_t, int *, int); - -pid_t _wait (int *); - - -#ifndef _POSIX_SOURCE -#include <sys/resource.h> - -pid_t wait3(int *status,int options,struct rusage *rusage); -pid_t wait4(pid_t pid,int *status,int options,struct rusage *rusage); -#endif - -#endif |