tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Why is SIOCINITIFADDR in sys/sockio.h ??



I think I understand the purpose of this ioctl. and if I
do understand it correctly, SIOCINITIFADDR is an in-kernel only
ioctl (that's reinforced by seeing it all over the -current
interface drivers, and nowhere outside the kernel), plus the EPERM.

Given that, wouldn't a comment in sockio.h indicating that the
number is taken, with the actual #define of the ioctl command
value in some kernel only header file be a more sensible choice?

I noticed this as I wanted to add some data to struct ifaddr, and
was checking to make sure (which I presumed, but wanted to verify)
that this struct is a 100% in kernel data structure, not visible
externally (so no API/ABI would be broken by changing the struct,
just kernel modules that I don't care about...)

Then I saw SIOCINITIFADDR in sys/sockio.h and paniced!

Then I saw its usage, and calmed a little, but that definition seems
wrong to me - even if it is the correct file, couldn't it be #ifdef KERNEL,
or at the very least, have some kind of comment?

kre



Home | Main Index | Thread Index | Old Index