From f4f341bb9c915ea45a5466e35d8db6006d5f1870 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 5 Feb 2003 21:23:49 +0000 Subject: 2003-02-05 Till Straumann PR 340/filesystem * src/fcntl.c: Add missing _fcntl_r assumed to exist by newlib. --- cpukit/libcsupport/ChangeLog | 5 +++++ 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 + + PR 340/filesystem + * src/fcntl.c: Add missing _fcntl_r assumed to exist by newlib. + 2003-02-05 Joel Sherrill * 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 #include -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 + +int _fcntl_r( + struct _reent *ptr, + int fd, + int cmd, + int arg +) +{ + return fcntl( fd, cmd, arg ); +} +#endif + -- cgit v1.2.3