Project

General

Profile

Actions

Bug #1334

closed

<net/bpf.h> should include <sys/ioccom.h>

Added by guy over 12 years ago. Updated over 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

Description

<net/bpf.h> defines ioctl codes, so it should include <sys/ioccom.h>,
so it doesn't require code that includes <net/bpf.h> to also include
<sys/ioccom.h> or a header that includes it. When I originally
created <sys/ioccom.h> in SunOS 4.0, I intended it to be included by
header files that defined ioctls, rather than by .c files.

Actions #1

Updated by swildner over 12 years ago

grab

Actions #2

Updated by swildner over 12 years ago

Guy, thanks for clarifying,

please see http://leaf.dragonflybsd.org/~swildner/ioccom.diff, which
adjusts our code to this intention (include <sys/ioccom.h> only in
headers where ioctl codes are defined).

If no one objects, I'll commit it tomorrow or Thursday.

Sascha

Actions #3

Updated by guy over 12 years ago

On Apr 14, 2009, at 12:05 PM, Sascha Wildner (via DragonFly issue
tracker) wrote:

One other thing that came to mind, though - there's no (non-obsolete)
UN*X standard for what to include to get ioctl() declared. The Single
UNIX Specification only mentions ioctl() in order to support some
STREAMS stuff, so they declared it in some STREAMS header file - not
very useful for non-STREAMS devices - and that's now obsolete in the
current SUS. I think all the BSDs say that you include <sys/ioctl.h>
to declare it (Mac OS X does).

I might be tempted to move the declaration of ioctl() to sys/ioccom.h
as well; you could then still include <sys/ioctl.h> to get it
declared, but you also get it declared if you include some header that
includes <sys/ioccom.h> and declares ioctls.

Actions #4

Updated by swildner over 12 years ago

Guy Harris schrieb:

I might be tempted to move the declaration of ioctl() to sys/ioccom.h
as well; you could then still include <sys/ioctl.h> to get it
declared, but you also get it declared if you include some header that
includes <sys/ioccom.h> and declares ioctls.

Hmm, I just checked..

DragonFly and FreeBSD do have the ioctl() declaration in <sys/ioccom.h>
while Net and Open don't.

Sascha

Actions

Also available in: Atom PDF