From: Gao Xiang <hsiangkao@linux.alibaba.com>
To: linux-erofs@lists.ozlabs.org
Cc: Gao Xiang <hsiangkao@linux.alibaba.com>
Subject: [PATCH] erofs-utils: lib: fix undeclared gettid()
Date: Tue, 14 Jul 2026 13:55:44 +0800 [thread overview]
Message-ID: <20260714055544.742154-1-hsiangkao@linux.alibaba.com> (raw)
gettid() is only available since glibc 2.30.
Fixes: 799c933bbefb ("erofs-utils: add ublk userspace block device backend")
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
---
configure.ac | 1 +
lib/backends/ublk.c | 5 +++++
2 files changed, 6 insertions(+)
diff --git a/configure.ac b/configure.ac
index ddee374b6e85..25a48922c1dc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -284,6 +284,7 @@ AC_CHECK_FUNCS(m4_flatten([
fallocate
getrandom
getrlimit
+ gettid
gettimeofday
lgetxattr
llistxattr
diff --git a/lib/backends/ublk.c b/lib/backends/ublk.c
index b63d121e54ac..d2c5e1968014 100644
--- a/lib/backends/ublk.c
+++ b/lib/backends/ublk.c
@@ -29,6 +29,11 @@
#include <liburing.h>
#endif
+#ifndef HAVE_GETTID
+#include <sys/syscall.h>
+#define gettid() syscall(__NR_gettid)
+#endif
+
/* (Legacy) Admin commands, issued by ublk server, and handled by ublk driver */
#define UBLK_CMD_GET_QUEUE_AFFINITY 0x01
#define UBLK_CMD_GET_DEV_INFO 0x02
--
2.43.5
reply other threads:[~2026-07-14 5:56 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20260714055544.742154-1-hsiangkao@linux.alibaba.com \
--to=hsiangkao@linux.alibaba.com \
--cc=linux-erofs@lists.ozlabs.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