diff options
Diffstat (limited to 'newlib/libc/include/sys')
-rw-r--r-- | newlib/libc/include/sys/config.h | 18 | ||||
-rw-r--r-- | newlib/libc/include/sys/dirent.h | 8 | ||||
-rw-r--r-- | newlib/libc/include/sys/fcntl.h | 6 | ||||
-rw-r--r-- | newlib/libc/include/sys/features.h | 1 | ||||
-rw-r--r-- | newlib/libc/include/sys/reent.h | 4 | ||||
-rw-r--r-- | newlib/libc/include/sys/signal.h | 7 | ||||
-rw-r--r-- | newlib/libc/include/sys/string.h | 2 | ||||
-rw-r--r-- | newlib/libc/include/sys/time.h | 8 | ||||
-rw-r--r-- | newlib/libc/include/sys/types.h | 54 | ||||
-rw-r--r-- | newlib/libc/include/sys/unistd.h | 7 |
10 files changed, 44 insertions, 71 deletions
diff --git a/newlib/libc/include/sys/config.h b/newlib/libc/include/sys/config.h index c4e4dba9a..1dd045498 100644 --- a/newlib/libc/include/sys/config.h +++ b/newlib/libc/include/sys/config.h @@ -59,7 +59,7 @@ /* in other words, go32 */ #define _FLOAT_RET double #endif -#if defined(__linux__) || defined(__RDOS__) +#ifdef __linux__ /* we want the reentrancy structure to be returned by a function */ #define __DYNAMIC_REENT__ #define HAVE_GETDATE @@ -105,22 +105,6 @@ #define __BUFSIZ__ 16 #define _REENT_SMALL #endif -#ifdef __m32c__ -#define __SMALL_BITFIELDS -#undef INT_MAX -#undef UINT_MAX -#define INT_MAX __INT_MAX__ -#define UINT_MAX (__INT_MAX__ * 2U + 1) -#define MALLOC_ALIGNMENT 8 -#if defined(__r8c_cpu__) || defined(__m16c_cpu__) -#define _POINTER_INT short -#else -#define _POINTER_INT long -#endif -#define __BUFSIZ__ 16 -#define _REENT_SMALL -#endif /* __m32c__ */ - /* This block should be kept in sync with GCC's limits.h. The point of having these definitions here is to not include limits.h, which diff --git a/newlib/libc/include/sys/dirent.h b/newlib/libc/include/sys/dirent.h index a3fb5c02c..f2f2342d5 100644 --- a/newlib/libc/include/sys/dirent.h +++ b/newlib/libc/include/sys/dirent.h @@ -1,13 +1,15 @@ /* <dirent.h> includes <sys/dirent.h>, which is this file. On a system which supports <dirent.h>, this file is overridden by dirent.h in the libc/sys/.../sys directory. On a system which does - not support <dirent.h>, we will get this file which uses #error to force - an error. */ + not support <dirent.h>, we will get this file which tries to find + any other <dirent.h> which may be lurking around. If there isn't + one, the user will get an error indicating that there is no + <dirent.h>. */ #ifdef __cplusplus extern "C" { #endif -#error "<dirent.h> not supported" +#include_next <dirent.h> #ifdef __cplusplus } #endif diff --git a/newlib/libc/include/sys/fcntl.h b/newlib/libc/include/sys/fcntl.h index fd8917d1e..0a680a1da 100644 --- a/newlib/libc/include/sys/fcntl.h +++ b/newlib/libc/include/sys/fcntl.h @@ -37,9 +37,9 @@ extern "C" { #define O_CREAT _FCREAT #define O_TRUNC _FTRUNC #define O_EXCL _FEXCL -#define O_SYNC _FSYNC +/* O_SYNC _FSYNC not posix, defined below */ /* O_NDELAY _FNDELAY set in include/fcntl.h */ -/* O_NDELAY _FNBIO set in include/fcntl.h */ +/* O_NDELAY _FNBIO set in 5include/fcntl.h */ #define O_NONBLOCK _FNONBLOCK #define O_NOCTTY _FNOCTTY /* For machines which care - */ @@ -68,6 +68,8 @@ extern "C" { #ifndef _POSIX_SOURCE +#define O_SYNC _FSYNC + /* * Flags that work for fcntl(fd, F_SETFL, FXXXX) */ diff --git a/newlib/libc/include/sys/features.h b/newlib/libc/include/sys/features.h index 6754f1e9d..af31ce670 100644 --- a/newlib/libc/include/sys/features.h +++ b/newlib/libc/include/sys/features.h @@ -88,7 +88,6 @@ extern "C" { # define _POSIX_THREAD_ATTR_STACKSIZE 1 # define _POSIX_SEMAPHORES 1 # define _POSIX_TIMERS 1 -# define _POSIX_MEMLOCK_RANGE 1 #endif #ifdef __cplusplus diff --git a/newlib/libc/include/sys/reent.h b/newlib/libc/include/sys/reent.h index 7911b6cbc..53cc14281 100644 --- a/newlib/libc/include/sys/reent.h +++ b/newlib/libc/include/sys/reent.h @@ -158,9 +158,9 @@ struct __sFILE_fake { struct _reent *_data; }; /* CHECK_INIT() comes from stdio/local.h; be sure to include that. */ -# define _REENT_SMALL_CHECK_INIT(ptr) CHECK_INIT(ptr) +# define _REENT_SMALL_CHECK_INIT(fp) CHECK_INIT(fp) #else -# define _REENT_SMALL_CHECK_INIT(ptr) /* nothing */ +# define _REENT_SMALL_CHECK_INIT(fp) /* nothing */ #endif struct __sFILE { diff --git a/newlib/libc/include/sys/signal.h b/newlib/libc/include/sys/signal.h index 78f06951e..2bfbbf0a8 100644 --- a/newlib/libc/include/sys/signal.h +++ b/newlib/libc/include/sys/signal.h @@ -2,6 +2,7 @@ #ifndef _SYS_SIGNAL_H #define _SYS_SIGNAL_H + #ifdef __cplusplus extern "C" { #endif @@ -301,10 +302,4 @@ int _EXFUN(sigqueue, (pid_t pid, int signo, const union sigval value)); #ifdef __cplusplus } #endif - -#ifndef _SIGNAL_H_ -/* Some applications take advantage of the fact that <sys/signal.h> - * and <signal.h> are equivalent in glibc. Allow for that here. */ -#include <signal.h> -#endif #endif /* _SYS_SIGNAL_H */ diff --git a/newlib/libc/include/sys/string.h b/newlib/libc/include/sys/string.h deleted file mode 100644 index ceedf4be1..000000000 --- a/newlib/libc/include/sys/string.h +++ /dev/null @@ -1,2 +0,0 @@ -/* This is a dummy <sys/string.h> used as a placeholder for - systems that need to have a special header file. */ diff --git a/newlib/libc/include/sys/time.h b/newlib/libc/include/sys/time.h index df3164941..20f2903c3 100644 --- a/newlib/libc/include/sys/time.h +++ b/newlib/libc/include/sys/time.h @@ -14,8 +14,8 @@ extern "C" { #ifndef _WINSOCK_H struct timeval { - time_t tv_sec; - suseconds_t tv_usec; + long tv_sec; + long tv_usec; }; struct timezone { @@ -24,7 +24,7 @@ struct timezone { }; #ifdef __CYGWIN__ -#include <cygwin/sys_time.h> +#include <sys/select.h> #endif /* __CYGWIN__ */ #endif /* _WINSOCK_H */ @@ -72,7 +72,7 @@ struct itimerval { 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)); +int _EXFUN(utimes, (const char *__path, struct timeval *__tvp)); int _EXFUN(getitimer, (int __which, struct itimerval *__value)); int _EXFUN(setitimer, (int __which, const struct itimerval *__value, struct itimerval *__ovalue)); diff --git a/newlib/libc/include/sys/types.h b/newlib/libc/include/sys/types.h index bf08616ab..238af1f50 100644 --- a/newlib/libc/include/sys/types.h +++ b/newlib/libc/include/sys/types.h @@ -21,38 +21,24 @@ #ifndef __INTTYPES_DEFINED__ #define __INTTYPES_DEFINED__ +typedef short int __int16_t; +typedef unsigned short int __uint16_t; -#include <machine/_types.h> - -#if defined(__rtems__) -/* - * The following section is RTEMS specific and is needed to more - * closely match the types defined in the BSD sys/types.h. - * This is needed to let the RTEMS/BSD TCP/IP stack compile. - */ - -/* deprecated */ -#if ___int8_t_defined -typedef __uint8_t u_int8_t; -#endif -#if ___int16_t_defined -typedef __uint16_t u_int16_t; -#endif -#if ___int32_t_defined -typedef __uint32_t u_int32_t; -#endif - -#if ___int64_t_defined -typedef __uint64_t u_int64_t; - -/* deprecated */ -typedef __uint64_t u_quad_t; -typedef __int64_t quad_t; -typedef quad_t * qaddr_t; +#if __INT_MAX__ == 32767 +typedef long int __int32_t; +typedef unsigned long int __uint32_t; +#else +typedef int __int32_t; +typedef unsigned int __uint32_t; #endif +#if __LONG_MAX__ > 2147483647 || !defined(__GNUC__) +typedef long int __int64_t; +typedef unsigned long int __uint64_t; +#else +__extension__ typedef long long __int64_t; +__extension__ typedef unsigned long long __uint64_t; #endif - #endif /* ! __INTTYPES_DEFINED */ #ifndef __need_inttypes @@ -251,6 +237,11 @@ typedef struct _types_fd_set { #undef __MS_types__ #undef _ST_INT32 +/* The following are actually standard POSIX 1003.1b-1993 threads, mutexes, + condition variables, and keys. But since RTEMS is currently the only + newlib user of these, the ifdef is just on RTEMS. */ + +#if defined(__rtems__) || defined(__CYGWIN__) #ifndef __clockid_t_defined typedef _CLOCKID_T_ clockid_t; @@ -262,8 +253,9 @@ typedef _TIMER_T_ timer_t; #define __timer_t_defined #endif -typedef unsigned long useconds_t; -typedef long suseconds_t; +#if defined(__CYGWIN__) || defined(__rtems__) +typedef long useconds_t; +#endif #include <sys/features.h> @@ -374,6 +366,8 @@ typedef struct { #endif #endif /* defined(_POSIX_THREADS) */ +#endif /* defined(__rtems__) */ + #endif /* !__need_inttypes */ #undef __need_inttypes diff --git a/newlib/libc/include/sys/unistd.h b/newlib/libc/include/sys/unistd.h index a670dd735..46db13c27 100644 --- a/newlib/libc/include/sys/unistd.h +++ b/newlib/libc/include/sys/unistd.h @@ -53,7 +53,9 @@ 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)); +#ifndef __CYGWIN__ int _EXFUN(fdatasync, (int __fd)); +#endif char _EXFUN(*getcwd, (char *__buf, size_t __size )); #if defined(__CYGWIN__) int _EXFUN(getdomainname ,(char *__name, size_t __len)); @@ -73,9 +75,6 @@ int _EXFUN(getlogin_r, (char *name, size_t namesize) ); #endif char _EXFUN(*getpass, (const char *__prompt)); size_t _EXFUN(getpagesize, (void)); -#if defined(__CYGWIN__) -int _EXFUN(getpeereid, (int, uid_t *, gid_t *)); -#endif pid_t _EXFUN(getpgid, (pid_t)); pid_t _EXFUN(getpgrp, (void )); pid_t _EXFUN(getpid, (void )); @@ -211,9 +210,9 @@ void _EXFUN(sync, (void)); #else /* defined(__rtems__) */ int _EXFUN(sync, (void)); #endif -#endif int _EXFUN(readlink, (const char *__path, char *__buf, int __buflen)); int _EXFUN(symlink, (const char *__name1, const char *__name2)); +#endif #define F_OK 0 #define R_OK 4 |