summaryrefslogtreecommitdiffstats
path: root/otherlibs/unix/ioctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'otherlibs/unix/ioctl.c')
-rw-r--r--otherlibs/unix/ioctl.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/otherlibs/unix/ioctl.c b/otherlibs/unix/ioctl.c
new file mode 100644
index 000000000..e4d2e5e6d
--- /dev/null
+++ b/otherlibs/unix/ioctl.c
@@ -0,0 +1,20 @@
+#include <mlvalues.h>
+#include "unix.h"
+
+value unix_ioctl_int(fd, request, arg)
+ value fd, request, arg;
+{
+ int retcode;
+ retcode = ioctl(Int_val(fd), Int_val(request), (char *) Int_val(arg));
+ if (retcode == -1) uerror("ioctl_int", Nothing);
+ return Val_int(retcode);
+}
+
+value unix_ioctl_ptr(fd, request, arg)
+ value fd, request, arg;
+{
+ int retcode;
+ retcode = ioctl(Int_val(fd), Int_val(request), String_val(arg));
+ if (retcode == -1) uerror("ioctl_ptr", Nothing);
+ return Val_int(retcode);
+}