Non-POSIX compliant portions of FreeBSD
yanefbsd at gmail.com
Fri Apr 23 01:23:44 UTC 2010
On Sun, Apr 18, 2010 at 8:16 PM, Garrett Cooper <yanefbsd at gmail.com> wrote:
> On Sun, Apr 18, 2010 at 5:48 AM, Eitan Adler <eitanadlerlist at gmail.com> wrote:
>>> I'll keep on providing a full list of items where we aren't POSIX
>>> compliant, but it'd be interesting to get a response about whether or
>>> not the items I submit are known or not, and whether or not they were
>>> conscious design decisions and/or items which need to be fixed.
>> Can you make this into a wiki page along with the comments you receive?
> Sure. Here's the page for starters:
Continuing on the fun... ioctl (by manpage alone) isn't even close
to being POSIX standard. Here are the differences I spotted at least
[in the ERRORS section]:
The ioctl() system call will fail if:
[EBADF] The d argument is not a valid descriptor.
[ENOTTY] The d argument is not associated with a character spe-
[ENOTTY] The specified request does not apply to the kind of
object that the descriptor d references.
[EINVAL] The request or argp argument is not valid.
[EFAULT] The argp argument points outside the process's allo-
cated address space.
The fildes argument is not a valid open file descriptor.
A signal was caught during the ioctl() operation.
The STREAM or multiplexer referenced by fildes is linked (directly
or indirectly) downstream from a multiplexer.
If an underlying device driver detects an error, then ioctl() shall fail if:
The request or arg argument is not valid for this device.
Some physical I/O error has occurred.
The fildes argument is not associated with a STREAMS device that
accepts control functions.
The request and arg arguments are valid for this device driver,
but the service requested cannot be performed on this particular
The fildes argument refers to a valid STREAMS device, but the
corresponding device driver does not support the ioctl() function.
If a STREAM is connected downstream from a multiplexer, any ioctl()
command except I_UNLINK and I_PUNLINK shall set errno to [EINVAL].
1. EINTR and EIO aren't implemented in FreeBSD.
2. The tort in EBADF for the POSIX definition suggests that the
file descriptor state is important -- it looks like the wording is
potentially a bit too well defined in the POSIX version as I could
open a file descriptor, close it, then attempt to run an ioctl(2) on
the device file descriptor, which should fail in the same way as the
FreeBSD wording suggests.
3. It looks like ENODEV, ENOTTY, and ENXIO in the POSIX case are
bundled together in some of the possible states for the ENOTTY error
case on FreeBSD.
At least it functions unlike the Linux copy in some cases though :].
More information about the freebsd-standards