aboutsummaryrefslogtreecommitdiff
path: root/lang/modula-3-socks/files/recvfrom.c
diff options
context:
space:
mode:
Diffstat (limited to 'lang/modula-3-socks/files/recvfrom.c')
-rw-r--r--lang/modula-3-socks/files/recvfrom.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/lang/modula-3-socks/files/recvfrom.c b/lang/modula-3-socks/files/recvfrom.c
new file mode 100644
index 000000000000..d4a346b3d86d
--- /dev/null
+++ b/lang/modula-3-socks/files/recvfrom.c
@@ -0,0 +1,18 @@
+#include "wrap.h"
+#include <sys/types.h>
+#include <sys/socket.h>
+
+ssize_t
+m3_recvfrom(int s, void *buf, size_t len, int flags,
+ struct sockaddr *from, int *fromlen)
+{
+ int result;
+
+ ENTER_CRITICAL;
+ MAKE_WRITABLE(buf);
+ MAKE_WRITABLE(from);
+ MAKE_WRITABLE(fromlen);
+ result = recvfrom(s, buf, len, flags, from, fromlen);
+ EXIT_CRITICAL;
+ return result;
+}