aboutsummaryrefslogtreecommitdiff
path: root/lang/modula-3-socks/files/getpeername.c
diff options
context:
space:
mode:
Diffstat (limited to 'lang/modula-3-socks/files/getpeername.c')
-rw-r--r--lang/modula-3-socks/files/getpeername.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/lang/modula-3-socks/files/getpeername.c b/lang/modula-3-socks/files/getpeername.c
new file mode 100644
index 000000000000..4da8eaa201b2
--- /dev/null
+++ b/lang/modula-3-socks/files/getpeername.c
@@ -0,0 +1,16 @@
+#include "wrap.h"
+#include <sys/types.h>
+#include <sys/socket.h>
+
+int
+m3_getpeername(int s, struct sockaddr *name, int *namelen)
+{
+ int result;
+
+ ENTER_CRITICAL;
+ MAKE_WRITABLE(name);
+ MAKE_WRITABLE(namelen);
+ result = getpeername(s, name, namelen);
+ EXIT_CRITICAL;
+ return result;
+}