This page helps rank how FreeBSD currently functions with certain opensource/UNIX standards, such as ISO C, POSIX, XSI, etc.

IEEE 1003.1-2001

sys/time.h // time.h

CLOCK_UPTIME .. CLOCK_SECOND

FreeBSD specific clocks/timers aren't properly hidden under __BSD_VISIBLE.

_POSIX_CPUTIME, et all

Not implemented, despite the fact that _POSIX_THREAD_CPUTIME is implemented. Gross oversight?

Incorrect includes

Some headers are including time.h and others are including sys/time.h by accident which has resulted in improper breakage in the sourcebase, based on the requirements in the stated in the FreeBSD and OpenGroup manpages.

errno.h

ENODATA

not implemented (XSI)

ENOSR

not implemented (XSI)

ENOSTR

not implemented (XSI)

ETIME

not implemented (XSI)

sched.h

SCHED_SPORADIC

not implemented

struct sched_param

not implemented

stdlib.h

realpath

non-conformant pieces ; see [3]

unistd.h

_SC_TIMERS / _SC_TIMER_MAX

value doesn't take into account offset of 3 used in sys/kern/kern_time.c used for `[timers] reserved for setitimer()'.

POSIX 2008.1

sys/kern/kern_time.c

clockid_t

Many of the timer values are implemented as int, instead of clockid_t; being pedantic they should be defined as clockid_t (int32_t).

clock_getcpuclockid

not implemented

clock_nanosleep

not implemented; requires some kernel interfaces currently missing [2].

clock_settime

kern_clock_settime does not return EINVAL for CLOCK_MONOTONIC.

itimerfix // itimespecfix

Is overloaded and unfortunately broken as it doesn't handle negative usec / nsec times.

timer_create

always returns EINVAL for CLOCK_THREAD_CPUTIME_ID due to definitions of MAX_CLOCKS; thus creating a timer for CLOCK_THREAD_CPUTIME_ID is completely impossible.

limits.h

PTHREAD_KEYS_MAX

Should be defined in limits.h, not pthread.h

PTHREAD_STACK_MIN

Should be defined in limits.h, not pthread.h

mqueue.h

mqd_t

Defined as a structure in FreeBSD. Is an integer in Linux. This means that code which assumes that mq_* APIs will return EBADF when provided a bad file descriptor (say -1) instead of segfaulting will get a nasty surprise. POSIX doesn't state what the underlying type has to be.

XSI

signal.h

SIGPOLL

not implemented

struct sig_param

not implemented

time.h

daylight

broken (both in FreeBSD and in POSIX); won't fix

getdate(3)

not implemented

timezone

broken (both in FreeBSD and in POSIX); won't fix

tzname

broken (both in FreeBSD and in POSIX); won't fix

Under debate

The state of the following items is under debate:

signal.h

SIGPOLL

XSI -- unsupported by choice for functional and security reasons

References

  1. http://lists.freebsd.org/pipermail/freebsd-standards/2010-April/001936.html

  2. http://lists.freebsd.org/pipermail/freebsd-standards/2010-April/001948.html

  3. http://www.freebsd.org/cgi/query-pr-summary.cgi?category=kern&sort=none&text=realpath

Related Pages

  1. http://www.freebsd.org/projects/c99/index.html

  2. SUSv6 : http://www.opengroup.org/onlinepubs/000095399

  3. SUSv7 : http://www.opengroup.org/onlinepubs/9699919799

FreeBSD_and_Standards (last edited 2011-02-06 08:41:41 by GarrettCooper)