From 50558bf3bdb5e2fc2454f38316af1f06f82f9a5d Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Thu, 19 Sep 2002 21:28:52 +0000 Subject: 2002-09-19 Jeff Johnston * libc/posix/opendir.c (opendir): Change code to check for HAVE_FCNTL before calling fcntl. * libc/search/hash.c (hash_open): Ditto. * libc/search/hash_page.c (open_tmp): Ditto. * libc/reent/Makefile.am: Add fcntlr.c. * libc/reent/Makefile.in: Regenerated. * libc/reent/fcntlr.c: New file. * libc/stdio/fdopen.c (_fdopen_r): Change to call _fcntl_r instead of _fcntl when HAVE_FCNTL flag is set. * libc/syscalls/sysfcntl.c (fcntl): Check for HAVE_FCNTL flag to see if _fcntl or _fcntl_r should be called. If flag is not set, default to ENOSYS stub. --- newlib/libc/syscalls/sysfcntl.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'newlib/libc/syscalls/sysfcntl.c') diff --git a/newlib/libc/syscalls/sysfcntl.c b/newlib/libc/syscalls/sysfcntl.c index 23e1d837a..4d1c57cc1 100644 --- a/newlib/libc/syscalls/sysfcntl.c +++ b/newlib/libc/syscalls/sysfcntl.c @@ -2,6 +2,7 @@ /* only called from stdio/fdopen.c, so arg can be int. */ #include +#include int fcntl (fd, flag, arg) @@ -9,9 +10,14 @@ fcntl (fd, flag, arg) int flag; int arg; { -#ifdef REENTRANT_SYSCALLS_PROVIDED +#ifdef HAVE_FCNTL +# ifdef REENTRANT_SYSCALLS_PROVIDED return _fcntl_r (_REENT, fd, flag, arg); -#else +# else return _fcntl (fd, flag, arg); -#endif +# endif +#else /* !HAVE_FCNTL */ + errno = ENOSYS; + return -1; +#endif /& !HAVE_FCNTL */ } -- cgit v1.2.3