summaryrefslogtreecommitdiff
path: root/do/msgsnd
diff options
context:
space:
mode:
Diffstat (limited to 'do/msgsnd')
-rw-r--r--do/msgsnd26
1 files changed, 26 insertions, 0 deletions
diff --git a/do/msgsnd b/do/msgsnd
new file mode 100644
index 0000000000..700a662a23
--- /dev/null
+++ b/do/msgsnd
@@ -0,0 +1,26 @@
+int
+do_msgsnd(arglast)
+int *arglast;
+{
+#ifdef HAS_MSG
+ register STR **st = stack->ary_array;
+ register int sp = arglast[0];
+ STR *mstr;
+ char *mbuf;
+ int id, msize, flags;
+
+ id = (int)str_gnum(st[++sp]);
+ mstr = st[++sp];
+ flags = (int)str_gnum(st[++sp]);
+ mbuf = str_get(mstr);
+ if ((msize = mstr->str_cur - sizeof(long)) < 0) {
+ errno = EINVAL;
+ return -1;
+ }
+ errno = 0;
+ return msgsnd(id, (struct msgbuf *)mbuf, msize, flags);
+#else
+ fatal("msgsnd not implemented");
+#endif
+}
+