Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: Hisam Mehboob <hisamshar@gmail.com>
To: pbonzini@redhat.com
Cc: seanjc@google.com, shuah@kernel.org, me@brighamcampbell.com,
	kvm@vger.kernel.org, linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-kernel-mentees@lists.linuxfoundation.org,
	Hisam Mehboob <hisamshar@gmail.com>
Subject: [PATCH] tools/include/linux/types.h: add ulong typedef for musl compatibility
Date: Sun, 31 May 2026 19:49:36 +0500	[thread overview]
Message-ID: <20260531144934.403888-3-hisamshar@gmail.com> (raw)

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


             reply	other threads:[~2026-05-31 14:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-31 14:49 Hisam Mehboob [this message]
2026-05-31 15:01 ` [PATCH] tools/include/linux/types.h: add ulong typedef for musl compatibility sashiko-bot
2026-06-01 20:53   ` Hisam Mehboob
2026-06-18 20:03 ` Hisam Mehboob

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260531144934.403888-3-hisamshar@gmail.com \
    --to=hisamshar@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel-mentees@lists.linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=me@brighamcampbell.com \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.com \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox