Linux Kernel Mentees list
 help / color / mirror / Atom feed
* [PATCH] tools/include/linux/types.h: add ulong typedef for musl compatibility
@ 2026-05-31 14:49 Hisam Mehboob
  2026-06-18 20:03 ` Hisam Mehboob
  0 siblings, 1 reply; 2+ messages in thread
From: Hisam Mehboob @ 2026-05-31 14:49 UTC (permalink / raw)
  To: pbonzini
  Cc: seanjc, shuah, me, kvm, linux-kselftest, linux-kernel,
	linux-kernel-mentees, Hisam Mehboob

Building KVM selftests with musl libc fails across multiple files
(e.g. memslot_perf_test.c, cpuid_test.c) with 'ulong' undeclared.

Under glibc, <semaphore.h> includes <sys/types.h>, which exposes ulong.
Under musl, <semaphore.h> includes only <features.h>, <bits/alltypes.h>
and <fcntl.h>, and does not include <sys/types.h>. As a result, ulong is
not visible through the current selftests include chain.

include/linux/types.h already defines both ulong and ullong in its sysv
aliases block. tools/include/linux/types.h mirrors ullong but omits
ulong. Add ulong alongside ullong to close the gap.

Signed-off-by: Hisam Mehboob <hisamshar@gmail.com>
---
 tools/include/linux/types.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/include/linux/types.h b/tools/include/linux/types.h
index d41f8a261bce..ccc90dd4baeb 100644
--- a/tools/include/linux/types.h
+++ b/tools/include/linux/types.h
@@ -42,6 +42,7 @@ typedef __s16 s16;
 typedef __u8  u8;
 typedef __s8  s8;
 
+typedef unsigned long		ulong;
 typedef unsigned long long	ullong;
 
 #ifdef __CHECKER__
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] tools/include/linux/types.h: add ulong typedef for musl compatibility
  2026-05-31 14:49 [PATCH] tools/include/linux/types.h: add ulong typedef for musl compatibility Hisam Mehboob
@ 2026-06-18 20:03 ` Hisam Mehboob
  0 siblings, 0 replies; 2+ messages in thread
From: Hisam Mehboob @ 2026-06-18 20:03 UTC (permalink / raw)
  To: pbonzini
  Cc: seanjc, shuah, me, kvm, linux-kselftest, linux-kernel,
	linux-kernel-mentees

On 5/31/26 19:49, Hisam Mehboob wrote:
> Building KVM selftests with musl libc fails across multiple files
> (e.g. memslot_perf_test.c, cpuid_test.c) with 'ulong' undeclared.

Gentle ping. Could I get some feedback on this patch?

Thanks,
Hisam

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-06-18 20:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-31 14:49 [PATCH] tools/include/linux/types.h: add ulong typedef for musl compatibility Hisam Mehboob
2026-06-18 20:03 ` Hisam Mehboob

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox