From cd84da629c6d1a9f4d9b586366e883a74ebc25c6 Mon Sep 17 00:00:00 2001 From: auronandace Date: Mon, 18 May 2026 09:51:23 +0100 Subject: [PATCH] verify fcntl header includes --- src/header/fcntl/cbindgen.toml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/header/fcntl/cbindgen.toml b/src/header/fcntl/cbindgen.toml index ae5142ec51..8aad3bf8e7 100644 --- a/src/header/fcntl/cbindgen.toml +++ b/src/header/fcntl/cbindgen.toml @@ -1,5 +1,21 @@ -sys_includes = ["stdarg.h", "sys/stat.h", "unistd.h"] +# POSIX header spec: https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/fcntl.h.html +# +# Spec quotations relating to includes: +# - "The header shall define the mode_t, off_t, and pid_t types as described in ." +# - "The header shall define the values used for l_whence, SEEK_SET, SEEK_CUR, and SEEK_END as described in ." +# - "The header shall define the symbolic constants for file modes for use as values of mode_t as described in ." +# - "Inclusion of the header may also make visible all symbols from and ." +# +# To prevent a cycle between fcntl.h and unistd.h relibc only includes fcntl.h in unistd.h. +# This approach was chosen because unistd.h requires parts of fcntl.h but not the other way around. +# +# stdarg.h brings in va_list for ... +# sys/stat.h brings in mode_t, off_t and file mode constants +sys_includes = ["stdarg.h", "sys/stat.h"] include_guard = "_RELIBC_FCNTL_H" +after_includes = """ +#include // for pid_t from sys/types.h +""" language = "C" style = "Tag" no_includes = true