diff options
-rw-r--r-- | newlib/ChangeLog | 6 | ||||
-rw-r--r-- | newlib/libc/include/sys/fcntl.h | 2 | ||||
-rw-r--r-- | newlib/libc/include/sys/stat.h | 3 | ||||
-rw-r--r-- | newlib/libc/include/sys/unistd.h | 2 |
4 files changed, 12 insertions, 1 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog index f9939c35a..257c1df89 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,9 @@ +2003-11-26 Corinna Vinschen <corinna@vinschen.de> + + * libc/include/fcntl.h: Declare syscalls only when building newlib. + * libc/include/unistd.h: Ditto. + * libc/include/stat.h: Ditto. Also declare struct stat64. + 2003-11-24 Artem B. Bityuckiy <mail_lists@mail.ru> * libc/stdio/vfprintf.c (_VFPRINTF_R): Fix check for 'C' format diff --git a/newlib/libc/include/sys/fcntl.h b/newlib/libc/include/sys/fcntl.h index f358a8fab..4cb12a368 100644 --- a/newlib/libc/include/sys/fcntl.h +++ b/newlib/libc/include/sys/fcntl.h @@ -169,11 +169,13 @@ extern int fcntl _PARAMS ((int, int, ...)); /* Provide _<systemcall> prototypes for functions provided by some versions of newlib. */ +#ifdef _COMPILING_NEWLIB extern int _open _PARAMS ((const char *, int, ...)); extern int _fcntl _PARAMS ((int, int, ...)); #ifdef __LARGE64_FILES extern int _open64 _PARAMS ((const char *, int, ...)); #endif +#endif #ifdef __cplusplus } diff --git a/newlib/libc/include/sys/stat.h b/newlib/libc/include/sys/stat.h index e22f59a5d..4749506c6 100644 --- a/newlib/libc/include/sys/stat.h +++ b/newlib/libc/include/sys/stat.h @@ -137,10 +137,11 @@ int _EXFUN(mknod,( const char *__path, mode_t __mode, dev_t __dev )); /* Provide prototypes for most of the _<systemcall> names that are provided in newlib for some compilers. */ -#ifndef __INSIDE_CYGWIN__ +#ifdef _COMPILING_NEWLIB int _EXFUN(_fstat,( int __fd, struct stat *__sbuf )); int _EXFUN(_stat,( const char *__path, struct stat *__sbuf )); #ifdef __LARGE64_FILES +struct stat64; int _EXFUN(_fstat64,( int __fd, struct stat64 *__sbuf )); #endif #endif diff --git a/newlib/libc/include/sys/unistd.h b/newlib/libc/include/sys/unistd.h index ee6bec0b3..e86895928 100644 --- a/newlib/libc/include/sys/unistd.h +++ b/newlib/libc/include/sys/unistd.h @@ -165,6 +165,7 @@ extern char *suboptarg; /* getsubopt(3) external variable */ int getsubopt(char **, char * const *, char **); #endif /* _POSIX_SOURCE */ +#ifdef _COMPILING_NEWLIB /* Provide prototypes for most of the _<systemcall> names that are provided in newlib for some compilers. */ int _EXFUN(_close, (int __fildes )); @@ -180,6 +181,7 @@ void * _EXFUN(_sbrk, (ptrdiff_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[] )); +#endif #if defined(__CYGWIN__) || defined(__rtems__) || defined(__sh__) #if !defined(__INSIDE_CYGWIN__) |