summaryrefslogtreecommitdiffstats
path: root/cpukit/libcsupport/src/fcntl.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/libcsupport/src/fcntl.c')
-rw-r--r--cpukit/libcsupport/src/fcntl.c44
1 files changed, 39 insertions, 5 deletions
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
+