[PATCH 02/12] Restore declaration of ioctl

Ken Brown <[email protected]>
Newsgroups gmane.lisp.clisp.devel
Message-ID <[email protected]>
# HG changeset patch
# User Ken Brown <[email protected]>
# Date 1425524080 18000
#      Wed Mar 04 21:54:40 2015 -0500
# Node ID 34be157e71d92a16c20bb601828cee54156ad2a5
# Parent  9a43f7dac04375804add3f16955308f0a44cc9b8
Restore declaration of ioctl

* src/unix.d [HAVE_IOCTL]: Restore declaration of ioctl, which was
removed as part of revision 15470, leading to an
implicit-function-declaration warning in src/unixaux.d.

diff -r 9a43f7dac043 -r 34be157e71d9 src/unix.d
--- a/src/unix.d        Wed Mar 04 18:11:34 2015 -0500
+++ b/src/unix.d        Wed Mar 04 21:54:40 2015 -0500
@@ -433,6 +433,18 @@
 #elif defined(NEED_SYS_IOCTL_H)
   #include <sys/ioctl.h>
 #endif
+
+#ifdef HAVE_IOCTL
+  #ifdef IOCTL_DOTS
+    extern_C int ioctl (int fd, IOCTL_REQUEST_T request, ...); /* IOCTL(2) */
+    #define IOCTL_ARGUMENT_T  CADDR_T
+  #else
+    extern_C int ioctl (int fd, IOCTL_REQUEST_T request, IOCTL_ARGUMENT_T arg); /* IOCTL(2) */
+    /* 3rd argument is always cast to type IOCTL_ARGUMENT_T (usually CADDR_T): */
+    #define ioctl(fd,request,arg)  (ioctl)(fd,request,(IOCTL_ARGUMENT_T)(arg))
+  #endif
+#endif
+
 /* START_NO_BLOCK() & END_NO_BLOCK() should appear in pairs
    inside { NO_BLOCK_DECL(); ... };
  NO_BLOCK_DECL() should be before the first statement,


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
clisp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/clisp-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.