public inbox for [email protected]
 help / color / mirror / Atom feed
From: Alviro Iskandar Setiawan <[email protected]>
To: Jens Axboe <[email protected]>
Cc: Alviro Iskandar Setiawan <[email protected]>,
	io-uring Mailing List <[email protected]>,
	Ammar Faizi <[email protected]>,
	GNU/Weeb Mailing List <[email protected]>
Subject: [PATCH liburing] arch/syscall: Use __NR_mmap2 existence for preprocessor condition
Date: Tue, 26 Jul 2022 11:18:51 +0000	[thread overview]
Message-ID: <[email protected]> (raw)

Now __NR_mmap2 is only used for i386. But it is also needed for other
archs like ARM and RISCV32. Decide to use it based on the __NR_mmap2
definition as it's not defined on other archs. Currently, this has no
effect because other archs use the generic mmap definition from libc.

Signed-off-by: Alviro Iskandar Setiawan <[email protected]>
---
 src/arch/syscall-defs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/arch/syscall-defs.h b/src/arch/syscall-defs.h
index 9ddac45..374aa0d 100644
--- a/src/arch/syscall-defs.h
+++ b/src/arch/syscall-defs.h
@@ -27,7 +27,7 @@ static inline void *__sys_mmap(void *addr, size_t length, int prot, int flags,
 {
 	int nr;
 
-#if defined(__i386__)
+#if defined(__NR_mmap2)
 	nr = __NR_mmap2;
 	offset >>= 12;
 #else
-- 
Alviro Iskandar Setiawan


             reply	other threads:[~2022-07-26 11:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-26 11:18 Alviro Iskandar Setiawan [this message]
2022-07-26 11:29 ` [PATCH liburing] arch/syscall: Use __NR_mmap2 existence for preprocessor condition Ammar Faizi
2022-07-26 12:58 ` Jens Axboe

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=20220726111851.3608291-1-alviro.iskandar@gnuweeb.org \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /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