* [PATCH liburing] arch/syscall: Use __NR_mmap2 existence for preprocessor condition
@ 2022-07-26 11:18 Alviro Iskandar Setiawan
2022-07-26 11:29 ` Ammar Faizi
2022-07-26 12:58 ` Jens Axboe
0 siblings, 2 replies; 3+ messages in thread
From: Alviro Iskandar Setiawan @ 2022-07-26 11:18 UTC (permalink / raw)
To: Jens Axboe
Cc: Alviro Iskandar Setiawan, io-uring Mailing List, Ammar Faizi,
GNU/Weeb Mailing List
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH liburing] arch/syscall: Use __NR_mmap2 existence for preprocessor condition
2022-07-26 11:18 [PATCH liburing] arch/syscall: Use __NR_mmap2 existence for preprocessor condition Alviro Iskandar Setiawan
@ 2022-07-26 11:29 ` Ammar Faizi
2022-07-26 12:58 ` Jens Axboe
1 sibling, 0 replies; 3+ messages in thread
From: Ammar Faizi @ 2022-07-26 11:29 UTC (permalink / raw)
To: Alviro Iskandar Setiawan, Jens Axboe
Cc: io-uring Mailing List, GNU/Weeb Mailing List
On 7/26/22 6:18 PM, Alviro Iskandar Setiawan wrote:
> 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]>
Acked-by: Ammar Faizi <[email protected]>
--
Ammar Faizi
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH liburing] arch/syscall: Use __NR_mmap2 existence for preprocessor condition
2022-07-26 11:18 [PATCH liburing] arch/syscall: Use __NR_mmap2 existence for preprocessor condition Alviro Iskandar Setiawan
2022-07-26 11:29 ` Ammar Faizi
@ 2022-07-26 12:58 ` Jens Axboe
1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2022-07-26 12:58 UTC (permalink / raw)
To: alviro.iskandar; +Cc: gwml, ammarfaizi2, io-uring
On Tue, 26 Jul 2022 11:18:51 +0000, Alviro Iskandar Setiawan wrote:
> 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.
>
>
Applied, thanks!
[1/1] arch/syscall: Use __NR_mmap2 existence for preprocessor condition
commit: 00c8a105ba688a3826304430f8e57835a302609d
Best regards,
--
Jens Axboe
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-07-26 12:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-26 11:18 [PATCH liburing] arch/syscall: Use __NR_mmap2 existence for preprocessor condition Alviro Iskandar Setiawan
2022-07-26 11:29 ` Ammar Faizi
2022-07-26 12:58 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox