<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Tue, Aug 14, 2018 at 12:09 AM Nir Soffer <<a href="mailto:nsoffer@redhat.com">nsoffer@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Mon, Aug 13, 2018 at 9:00 PM Eric Blake <<a href="mailto:eblake@redhat.com" target="_blank">eblake@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 08/03/2018 02:28 PM, Nir Soffer wrote:<br></blockquote></div></div></blockquote><div>... </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">> +++ b/plugins/file/file.c<br>
> @@ -41,14 +41,21 @@<br>
>   #include <unistd.h><br>
>   #include <sys/types.h><br>
>   #include <sys/stat.h><br>
> +#include <sys/ioctl.h><br>
<br>
Linux-specific header; will it cause grief on BSD compilation?<br></blockquote><div><br></div></div></div><div dir="ltr"><div class="gmail_quote"><div>I did not know that, will wrap it with #ifdef __linux__</div></div></div></blockquote><div><br></div><div>I tested this on FreeBSD 11.0 and 10.3:</div><div><br></div><div># cat test.c<br></div><div><div>#include <sys/ioctl.h>                                                                                                                                                                        </div><div><br></div></div><div><div>$ cc -E test.c</div><div># 1 "test.c"</div><div># 1 "<built-in>" 1</div><div># 1 "<built-in>" 3</div><div># 316 "<built-in>" 3</div><div># 1 "<command line>" 1</div><div># 1 "<built-in>" 2</div><div># 1 "test.c" 2</div><div># 1 "/usr/include/sys/ioctl.h" 1 3 4</div><div># 45 "/usr/include/sys/ioctl.h" 3 4</div><div># 1 "/usr/include/sys/ioccom.h" 1 3 4</div><div># 72 "/usr/include/sys/ioccom.h" 3 4</div><div># 1 "/usr/include/sys/cdefs.h" 1 3 4</div><div># 73 "/usr/include/sys/ioccom.h" 2 3 4</div><div><br></div><div><br></div><div>int ioctl(int, unsigned long, ...);</div><div># 46 "/usr/include/sys/ioctl.h" 2 3 4</div><div>...</div><div><br></div><div>So ioctl() does come from <sys/ioctl.h> on FreeBSD.</div></div><div><br></div><div>Here is netbsd version:</div><div><a href="https://ftp.netbsd.org/pub/NetBSD/NetBSD-current/src/sys/sys/ioctl.h">https://ftp.netbsd.org/pub/NetBSD/NetBSD-current/src/sys/sys/ioctl.h</a><br></div><div><br></div><div>OpenBSD:</div><div><a href="https://github.com/openbsd/src/blob/master/sys/sys/ioctl.h">https://github.com/openbsd/src/blob/master/sys/sys/ioctl.h</a><br></div><div><br></div><div>Looks like it is safe if our goal to be compatible at least with the BSDs.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
(POSIX declares ioctl() in <stropts.h>, but for the obsolete STREAMS <br>
extension that no one but Solaris ever implemented, and which no one <br>
uses today - and thus which has little bearing on the Linux use of ioctl).<br>
</blockquote></div></div></blockquote></div></div>