summaryrefslogtreecommitdiff
path: root/lang/modula-3-socks/files/read.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--lang/modula-3-socks/files/read.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/lang/modula-3-socks/files/read.c b/lang/modula-3-socks/files/read.c
new file mode 100644
index 000000000000..2172d2b73661
--- /dev/null
+++ b/lang/modula-3-socks/files/read.c
@@ -0,0 +1,15 @@
+#include "wrap.h"
+#include <sys/types.h>
+#include <unistd.h>
+
+ssize_t
+m3_read(int d, void *buf, size_t nbytes)
+{
+ int result;
+
+ ENTER_CRITICAL;
+ MAKE_WRITABLE(buf);
+ result = read(d, buf, nbytes);
+ EXIT_CRITICAL;
+ return result;
+}