diff mbox series

[meta-oe,04/26] smolkit: include <sys/types.h> for uid_t/pid_t on musl

Message ID 20260929225723.1046705-4-khem.raj@oss.qualcomm.com
State New
Headers show
Series [meta-oe,01/26] canvenient: include <sys/time.h> for struct timeval on musl | expand

Commit Message

Khem Raj Sept. 29, 2026, 10:57 p.m. UTC
SystemUserLookup.h uses uid_t/pid_t without including <sys/types.h>;
glibc's <string> transitively declares them, musl's doesn't.

AI-Generated: Uses Claude Code

Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
---
 ...p.h-include-sys-types.h-for-uid_t-pi.patch | 30 +++++++++++++++++++
 meta-oe/recipes-extended/smolkit/smolkit.bb   |  1 +
 2 files changed, 31 insertions(+)
 create mode 100644 meta-oe/recipes-extended/smolkit/files/0001-SystemUserLookup.h-include-sys-types.h-for-uid_t-pi.patch
diff mbox series

Patch

diff --git a/meta-oe/recipes-extended/smolkit/files/0001-SystemUserLookup.h-include-sys-types.h-for-uid_t-pi.patch b/meta-oe/recipes-extended/smolkit/files/0001-SystemUserLookup.h-include-sys-types.h-for-uid_t-pi.patch
new file mode 100644
index 0000000000..d2adf9177b
--- /dev/null
+++ b/meta-oe/recipes-extended/smolkit/files/0001-SystemUserLookup.h-include-sys-types.h-for-uid_t-pi.patch
@@ -0,0 +1,30 @@ 
+From: Khem Raj <khem.raj@oss.qualcomm.com>
+Date: Tue, 29 Sep 2026 01:54:51 +0000
+Subject: [PATCH] SystemUserLookup.h: include sys/types.h for uid_t/pid_t
+
+SystemUserLookup.h uses uid_t and pid_t but never includes
+<sys/types.h> itself. On glibc, <string> (or other headers pulled in
+transitively by the C++ runtime) end up exposing these POSIX types,
+but that is not guaranteed. musl's libc++ headers do not provide
+this transitive declaration, so the header fails to parse with
+"unknown type name 'uid_t'"/"'pid_t'". Include <sys/types.h>
+directly so the header is self-contained regardless of libc.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
+---
+ src/SystemUserLookup.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/SystemUserLookup.h b/src/SystemUserLookup.h
+index 1111111..2222222 100644
+--- a/src/SystemUserLookup.h
++++ b/src/SystemUserLookup.h
+@@ -1,5 +1,7 @@
+ #pragma once
+
++#include <sys/types.h>
++
+ #include <string>
+
+ struct group;
diff --git a/meta-oe/recipes-extended/smolkit/smolkit.bb b/meta-oe/recipes-extended/smolkit/smolkit.bb
index 4ac9ee69f7..6ba338ef05 100644
--- a/meta-oe/recipes-extended/smolkit/smolkit.bb
+++ b/meta-oe/recipes-extended/smolkit/smolkit.bb
@@ -22,5 +22,6 @@  PV = "${VERSION}+git"
 
 SRC_URI = "\
     git://github.com/bmwcarit/${BPN}.git;protocol=https;branch=main;tag=v${VERSION} \
+    file://0001-SystemUserLookup.h-include-sys-types.h-for-uid_t-pi.patch \
 "
 SRCREV = "46bbfd5c922a8d03a534398ee129ded822dfcafe"