summaryrefslogtreecommitdiffstats
path: root/cpukit/libnetworking/rtems/rtems_syscall.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/libnetworking/rtems/rtems_syscall.c')
-rw-r--r--cpukit/libnetworking/rtems/rtems_syscall.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/cpukit/libnetworking/rtems/rtems_syscall.c b/cpukit/libnetworking/rtems/rtems_syscall.c
index 7e6210c091..429e47b511 100644
--- a/cpukit/libnetworking/rtems/rtems_syscall.c
+++ b/cpukit/libnetworking/rtems/rtems_syscall.c
@@ -6,6 +6,7 @@
#include <stdarg.h>
/* #include <stdlib.h> */
#include <stdio.h>
+#include <errno.h>
#include <rtems.h>
#include <rtems/libio.h>
@@ -633,6 +634,28 @@ getsockname (int s, struct sockaddr *name, int *namelen)
return getpeersockname (s, name, namelen, 0);
}
+int
+sysctl(int *name, u_int namelen, void *oldp,
+ size_t *oldlenp, void *newp, size_t newlen)
+{
+ int error;
+ size_t j;
+
+ rtems_bsdnet_semaphore_obtain ();
+ error = userland_sysctl (0, name, namelen, oldp, oldlenp, 1, newp, newlen, &j);
+ rtems_bsdnet_semaphore_release ();
+
+ if (oldlenp)
+ *oldlenp = j;
+
+ if (error)
+ {
+ errno = error;
+ return -1;
+ }
+ return 0;
+}
+
/*
************************************************************************
* RTEMS I/O HANDLER ROUTINES *