From 0a707c79e9fb7f5f4d4c3ec0d21a559ba848f12a Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Wed, 26 Nov 2003 19:15:17 +0000 Subject: [PATCH] 2003-11-26 Corinna Vinschen * libc/include/fcntl.h: Declare syscalls only when building newlib. * libc/include/unistd.h: Ditto. * libc/include/stat.h: Ditto. Also declare struct stat64. --- newlib/ChangeLog | 6 ++++++ newlib/libc/include/sys/fcntl.h | 2 ++ newlib/libc/include/sys/stat.h | 3 ++- newlib/libc/include/sys/unistd.h | 2 ++ 4 files changed, 12 insertions(+), 1 deletion(-) 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 + + * 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 * 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 _ 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 _ 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 _ 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__)