From d2df4c9d690ff9b8ca8af6ee2bc842f6e14793ac Mon Sep 17 00:00:00 2001 From: auronandace Date: Mon, 1 Jun 2026 07:42:51 +0100 Subject: [PATCH] verify sys_socket header includes --- src/header/bits_socklen-t/cbindgen.toml | 5 ++++- src/header/sys_socket/cbindgen.toml | 9 ++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/header/bits_socklen-t/cbindgen.toml b/src/header/bits_socklen-t/cbindgen.toml index 68b2c853ea..8665cbddd3 100644 --- a/src/header/bits_socklen-t/cbindgen.toml +++ b/src/header/bits_socklen-t/cbindgen.toml @@ -6,7 +6,10 @@ # - arpa/inet.h # - netdb.h # - sys/socket.h (where it should be defined) -sys_includes = [] +# +# TODO split out uint32_t to prevent including all of stdint.h +# stdint needed for uint32_t for socklen_t +sys_includes = ["stdint.h"] include_guard = "_RELIBC_BITS_SOCKLEN_T_H" language = "C" style = "type" diff --git a/src/header/sys_socket/cbindgen.toml b/src/header/sys_socket/cbindgen.toml index 481e75fb95..1237d47818 100644 --- a/src/header/sys_socket/cbindgen.toml +++ b/src/header/sys_socket/cbindgen.toml @@ -1,5 +1,12 @@ +# POSIX header spec: https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/sys_socket.h.html +# +# Spec quotations relating to includes: +# - "The header shall define the iovec structure as described in ." +# - "The header shall define the size_t and ssize_t types as described in ." +# - "Inclusion of may also make visible all symbols from ." +# # bits/iovec.h brings in size_t -sys_includes = ["stddef.h", "stdint.h"] +# bits/socklen_t brings in stdint.h for uint32_t for socklen_t include_guard = "_RELIBC_SYS_SOCKET_H" after_includes = """ #include // for iovec from sys/uio.h