verify unistd header includes

This commit is contained in:
auronandace
2026-06-04 12:09:59 +01:00
parent fafc4c2c00
commit 2719e007e2
+16
View File
@@ -1,4 +1,20 @@
# POSIX header spec: https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/unistd.h.html
#
# Spec quotations relating to includes:
# - "The <unistd.h> header shall define NULL as described in <stddef.h>."
# - "The <unistd.h> header shall define the symbolic constants O_CLOEXEC and O_CLOFORK as described in <fcntl.h>."
# - "The <unistd.h> header shall define SEEK_CUR, SEEK_END, and SEEK_SET as described in <stdio.h>."
# - "The <unistd.h> header shall define the size_t, ssize_t, uid_t, gid_t, off_t, and pid_t types as described in <sys/types.h>."
# - "The <unistd.h> header shall define the intptr_t type as described in <stdint.h>."
# - "Inclusion of the <unistd.h> header may make visible all symbols from the headers <fcntl.h>, <stddef.h>, <stdint.h>, and <stdio.h>."
#
# Note that unistd.h may include fcntl.h and fcntl.h may include unistd.h thus creating a cycle.
# Relibc decides that unistd.h will include fcntl.h and fcntl.h will not include unistd.h.
#
# TODO fctnl.h shouldn't include all of stdio.h (split out some bits)
#
# stddef.h brings in size_t and NULL
# fcntl.h brings in stdio.h bringing in SEEK_CUR, SEEK_END and SEEK_SET
# fcntl.h brings in sys/stat.h bringing in off_t, gid_t and uid_t
# fcntl.h brings in pid_t
# bits/useconds-t.h brings in features.h (for deprecated annotations)