diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2003-02-05 21:23:49 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2003-02-05 21:23:49 +0000 |
commit | f4f341bb9c915ea45a5466e35d8db6006d5f1870 (patch) | |
tree | f0320d043f74db84b37f623bea3e9023c875449a | |
parent | 2003-02-05 Joel Sherrill <joel@OARcorp.com> (diff) | |
download | rtems-f4f341bb9c915ea45a5466e35d8db6006d5f1870.tar.bz2 |
2003-02-05 Till Straumann <strauman@slac.stanford.edu>
PR 340/filesystem
* src/fcntl.c: Add missing _fcntl_r assumed to exist by newlib.
-rw-r--r-- | cpukit/libcsupport/ChangeLog | 5 | ||||
-rw-r--r-- | cpukit/libcsupport/src/fcntl.c | 44 |
2 files changed, 44 insertions, 5 deletions
diff --git a/cpukit/libcsupport/ChangeLog b/cpukit/libcsupport/ChangeLog index fc2832a2b3..9e609b3e7b 100644 --- a/cpukit/libcsupport/ChangeLog +++ b/cpukit/libcsupport/ChangeLog @@ -1,3 +1,8 @@ +2003-02-05 Till Straumann <strauman@slac.stanford.edu> + + PR 340/filesystem + * src/fcntl.c: Add missing _fcntl_r assumed to exist by newlib. + 2003-02-05 Joel Sherrill <joel@OARcorp.com> * include/sys/ioccom.h: Fix so not using internal RTEMS types in libc diff --git a/cpukit/libcsupport/src/fcntl.c b/cpukit/libcsupport/src/fcntl.c index 6c2aa1da11..c9e64fcc93 100644 --- a/cpukit/libcsupport/src/fcntl.c +++ b/cpukit/libcsupport/src/fcntl.c @@ -23,13 +23,12 @@ #include <rtems.h> #include <rtems/libio_.h> -int fcntl( +static int vfcntl( int fd, int cmd, - ... + va_list ap ) { - va_list ap; rtems_libio_t *iop; rtems_libio_t *diop; int fd2; @@ -37,8 +36,6 @@ int fcntl( int mask; int ret = 0; - va_start( ap, cmd ); - rtems_libio_check_fd( fd ); iop = rtems_libio_iop( fd ); rtems_libio_check_is_open(iop); @@ -153,3 +150,40 @@ int fcntl( } return ret; } + +int fcntl( + int fd, + int cmd, + ... +) +{ + int ret; + va_list ap; + va_start( ap, cmd ); + ret = vfcntl(fd,cmd,ap); + va_end(ap); + return ret; +} + + +/* + * _fcntl_r + * + * This is the Newlib dependent reentrant version of fcntl(). + */ + +#if defined(RTEMS_NEWLIB) + +#include <reent.h> + +int _fcntl_r( + struct _reent *ptr, + int fd, + int cmd, + int arg +) +{ + return fcntl( fd, cmd, arg ); +} +#endif + |