mailing list of musl libc
 help / color / mirror / code / Atom feed
* [musl] [PATCH v2 0/8] use new SYS_fchmodat2 syscall to implement fchmodat with flags
@ 2024-02-18  2:26 Gaël PORTAY
  2024-02-18  2:26 ` [musl] [PATCH v2 1/8] bits/syscall.h: add process_madvise from linux v5.14 Gaël PORTAY
                   ` (7 more replies)
  0 siblings, 8 replies; 11+ messages in thread
From: Gaël PORTAY @ 2024-02-18  2:26 UTC (permalink / raw)
  To: musl; +Cc: Gaël PORTAY

hello,

this patch serie adds the syscall SYS_fchmodat2 to implement fchmodat().
it has landed in linux v6.6.

fhe first five patches catch up the gap of syscall numbers.

the sixth patch removes the spurious flag argument from the syscall
SYS_fchmodat (linux lacks for that argument actually).

the seventh patch defines the syscall itself in headers.

the last patch uses the syscall SYS_fchmodat2 to implement fchmodat() if
flags are passed. the same way the syscall SYS_faccessat2 was used to
implement faccessat() with flags.

it wat tested locally on x86_64 (only), with a dummy test-fchmodat.c.

here is what strace says if no flags are passed:

	gportay@archlinux ~/src/musl $ strace ./lib/libc.so ./test-fchmodat . file 0664 0
	execve("./lib/libc.so", ["./lib/libc.so", "./test-fchmodat", ".", "file", "0664", "0"], 0x7ffc172ccc68 /* 34 vars */) = 0
	arch_prctl(ARCH_SET_FS, 0x765732cf7ba8) = 0
	set_tid_address(0x765732cf8018)         = 367709
	open("./test-fchmodat", O_RDONLY|O_LARGEFILE) = 3
	read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260\20\0\0\0\0\0\0"..., 960) = 960
	mmap(NULL, 20480, PROT_READ, MAP_PRIVATE, 3, 0) = 0x765732c58000
	mmap(0x765732c59000, 4096, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0x1000) = 0x765732c59000
	mmap(0x765732c5a000, 4096, PROT_READ, MAP_PRIVATE|MAP_FIXED, 3, 0x2000) = 0x765732c5a000
	mmap(0x765732c5b000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x2000) = 0x765732c5b000
	close(3)                                = 0
	brk(NULL)                               = 0x5555568a6000
	brk(0x5555568a8000)                     = 0x5555568a8000
	mmap(0x5555568a6000, 4096, PROT_NONE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x5555568a6000
	mprotect(0x765732cf4000, 4096, PROT_READ) = 0
	mprotect(0x765732c5b000, 4096, PROT_READ) = 0
	fchmodat(AT_FDCWD, "file", 0664)        = 0
	exit_group(0)                           = ?
	+++ exited with 0 +++

it uses the syscall fchmodat.

and what strace says if AT_SYMLINK_NOFOLLOW is passed:

	gportay@archlinux ~/src/musl $ strace ./lib/libc.so ./test-fchmodat . file 0664 0x100
	execve("./lib/libc.so", ["./lib/libc.so", "./test-fchmodat", ".", "file", "0664", "0x100"], 0x7ffcd7228278 /* 34 vars */) = 0
	arch_prctl(ARCH_SET_FS, 0x7318d8907ba8) = 0
	set_tid_address(0x7318d8908018)         = 367715
	open("./test-fchmodat", O_RDONLY|O_LARGEFILE) = 3
	read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260\20\0\0\0\0\0\0"..., 960) = 960
	mmap(NULL, 20480, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7318d8868000
	mmap(0x7318d8869000, 4096, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0x1000) = 0x7318d8869000
	mmap(0x7318d886a000, 4096, PROT_READ, MAP_PRIVATE|MAP_FIXED, 3, 0x2000) = 0x7318d886a000
	mmap(0x7318d886b000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x2000) = 0x7318d886b000
	close(3)                                = 0
	brk(NULL)                               = 0x55555563d000
	brk(0x55555563f000)                     = 0x55555563f000
	mmap(0x55555563d000, 4096, PROT_NONE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x55555563d000
	mprotect(0x7318d8904000, 4096, PROT_READ) = 0
	mprotect(0x7318d886b000, 4096, PROT_READ) = 0
	fchmodat2(AT_FDCWD, "file", 0664, AT_SYMLINK_NOFOLLOW) = 0
	exit_group(0)                           = ?
	+++ exited with 0 +++

it uses the syscall fchmodat2!

	#include <unistd.h>
	#include <stdlib.h>
	#include <stdio.h>
	#include <errno.h>
	#include <string.h>
	
	#include <fcntl.h>
	#include <sys/stat.h>
	
	int main(int argc, char * const argv[])
	{
		int dfd = AT_FDCWD, flags = 0, ret = EXIT_FAILURE;
		mode_t mode;
	
		if (argc < 4) {
			fprintf(stderr, "Too few arguments\n");
			exit(EXIT_FAILURE);
		} else if (argc > 5) {
			fprintf(stderr, "Too many arguments\n");
			exit(EXIT_FAILURE);
		}
	
		mode = strtoul(argv[3], NULL, 0);
		if (argc == 5)
			flags = strtoul(argv[4], NULL, 0);
	
		if (strcmp(argv[1], "-") == 0) {
			dfd = open(argv[1], O_DIRECTORY);
			if (dfd == -1) {
				perror("open");
				return EXIT_FAILURE;
			}
		}
	
		if (fchmodat(dfd, argv[2], mode, flags)) {
			perror("fchmodat");
			goto exit;
		}
	
		ret = EXIT_SUCCESS;
	
	exit:
		if (dfd != AT_FDCWD)
			if (close(dfd))
				perror("close");
	
		return ret;
	}

changes since v1:
 - catchup syscall gap
 - add missing syscall number for aarch64

regards,
Gaël PORTAY (8):
  bits/syscall.h: add process_madvise from linux v5.14
  bits/syscall.h: add process_mrelease from linux v5.15
  bits/syscall.h: add futex_waitv from linux v5.16
  bits/syscall.h: add set_mempolicy_home_node from linux v5.17
  bits/syscall.h: add cachestat from linux v6.4
  remove flag argument from fchmodat syscall
  bits/syscall.h: add __NR_fchmodat2 from linux v6.6
  use new SYS_fchmodat2 syscall to implement fchmodat with flags

 arch/aarch64/bits/syscall.h.in    | 6 ++++++
 arch/arm/bits/syscall.h.in        | 6 ++++++
 arch/i386/bits/syscall.h.in       | 6 ++++++
 arch/m68k/bits/syscall.h.in       | 6 ++++++
 arch/microblaze/bits/syscall.h.in | 6 ++++++
 arch/mips/bits/syscall.h.in       | 6 ++++++
 arch/mips64/bits/syscall.h.in     | 6 ++++++
 arch/mipsn32/bits/syscall.h.in    | 6 ++++++
 arch/or1k/bits/syscall.h.in       | 6 ++++++
 arch/powerpc/bits/syscall.h.in    | 6 ++++++
 arch/powerpc64/bits/syscall.h.in  | 6 ++++++
 arch/riscv64/bits/syscall.h.in    | 6 ++++++
 arch/s390x/bits/syscall.h.in      | 6 ++++++
 arch/sh/bits/syscall.h.in         | 6 ++++++
 arch/x32/bits/syscall.h.in        | 6 ++++++
 arch/x86_64/bits/syscall.h.in     | 6 ++++++
 src/stat/fchmodat.c               | 7 ++++++-
 17 files changed, 102 insertions(+), 1 deletion(-)

-- 
2.43.2


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

* [musl] [PATCH v2 1/8] bits/syscall.h: add process_madvise from linux v5.14
  2024-02-18  2:26 [musl] [PATCH v2 0/8] use new SYS_fchmodat2 syscall to implement fchmodat with flags Gaël PORTAY
@ 2024-02-18  2:26 ` Gaël PORTAY
  2024-02-23  0:32   ` Rich Felker
  2024-02-18  2:26 ` [musl] [PATCH v2 2/8] bits/syscall.h: add process_mrelease from linux v5.15 Gaël PORTAY
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 11+ messages in thread
From: Gaël PORTAY @ 2024-02-18  2:26 UTC (permalink / raw)
  To: musl; +Cc: Gaël PORTAY

see

    linux commit 7bb7f2ac24a028b20fca466b9633847b289b156a
    arch, mm: wire up memfd_secret system call where relevant

    linux commit 1507f51255c9ff07d75909a84e7c0d7f3c4b2f49
    mm: introduce memfd_secret system call to create "secret" memory areas

    linux commit b633896314c0f78f2b4eb7b19a530d68f2a35445
    tools headers UAPI: Sync s390 syscall table file that wires up the memfd_secret syscall
---
 arch/aarch64/bits/syscall.h.in    | 1 +
 arch/arm/bits/syscall.h.in        | 1 +
 arch/i386/bits/syscall.h.in       | 1 +
 arch/m68k/bits/syscall.h.in       | 1 +
 arch/microblaze/bits/syscall.h.in | 1 +
 arch/mips/bits/syscall.h.in       | 1 +
 arch/mips64/bits/syscall.h.in     | 1 +
 arch/mipsn32/bits/syscall.h.in    | 1 +
 arch/or1k/bits/syscall.h.in       | 1 +
 arch/powerpc/bits/syscall.h.in    | 1 +
 arch/powerpc64/bits/syscall.h.in  | 1 +
 arch/riscv64/bits/syscall.h.in    | 1 +
 arch/s390x/bits/syscall.h.in      | 1 +
 arch/sh/bits/syscall.h.in         | 1 +
 arch/x32/bits/syscall.h.in        | 1 +
 arch/x86_64/bits/syscall.h.in     | 1 +
 16 files changed, 16 insertions(+)

diff --git a/arch/aarch64/bits/syscall.h.in b/arch/aarch64/bits/syscall.h.in
index 5f420e61..88512ec9 100644
--- a/arch/aarch64/bits/syscall.h.in
+++ b/arch/aarch64/bits/syscall.h.in
@@ -299,4 +299,5 @@
 #define __NR_landlock_create_ruleset	444
 #define __NR_landlock_add_rule	445
 #define __NR_landlock_restrict_self	446
+// reserved for memfd_secret	447
 
diff --git a/arch/arm/bits/syscall.h.in b/arch/arm/bits/syscall.h.in
index 048fdea7..d63d9e24 100644
--- a/arch/arm/bits/syscall.h.in
+++ b/arch/arm/bits/syscall.h.in
@@ -399,6 +399,7 @@
 #define __NR_landlock_create_ruleset	444
 #define __NR_landlock_add_rule	445
 #define __NR_landlock_restrict_self	446
+// reserved for memfd_secret	447
 
 #define __ARM_NR_breakpoint	0x0f0001
 #define __ARM_NR_cacheflush	0x0f0002
diff --git a/arch/i386/bits/syscall.h.in b/arch/i386/bits/syscall.h.in
index 46ffe1d9..8baf6de7 100644
--- a/arch/i386/bits/syscall.h.in
+++ b/arch/i386/bits/syscall.h.in
@@ -436,4 +436,5 @@
 #define __NR_landlock_create_ruleset	444
 #define __NR_landlock_add_rule	445
 #define __NR_landlock_restrict_self	446
+#define __NR_memfd_secret	447
 
diff --git a/arch/m68k/bits/syscall.h.in b/arch/m68k/bits/syscall.h.in
index a0c63323..11c08444 100644
--- a/arch/m68k/bits/syscall.h.in
+++ b/arch/m68k/bits/syscall.h.in
@@ -416,3 +416,4 @@
 #define __NR_landlock_create_ruleset	444
 #define __NR_landlock_add_rule	445
 #define __NR_landlock_restrict_self	446
+// reserved for memfd_secret	447
diff --git a/arch/microblaze/bits/syscall.h.in b/arch/microblaze/bits/syscall.h.in
index 931d7919..f759537b 100644
--- a/arch/microblaze/bits/syscall.h.in
+++ b/arch/microblaze/bits/syscall.h.in
@@ -437,4 +437,5 @@
 #define __NR_landlock_create_ruleset	444
 #define __NR_landlock_add_rule	445
 #define __NR_landlock_restrict_self	446
+// reserved for memfd_secret	447
 
diff --git a/arch/mips/bits/syscall.h.in b/arch/mips/bits/syscall.h.in
index 63e3503a..c4b16e65 100644
--- a/arch/mips/bits/syscall.h.in
+++ b/arch/mips/bits/syscall.h.in
@@ -418,4 +418,5 @@
 #define __NR_landlock_create_ruleset	4444
 #define __NR_landlock_add_rule	4445
 #define __NR_landlock_restrict_self	4446
+// reserved for memfd_secret	4447
 
diff --git a/arch/mips64/bits/syscall.h.in b/arch/mips64/bits/syscall.h.in
index b89965d1..4fa42332 100644
--- a/arch/mips64/bits/syscall.h.in
+++ b/arch/mips64/bits/syscall.h.in
@@ -348,4 +348,5 @@
 #define __NR_landlock_create_ruleset	5444
 #define __NR_landlock_add_rule	5445
 #define __NR_landlock_restrict_self	5446
+// reserved for memfd_secret	5447
 
diff --git a/arch/mipsn32/bits/syscall.h.in b/arch/mipsn32/bits/syscall.h.in
index bb2d04a8..bfe0bd1c 100644
--- a/arch/mipsn32/bits/syscall.h.in
+++ b/arch/mipsn32/bits/syscall.h.in
@@ -372,4 +372,5 @@
 #define __NR_landlock_create_ruleset	6444
 #define __NR_landlock_add_rule	6445
 #define __NR_landlock_restrict_self	6446
+// reserved for memfd_secret	6447
 
diff --git a/arch/or1k/bits/syscall.h.in b/arch/or1k/bits/syscall.h.in
index 2b5f2052..869c7ef5 100644
--- a/arch/or1k/bits/syscall.h.in
+++ b/arch/or1k/bits/syscall.h.in
@@ -321,4 +321,5 @@
 #define __NR_landlock_create_ruleset	444
 #define __NR_landlock_add_rule	445
 #define __NR_landlock_restrict_self	446
+// reserved for memfd_secret	447
 
diff --git a/arch/powerpc/bits/syscall.h.in b/arch/powerpc/bits/syscall.h.in
index b1605a58..7b4daad9 100644
--- a/arch/powerpc/bits/syscall.h.in
+++ b/arch/powerpc/bits/syscall.h.in
@@ -425,4 +425,5 @@
 #define __NR_landlock_create_ruleset	444
 #define __NR_landlock_add_rule	445
 #define __NR_landlock_restrict_self	446
+// reserved for memfd_secret	447
 
diff --git a/arch/powerpc64/bits/syscall.h.in b/arch/powerpc64/bits/syscall.h.in
index b3a8fba0..663e8b19 100644
--- a/arch/powerpc64/bits/syscall.h.in
+++ b/arch/powerpc64/bits/syscall.h.in
@@ -397,4 +397,5 @@
 #define __NR_landlock_create_ruleset	444
 #define __NR_landlock_add_rule	445
 #define __NR_landlock_restrict_self	446
+// reserved for memfd_secret	447
 
diff --git a/arch/riscv64/bits/syscall.h.in b/arch/riscv64/bits/syscall.h.in
index b534afe8..7b2b9dfd 100644
--- a/arch/riscv64/bits/syscall.h.in
+++ b/arch/riscv64/bits/syscall.h.in
@@ -299,6 +299,7 @@
 #define __NR_landlock_create_ruleset	444
 #define __NR_landlock_add_rule	445
 #define __NR_landlock_restrict_self	446
+// reserved for memfd_secret	447
 
 #define __NR_sysriscv __NR_arch_specific_syscall
 #define __NR_riscv_flush_icache (__NR_sysriscv + 15)
diff --git a/arch/s390x/bits/syscall.h.in b/arch/s390x/bits/syscall.h.in
index dfc38479..58697e5b 100644
--- a/arch/s390x/bits/syscall.h.in
+++ b/arch/s390x/bits/syscall.h.in
@@ -362,4 +362,5 @@
 #define __NR_landlock_create_ruleset	444
 #define __NR_landlock_add_rule	445
 #define __NR_landlock_restrict_self	446
+#define __NR_memfd_secret	447
 
diff --git a/arch/sh/bits/syscall.h.in b/arch/sh/bits/syscall.h.in
index ff14f54d..eb9cfe96 100644
--- a/arch/sh/bits/syscall.h.in
+++ b/arch/sh/bits/syscall.h.in
@@ -409,4 +409,5 @@
 #define __NR_landlock_create_ruleset	444
 #define __NR_landlock_add_rule	445
 #define __NR_landlock_restrict_self	446
+// reserved for memfd_secret	447
 
diff --git a/arch/x32/bits/syscall.h.in b/arch/x32/bits/syscall.h.in
index 5d22fa17..b3b07eef 100644
--- a/arch/x32/bits/syscall.h.in
+++ b/arch/x32/bits/syscall.h.in
@@ -308,6 +308,7 @@
 #define __NR_landlock_create_ruleset	(0x40000000 + 444)
 #define __NR_landlock_add_rule	(0x40000000 + 445)
 #define __NR_landlock_restrict_self	(0x40000000 + 446)
+#define __NR_memfd_secret	(0x40000000 + 447)
 
 
 #define __NR_rt_sigaction (0x40000000 + 512)
diff --git a/arch/x86_64/bits/syscall.h.in b/arch/x86_64/bits/syscall.h.in
index c3882de7..a81aa94a 100644
--- a/arch/x86_64/bits/syscall.h.in
+++ b/arch/x86_64/bits/syscall.h.in
@@ -355,4 +355,5 @@
 #define __NR_landlock_create_ruleset	444
 #define __NR_landlock_add_rule	445
 #define __NR_landlock_restrict_self	446
+#define __NR_memfd_secret	447
 
-- 
2.43.2


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

* [musl] [PATCH v2 2/8] bits/syscall.h: add process_mrelease from linux v5.15
  2024-02-18  2:26 [musl] [PATCH v2 0/8] use new SYS_fchmodat2 syscall to implement fchmodat with flags Gaël PORTAY
  2024-02-18  2:26 ` [musl] [PATCH v2 1/8] bits/syscall.h: add process_madvise from linux v5.14 Gaël PORTAY
@ 2024-02-18  2:26 ` Gaël PORTAY
  2024-02-18  2:26 ` [musl] [PATCH v2 3/8] bits/syscall.h: add futex_waitv from linux v5.16 Gaël PORTAY
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: Gaël PORTAY @ 2024-02-18  2:26 UTC (permalink / raw)
  To: musl; +Cc: Gaël PORTAY

see

    linux commit 884a7e5964e06ed93c7771c0d7cf19c09a8946f1
    mm: introduce process_mrelease system call

    linux commit dce49103962840dd61423d7627748d6c558d58c5
    mm: wire up syscall process_mrelease
---
 arch/aarch64/bits/syscall.h.in    | 1 +
 arch/arm/bits/syscall.h.in        | 1 +
 arch/i386/bits/syscall.h.in       | 1 +
 arch/m68k/bits/syscall.h.in       | 1 +
 arch/microblaze/bits/syscall.h.in | 1 +
 arch/mips/bits/syscall.h.in       | 1 +
 arch/mips64/bits/syscall.h.in     | 1 +
 arch/mipsn32/bits/syscall.h.in    | 1 +
 arch/or1k/bits/syscall.h.in       | 1 +
 arch/powerpc/bits/syscall.h.in    | 1 +
 arch/powerpc64/bits/syscall.h.in  | 1 +
 arch/riscv64/bits/syscall.h.in    | 1 +
 arch/s390x/bits/syscall.h.in      | 1 +
 arch/sh/bits/syscall.h.in         | 1 +
 arch/x32/bits/syscall.h.in        | 1 +
 arch/x86_64/bits/syscall.h.in     | 1 +
 16 files changed, 16 insertions(+)

diff --git a/arch/aarch64/bits/syscall.h.in b/arch/aarch64/bits/syscall.h.in
index 88512ec9..0eb225ff 100644
--- a/arch/aarch64/bits/syscall.h.in
+++ b/arch/aarch64/bits/syscall.h.in
@@ -300,4 +300,5 @@
 #define __NR_landlock_add_rule	445
 #define __NR_landlock_restrict_self	446
 // reserved for memfd_secret	447
+#define __NR_process_mrelease	448
 
diff --git a/arch/arm/bits/syscall.h.in b/arch/arm/bits/syscall.h.in
index d63d9e24..45aaa453 100644
--- a/arch/arm/bits/syscall.h.in
+++ b/arch/arm/bits/syscall.h.in
@@ -400,6 +400,7 @@
 #define __NR_landlock_add_rule	445
 #define __NR_landlock_restrict_self	446
 // reserved for memfd_secret	447
+#define __NR_process_mrelease	448
 
 #define __ARM_NR_breakpoint	0x0f0001
 #define __ARM_NR_cacheflush	0x0f0002
diff --git a/arch/i386/bits/syscall.h.in b/arch/i386/bits/syscall.h.in
index 8baf6de7..d8df69ec 100644
--- a/arch/i386/bits/syscall.h.in
+++ b/arch/i386/bits/syscall.h.in
@@ -437,4 +437,5 @@
 #define __NR_landlock_add_rule	445
 #define __NR_landlock_restrict_self	446
 #define __NR_memfd_secret	447
+#define __NR_process_mrelease	448
 
diff --git a/arch/m68k/bits/syscall.h.in b/arch/m68k/bits/syscall.h.in
index 11c08444..9ab58651 100644
--- a/arch/m68k/bits/syscall.h.in
+++ b/arch/m68k/bits/syscall.h.in
@@ -417,3 +417,4 @@
 #define __NR_landlock_add_rule	445
 #define __NR_landlock_restrict_self	446
 // reserved for memfd_secret	447
+#define __NR_process_mrelease	448
diff --git a/arch/microblaze/bits/syscall.h.in b/arch/microblaze/bits/syscall.h.in
index f759537b..034620bf 100644
--- a/arch/microblaze/bits/syscall.h.in
+++ b/arch/microblaze/bits/syscall.h.in
@@ -438,4 +438,5 @@
 #define __NR_landlock_add_rule	445
 #define __NR_landlock_restrict_self	446
 // reserved for memfd_secret	447
+#define __NR_process_mrelease	448
 
diff --git a/arch/mips/bits/syscall.h.in b/arch/mips/bits/syscall.h.in
index c4b16e65..108da1b5 100644
--- a/arch/mips/bits/syscall.h.in
+++ b/arch/mips/bits/syscall.h.in
@@ -419,4 +419,5 @@
 #define __NR_landlock_add_rule	4445
 #define __NR_landlock_restrict_self	4446
 // reserved for memfd_secret	4447
+#define __NR_process_mrelease	4448
 
diff --git a/arch/mips64/bits/syscall.h.in b/arch/mips64/bits/syscall.h.in
index 4fa42332..3204f90d 100644
--- a/arch/mips64/bits/syscall.h.in
+++ b/arch/mips64/bits/syscall.h.in
@@ -349,4 +349,5 @@
 #define __NR_landlock_add_rule	5445
 #define __NR_landlock_restrict_self	5446
 // reserved for memfd_secret	5447
+#define __NR_process_mrelease	5448
 
diff --git a/arch/mipsn32/bits/syscall.h.in b/arch/mipsn32/bits/syscall.h.in
index bfe0bd1c..91333694 100644
--- a/arch/mipsn32/bits/syscall.h.in
+++ b/arch/mipsn32/bits/syscall.h.in
@@ -373,4 +373,5 @@
 #define __NR_landlock_add_rule	6445
 #define __NR_landlock_restrict_self	6446
 // reserved for memfd_secret	6447
+#define __NR_process_mrelease	6448
 
diff --git a/arch/or1k/bits/syscall.h.in b/arch/or1k/bits/syscall.h.in
index 869c7ef5..27c137c2 100644
--- a/arch/or1k/bits/syscall.h.in
+++ b/arch/or1k/bits/syscall.h.in
@@ -322,4 +322,5 @@
 #define __NR_landlock_add_rule	445
 #define __NR_landlock_restrict_self	446
 // reserved for memfd_secret	447
+#define __NR_process_mrelease	448
 
diff --git a/arch/powerpc/bits/syscall.h.in b/arch/powerpc/bits/syscall.h.in
index 7b4daad9..c7c3cee1 100644
--- a/arch/powerpc/bits/syscall.h.in
+++ b/arch/powerpc/bits/syscall.h.in
@@ -426,4 +426,5 @@
 #define __NR_landlock_add_rule	445
 #define __NR_landlock_restrict_self	446
 // reserved for memfd_secret	447
+#define __NR_process_mrelease	448
 
diff --git a/arch/powerpc64/bits/syscall.h.in b/arch/powerpc64/bits/syscall.h.in
index 663e8b19..ebc6edf8 100644
--- a/arch/powerpc64/bits/syscall.h.in
+++ b/arch/powerpc64/bits/syscall.h.in
@@ -398,4 +398,5 @@
 #define __NR_landlock_add_rule	445
 #define __NR_landlock_restrict_self	446
 // reserved for memfd_secret	447
+#define __NR_process_mrelease	448
 
diff --git a/arch/riscv64/bits/syscall.h.in b/arch/riscv64/bits/syscall.h.in
index 7b2b9dfd..176d76c4 100644
--- a/arch/riscv64/bits/syscall.h.in
+++ b/arch/riscv64/bits/syscall.h.in
@@ -300,6 +300,7 @@
 #define __NR_landlock_add_rule	445
 #define __NR_landlock_restrict_self	446
 // reserved for memfd_secret	447
+#define __NR_process_mrelease	448
 
 #define __NR_sysriscv __NR_arch_specific_syscall
 #define __NR_riscv_flush_icache (__NR_sysriscv + 15)
diff --git a/arch/s390x/bits/syscall.h.in b/arch/s390x/bits/syscall.h.in
index 58697e5b..cc239a11 100644
--- a/arch/s390x/bits/syscall.h.in
+++ b/arch/s390x/bits/syscall.h.in
@@ -363,4 +363,5 @@
 #define __NR_landlock_add_rule	445
 #define __NR_landlock_restrict_self	446
 #define __NR_memfd_secret	447
+#define __NR_process_mrelease	448
 
diff --git a/arch/sh/bits/syscall.h.in b/arch/sh/bits/syscall.h.in
index eb9cfe96..1a0a4680 100644
--- a/arch/sh/bits/syscall.h.in
+++ b/arch/sh/bits/syscall.h.in
@@ -410,4 +410,5 @@
 #define __NR_landlock_add_rule	445
 #define __NR_landlock_restrict_self	446
 // reserved for memfd_secret	447
+#define __NR_process_mrelease	448
 
diff --git a/arch/x32/bits/syscall.h.in b/arch/x32/bits/syscall.h.in
index b3b07eef..6b0e3c3a 100644
--- a/arch/x32/bits/syscall.h.in
+++ b/arch/x32/bits/syscall.h.in
@@ -309,6 +309,7 @@
 #define __NR_landlock_add_rule	(0x40000000 + 445)
 #define __NR_landlock_restrict_self	(0x40000000 + 446)
 #define __NR_memfd_secret	(0x40000000 + 447)
+#define __NR_process_mrelease	(0x40000000 + 448)
 
 
 #define __NR_rt_sigaction (0x40000000 + 512)
diff --git a/arch/x86_64/bits/syscall.h.in b/arch/x86_64/bits/syscall.h.in
index a81aa94a..647c427b 100644
--- a/arch/x86_64/bits/syscall.h.in
+++ b/arch/x86_64/bits/syscall.h.in
@@ -356,4 +356,5 @@
 #define __NR_landlock_add_rule	445
 #define __NR_landlock_restrict_self	446
 #define __NR_memfd_secret	447
+#define __NR_process_mrelease	448
 
-- 
2.43.2


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

* [musl] [PATCH v2 3/8] bits/syscall.h: add futex_waitv from linux v5.16
  2024-02-18  2:26 [musl] [PATCH v2 0/8] use new SYS_fchmodat2 syscall to implement fchmodat with flags Gaël PORTAY
  2024-02-18  2:26 ` [musl] [PATCH v2 1/8] bits/syscall.h: add process_madvise from linux v5.14 Gaël PORTAY
  2024-02-18  2:26 ` [musl] [PATCH v2 2/8] bits/syscall.h: add process_mrelease from linux v5.15 Gaël PORTAY
@ 2024-02-18  2:26 ` Gaël PORTAY
  2024-02-18  2:26 ` [musl] [PATCH v2 4/8] bits/syscall.h: add set_mempolicy_home_node from linux v5.17 Gaël PORTAY
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: Gaël PORTAY @ 2024-02-18  2:26 UTC (permalink / raw)
  To: musl; +Cc: Gaël PORTAY

see

    linux commit 039c0ec9bb77446d7ada7f55f90af9299b28ca49
    futex,x86: Wire up sys_futex_waitv()

    linux commit ea7c45fde5aa3e761aaddb7902a31a95cb120e7b
    futex,arm: Wire up sys_futex_waitv()

    linux commit b3ff2881ba18b852f79f5476d7631940071f1adb
    MIPS: syscalls: Wire up futex_waitv syscall

    linux commit 8f663eb3b7e8c4c88919be8c42768a8100ca6060
    parisc: Wire up futex_waitv

    linux commit 6c122360cf2f4c5a856fcbd79b4485b7baec942a
    s390: wire up sys_futex_waitv system call

    linux commit a0eb2da92b715d0c97b96b09979689ea09faefe6
    futex: Wireup futex_waitv syscall
---
 arch/aarch64/bits/syscall.h.in    | 1 +
 arch/arm/bits/syscall.h.in        | 1 +
 arch/i386/bits/syscall.h.in       | 1 +
 arch/m68k/bits/syscall.h.in       | 1 +
 arch/microblaze/bits/syscall.h.in | 1 +
 arch/mips/bits/syscall.h.in       | 1 +
 arch/mips64/bits/syscall.h.in     | 1 +
 arch/mipsn32/bits/syscall.h.in    | 1 +
 arch/or1k/bits/syscall.h.in       | 1 +
 arch/powerpc/bits/syscall.h.in    | 1 +
 arch/powerpc64/bits/syscall.h.in  | 1 +
 arch/riscv64/bits/syscall.h.in    | 1 +
 arch/s390x/bits/syscall.h.in      | 1 +
 arch/sh/bits/syscall.h.in         | 1 +
 arch/x32/bits/syscall.h.in        | 1 +
 arch/x86_64/bits/syscall.h.in     | 1 +
 16 files changed, 16 insertions(+)

diff --git a/arch/aarch64/bits/syscall.h.in b/arch/aarch64/bits/syscall.h.in
index 0eb225ff..fc646f0e 100644
--- a/arch/aarch64/bits/syscall.h.in
+++ b/arch/aarch64/bits/syscall.h.in
@@ -301,4 +301,5 @@
 #define __NR_landlock_restrict_self	446
 // reserved for memfd_secret	447
 #define __NR_process_mrelease	448
+#define __NR_futex_waitv	449
 
diff --git a/arch/arm/bits/syscall.h.in b/arch/arm/bits/syscall.h.in
index 45aaa453..ec40e0b9 100644
--- a/arch/arm/bits/syscall.h.in
+++ b/arch/arm/bits/syscall.h.in
@@ -401,6 +401,7 @@
 #define __NR_landlock_restrict_self	446
 // reserved for memfd_secret	447
 #define __NR_process_mrelease	448
+#define __NR_futex_waitv	449
 
 #define __ARM_NR_breakpoint	0x0f0001
 #define __ARM_NR_cacheflush	0x0f0002
diff --git a/arch/i386/bits/syscall.h.in b/arch/i386/bits/syscall.h.in
index d8df69ec..907b5641 100644
--- a/arch/i386/bits/syscall.h.in
+++ b/arch/i386/bits/syscall.h.in
@@ -438,4 +438,5 @@
 #define __NR_landlock_restrict_self	446
 #define __NR_memfd_secret	447
 #define __NR_process_mrelease	448
+#define __NR_futex_waitv	449
 
diff --git a/arch/m68k/bits/syscall.h.in b/arch/m68k/bits/syscall.h.in
index 9ab58651..e545c68d 100644
--- a/arch/m68k/bits/syscall.h.in
+++ b/arch/m68k/bits/syscall.h.in
@@ -418,3 +418,4 @@
 #define __NR_landlock_restrict_self	446
 // reserved for memfd_secret	447
 #define __NR_process_mrelease	448
+#define __NR_futex_waitv	449
diff --git a/arch/microblaze/bits/syscall.h.in b/arch/microblaze/bits/syscall.h.in
index 034620bf..2396aed3 100644
--- a/arch/microblaze/bits/syscall.h.in
+++ b/arch/microblaze/bits/syscall.h.in
@@ -439,4 +439,5 @@
 #define __NR_landlock_restrict_self	446
 // reserved for memfd_secret	447
 #define __NR_process_mrelease	448
+#define __NR_futex_waitv	449
 
diff --git a/arch/mips/bits/syscall.h.in b/arch/mips/bits/syscall.h.in
index 108da1b5..85fbbb4e 100644
--- a/arch/mips/bits/syscall.h.in
+++ b/arch/mips/bits/syscall.h.in
@@ -420,4 +420,5 @@
 #define __NR_landlock_restrict_self	4446
 // reserved for memfd_secret	4447
 #define __NR_process_mrelease	4448
+#define __NR_futex_waitv	4449
 
diff --git a/arch/mips64/bits/syscall.h.in b/arch/mips64/bits/syscall.h.in
index 3204f90d..a841c24a 100644
--- a/arch/mips64/bits/syscall.h.in
+++ b/arch/mips64/bits/syscall.h.in
@@ -350,4 +350,5 @@
 #define __NR_landlock_restrict_self	5446
 // reserved for memfd_secret	5447
 #define __NR_process_mrelease	5448
+#define __NR_futex_waitv	5449
 
diff --git a/arch/mipsn32/bits/syscall.h.in b/arch/mipsn32/bits/syscall.h.in
index 91333694..a2f2b55e 100644
--- a/arch/mipsn32/bits/syscall.h.in
+++ b/arch/mipsn32/bits/syscall.h.in
@@ -374,4 +374,5 @@
 #define __NR_landlock_restrict_self	6446
 // reserved for memfd_secret	6447
 #define __NR_process_mrelease	6448
+#define __NR_futex_waitv	6449
 
diff --git a/arch/or1k/bits/syscall.h.in b/arch/or1k/bits/syscall.h.in
index 27c137c2..f4000e43 100644
--- a/arch/or1k/bits/syscall.h.in
+++ b/arch/or1k/bits/syscall.h.in
@@ -323,4 +323,5 @@
 #define __NR_landlock_restrict_self	446
 // reserved for memfd_secret	447
 #define __NR_process_mrelease	448
+#define __NR_futex_waitv	449
 
diff --git a/arch/powerpc/bits/syscall.h.in b/arch/powerpc/bits/syscall.h.in
index c7c3cee1..cc1c06a4 100644
--- a/arch/powerpc/bits/syscall.h.in
+++ b/arch/powerpc/bits/syscall.h.in
@@ -427,4 +427,5 @@
 #define __NR_landlock_restrict_self	446
 // reserved for memfd_secret	447
 #define __NR_process_mrelease	448
+#define __NR_futex_waitv	449
 
diff --git a/arch/powerpc64/bits/syscall.h.in b/arch/powerpc64/bits/syscall.h.in
index ebc6edf8..b96285f9 100644
--- a/arch/powerpc64/bits/syscall.h.in
+++ b/arch/powerpc64/bits/syscall.h.in
@@ -399,4 +399,5 @@
 #define __NR_landlock_restrict_self	446
 // reserved for memfd_secret	447
 #define __NR_process_mrelease	448
+#define __NR_futex_waitv	449
 
diff --git a/arch/riscv64/bits/syscall.h.in b/arch/riscv64/bits/syscall.h.in
index 176d76c4..4f6d2a0b 100644
--- a/arch/riscv64/bits/syscall.h.in
+++ b/arch/riscv64/bits/syscall.h.in
@@ -301,6 +301,7 @@
 #define __NR_landlock_restrict_self	446
 // reserved for memfd_secret	447
 #define __NR_process_mrelease	448
+#define __NR_futex_waitv	449
 
 #define __NR_sysriscv __NR_arch_specific_syscall
 #define __NR_riscv_flush_icache (__NR_sysriscv + 15)
diff --git a/arch/s390x/bits/syscall.h.in b/arch/s390x/bits/syscall.h.in
index cc239a11..0de01875 100644
--- a/arch/s390x/bits/syscall.h.in
+++ b/arch/s390x/bits/syscall.h.in
@@ -364,4 +364,5 @@
 #define __NR_landlock_restrict_self	446
 #define __NR_memfd_secret	447
 #define __NR_process_mrelease	448
+#define __NR_futex_waitv	449
 
diff --git a/arch/sh/bits/syscall.h.in b/arch/sh/bits/syscall.h.in
index 1a0a4680..49853899 100644
--- a/arch/sh/bits/syscall.h.in
+++ b/arch/sh/bits/syscall.h.in
@@ -411,4 +411,5 @@
 #define __NR_landlock_restrict_self	446
 // reserved for memfd_secret	447
 #define __NR_process_mrelease	448
+#define __NR_futex_waitv	449
 
diff --git a/arch/x32/bits/syscall.h.in b/arch/x32/bits/syscall.h.in
index 6b0e3c3a..5390db02 100644
--- a/arch/x32/bits/syscall.h.in
+++ b/arch/x32/bits/syscall.h.in
@@ -310,6 +310,7 @@
 #define __NR_landlock_restrict_self	(0x40000000 + 446)
 #define __NR_memfd_secret	(0x40000000 + 447)
 #define __NR_process_mrelease	(0x40000000 + 448)
+#define __NR_futex_waitv	(0x40000000 + 449)
 
 
 #define __NR_rt_sigaction (0x40000000 + 512)
diff --git a/arch/x86_64/bits/syscall.h.in b/arch/x86_64/bits/syscall.h.in
index 647c427b..f566d52d 100644
--- a/arch/x86_64/bits/syscall.h.in
+++ b/arch/x86_64/bits/syscall.h.in
@@ -357,4 +357,5 @@
 #define __NR_landlock_restrict_self	446
 #define __NR_memfd_secret	447
 #define __NR_process_mrelease	448
+#define __NR_futex_waitv	449
 
-- 
2.43.2


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

* [musl] [PATCH v2 4/8] bits/syscall.h: add set_mempolicy_home_node from linux v5.17
  2024-02-18  2:26 [musl] [PATCH v2 0/8] use new SYS_fchmodat2 syscall to implement fchmodat with flags Gaël PORTAY
                   ` (2 preceding siblings ...)
  2024-02-18  2:26 ` [musl] [PATCH v2 3/8] bits/syscall.h: add futex_waitv from linux v5.16 Gaël PORTAY
@ 2024-02-18  2:26 ` Gaël PORTAY
  2024-02-18  2:26 ` [musl] [PATCH v2 5/8] bits/syscall.h: add cachestat from linux v6.4 Gaël PORTAY
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: Gaël PORTAY @ 2024-02-18  2:26 UTC (permalink / raw)
  To: musl; +Cc: Gaël PORTAY

see

    linux commit c6018b4b254971863bd0ad36bb5e7d0fa0f0ddb0
    mm/mempolicy: add set_mempolicy_home_node syscall

    linux commit 21b084fdf2a49ca1634e8e360e9ab6f9ff0dee11
    mm/mempolicy: wire up syscall set_mempolicy_home_node
---
 arch/aarch64/bits/syscall.h.in    | 1 +
 arch/arm/bits/syscall.h.in        | 1 +
 arch/i386/bits/syscall.h.in       | 1 +
 arch/m68k/bits/syscall.h.in       | 1 +
 arch/microblaze/bits/syscall.h.in | 1 +
 arch/mips/bits/syscall.h.in       | 1 +
 arch/mips64/bits/syscall.h.in     | 1 +
 arch/mipsn32/bits/syscall.h.in    | 1 +
 arch/or1k/bits/syscall.h.in       | 1 +
 arch/powerpc/bits/syscall.h.in    | 1 +
 arch/powerpc64/bits/syscall.h.in  | 1 +
 arch/riscv64/bits/syscall.h.in    | 1 +
 arch/s390x/bits/syscall.h.in      | 1 +
 arch/sh/bits/syscall.h.in         | 1 +
 arch/x32/bits/syscall.h.in        | 1 +
 arch/x86_64/bits/syscall.h.in     | 1 +
 16 files changed, 16 insertions(+)

diff --git a/arch/aarch64/bits/syscall.h.in b/arch/aarch64/bits/syscall.h.in
index fc646f0e..9645daca 100644
--- a/arch/aarch64/bits/syscall.h.in
+++ b/arch/aarch64/bits/syscall.h.in
@@ -302,4 +302,5 @@
 // reserved for memfd_secret	447
 #define __NR_process_mrelease	448
 #define __NR_futex_waitv	449
+#define __NR_set_mempolicy_home_node	450
 
diff --git a/arch/arm/bits/syscall.h.in b/arch/arm/bits/syscall.h.in
index ec40e0b9..e77ba3f7 100644
--- a/arch/arm/bits/syscall.h.in
+++ b/arch/arm/bits/syscall.h.in
@@ -402,6 +402,7 @@
 // reserved for memfd_secret	447
 #define __NR_process_mrelease	448
 #define __NR_futex_waitv	449
+#define __NR_set_mempolicy_home_node	450
 
 #define __ARM_NR_breakpoint	0x0f0001
 #define __ARM_NR_cacheflush	0x0f0002
diff --git a/arch/i386/bits/syscall.h.in b/arch/i386/bits/syscall.h.in
index 907b5641..a2c40786 100644
--- a/arch/i386/bits/syscall.h.in
+++ b/arch/i386/bits/syscall.h.in
@@ -439,4 +439,5 @@
 #define __NR_memfd_secret	447
 #define __NR_process_mrelease	448
 #define __NR_futex_waitv	449
+#define __NR_set_mempolicy_home_node	450
 
diff --git a/arch/m68k/bits/syscall.h.in b/arch/m68k/bits/syscall.h.in
index e545c68d..5cdd3a39 100644
--- a/arch/m68k/bits/syscall.h.in
+++ b/arch/m68k/bits/syscall.h.in
@@ -419,3 +419,4 @@
 // reserved for memfd_secret	447
 #define __NR_process_mrelease	448
 #define __NR_futex_waitv	449
+#define __NR_set_mempolicy_home_node	450
diff --git a/arch/microblaze/bits/syscall.h.in b/arch/microblaze/bits/syscall.h.in
index 2396aed3..e221a4a6 100644
--- a/arch/microblaze/bits/syscall.h.in
+++ b/arch/microblaze/bits/syscall.h.in
@@ -440,4 +440,5 @@
 // reserved for memfd_secret	447
 #define __NR_process_mrelease	448
 #define __NR_futex_waitv	449
+#define __NR_set_mempolicy_home_node	450
 
diff --git a/arch/mips/bits/syscall.h.in b/arch/mips/bits/syscall.h.in
index 85fbbb4e..591f162c 100644
--- a/arch/mips/bits/syscall.h.in
+++ b/arch/mips/bits/syscall.h.in
@@ -421,4 +421,5 @@
 // reserved for memfd_secret	4447
 #define __NR_process_mrelease	4448
 #define __NR_futex_waitv	4449
+#define __NR_set_mempolicy_home_node	4450
 
diff --git a/arch/mips64/bits/syscall.h.in b/arch/mips64/bits/syscall.h.in
index a841c24a..c579161e 100644
--- a/arch/mips64/bits/syscall.h.in
+++ b/arch/mips64/bits/syscall.h.in
@@ -351,4 +351,5 @@
 // reserved for memfd_secret	5447
 #define __NR_process_mrelease	5448
 #define __NR_futex_waitv	5449
+#define __NR_set_mempolicy_home_node	5450
 
diff --git a/arch/mipsn32/bits/syscall.h.in b/arch/mipsn32/bits/syscall.h.in
index a2f2b55e..1afecd90 100644
--- a/arch/mipsn32/bits/syscall.h.in
+++ b/arch/mipsn32/bits/syscall.h.in
@@ -375,4 +375,5 @@
 // reserved for memfd_secret	6447
 #define __NR_process_mrelease	6448
 #define __NR_futex_waitv	6449
+#define __NR_set_mempolicy_home_node	6450
 
diff --git a/arch/or1k/bits/syscall.h.in b/arch/or1k/bits/syscall.h.in
index f4000e43..067d04f9 100644
--- a/arch/or1k/bits/syscall.h.in
+++ b/arch/or1k/bits/syscall.h.in
@@ -324,4 +324,5 @@
 // reserved for memfd_secret	447
 #define __NR_process_mrelease	448
 #define __NR_futex_waitv	449
+#define __NR_set_mempolicy_home_node	450
 
diff --git a/arch/powerpc/bits/syscall.h.in b/arch/powerpc/bits/syscall.h.in
index cc1c06a4..3da78244 100644
--- a/arch/powerpc/bits/syscall.h.in
+++ b/arch/powerpc/bits/syscall.h.in
@@ -428,4 +428,5 @@
 // reserved for memfd_secret	447
 #define __NR_process_mrelease	448
 #define __NR_futex_waitv	449
+#define __NR_set_mempolicy_home_node	450
 
diff --git a/arch/powerpc64/bits/syscall.h.in b/arch/powerpc64/bits/syscall.h.in
index b96285f9..a6e04d97 100644
--- a/arch/powerpc64/bits/syscall.h.in
+++ b/arch/powerpc64/bits/syscall.h.in
@@ -400,4 +400,5 @@
 // reserved for memfd_secret	447
 #define __NR_process_mrelease	448
 #define __NR_futex_waitv	449
+#define __NR_set_mempolicy_home_node	450
 
diff --git a/arch/riscv64/bits/syscall.h.in b/arch/riscv64/bits/syscall.h.in
index 4f6d2a0b..be9e401f 100644
--- a/arch/riscv64/bits/syscall.h.in
+++ b/arch/riscv64/bits/syscall.h.in
@@ -302,6 +302,7 @@
 // reserved for memfd_secret	447
 #define __NR_process_mrelease	448
 #define __NR_futex_waitv	449
+#define __NR_set_mempolicy_home_node	450
 
 #define __NR_sysriscv __NR_arch_specific_syscall
 #define __NR_riscv_flush_icache (__NR_sysriscv + 15)
diff --git a/arch/s390x/bits/syscall.h.in b/arch/s390x/bits/syscall.h.in
index 0de01875..e0425f54 100644
--- a/arch/s390x/bits/syscall.h.in
+++ b/arch/s390x/bits/syscall.h.in
@@ -365,4 +365,5 @@
 #define __NR_memfd_secret	447
 #define __NR_process_mrelease	448
 #define __NR_futex_waitv	449
+#define __NR_set_mempolicy_home_node	450
 
diff --git a/arch/sh/bits/syscall.h.in b/arch/sh/bits/syscall.h.in
index 49853899..79c4d365 100644
--- a/arch/sh/bits/syscall.h.in
+++ b/arch/sh/bits/syscall.h.in
@@ -412,4 +412,5 @@
 // reserved for memfd_secret	447
 #define __NR_process_mrelease	448
 #define __NR_futex_waitv	449
+#define __NR_set_mempolicy_home_node	450
 
diff --git a/arch/x32/bits/syscall.h.in b/arch/x32/bits/syscall.h.in
index 5390db02..8a2cf7b0 100644
--- a/arch/x32/bits/syscall.h.in
+++ b/arch/x32/bits/syscall.h.in
@@ -311,6 +311,7 @@
 #define __NR_memfd_secret	(0x40000000 + 447)
 #define __NR_process_mrelease	(0x40000000 + 448)
 #define __NR_futex_waitv	(0x40000000 + 449)
+#define __NR_set_mempolicy_home_node	(0x40000000 + 450)
 
 
 #define __NR_rt_sigaction (0x40000000 + 512)
diff --git a/arch/x86_64/bits/syscall.h.in b/arch/x86_64/bits/syscall.h.in
index f566d52d..439b2bfa 100644
--- a/arch/x86_64/bits/syscall.h.in
+++ b/arch/x86_64/bits/syscall.h.in
@@ -358,4 +358,5 @@
 #define __NR_memfd_secret	447
 #define __NR_process_mrelease	448
 #define __NR_futex_waitv	449
+#define __NR_set_mempolicy_home_node	450
 
-- 
2.43.2


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

* [musl] [PATCH v2 5/8] bits/syscall.h: add cachestat from linux v6.4
  2024-02-18  2:26 [musl] [PATCH v2 0/8] use new SYS_fchmodat2 syscall to implement fchmodat with flags Gaël PORTAY
                   ` (3 preceding siblings ...)
  2024-02-18  2:26 ` [musl] [PATCH v2 4/8] bits/syscall.h: add set_mempolicy_home_node from linux v5.17 Gaël PORTAY
@ 2024-02-18  2:26 ` Gaël PORTAY
  2024-02-18  2:26 ` [musl] [PATCH v2 6/8] remove flag argument from fchmodat syscall Gaël PORTAY
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: Gaël PORTAY @ 2024-02-18  2:26 UTC (permalink / raw)
  To: musl; +Cc: Gaël PORTAY

see

    linux commit cf264e1329fb0307e044f7675849f9f38b44c11a
    cachestat: implement cachestat syscall

    linux commit 946e697c69ffeeefdd84dad90eac307284df46be
    cachestat: wire up cachestat for other architectures
---
 arch/aarch64/bits/syscall.h.in    | 1 +
 arch/arm/bits/syscall.h.in        | 1 +
 arch/i386/bits/syscall.h.in       | 1 +
 arch/m68k/bits/syscall.h.in       | 1 +
 arch/microblaze/bits/syscall.h.in | 1 +
 arch/mips/bits/syscall.h.in       | 1 +
 arch/mips64/bits/syscall.h.in     | 1 +
 arch/mipsn32/bits/syscall.h.in    | 1 +
 arch/or1k/bits/syscall.h.in       | 1 +
 arch/powerpc/bits/syscall.h.in    | 1 +
 arch/powerpc64/bits/syscall.h.in  | 1 +
 arch/riscv64/bits/syscall.h.in    | 1 +
 arch/s390x/bits/syscall.h.in      | 1 +
 arch/sh/bits/syscall.h.in         | 1 +
 arch/x32/bits/syscall.h.in        | 1 +
 arch/x86_64/bits/syscall.h.in     | 1 +
 16 files changed, 16 insertions(+)

diff --git a/arch/aarch64/bits/syscall.h.in b/arch/aarch64/bits/syscall.h.in
index 9645daca..f2ea0cbe 100644
--- a/arch/aarch64/bits/syscall.h.in
+++ b/arch/aarch64/bits/syscall.h.in
@@ -303,4 +303,5 @@
 #define __NR_process_mrelease	448
 #define __NR_futex_waitv	449
 #define __NR_set_mempolicy_home_node	450
+#define __NR_cachestat		451
 
diff --git a/arch/arm/bits/syscall.h.in b/arch/arm/bits/syscall.h.in
index e77ba3f7..ccc023ed 100644
--- a/arch/arm/bits/syscall.h.in
+++ b/arch/arm/bits/syscall.h.in
@@ -403,6 +403,7 @@
 #define __NR_process_mrelease	448
 #define __NR_futex_waitv	449
 #define __NR_set_mempolicy_home_node	450
+#define __NR_cachestat		451
 
 #define __ARM_NR_breakpoint	0x0f0001
 #define __ARM_NR_cacheflush	0x0f0002
diff --git a/arch/i386/bits/syscall.h.in b/arch/i386/bits/syscall.h.in
index a2c40786..f11dbac3 100644
--- a/arch/i386/bits/syscall.h.in
+++ b/arch/i386/bits/syscall.h.in
@@ -440,4 +440,5 @@
 #define __NR_process_mrelease	448
 #define __NR_futex_waitv	449
 #define __NR_set_mempolicy_home_node	450
+#define __NR_cachestat		451
 
diff --git a/arch/m68k/bits/syscall.h.in b/arch/m68k/bits/syscall.h.in
index 5cdd3a39..d8f799e0 100644
--- a/arch/m68k/bits/syscall.h.in
+++ b/arch/m68k/bits/syscall.h.in
@@ -420,3 +420,4 @@
 #define __NR_process_mrelease	448
 #define __NR_futex_waitv	449
 #define __NR_set_mempolicy_home_node	450
+#define __NR_cachestat		451
diff --git a/arch/microblaze/bits/syscall.h.in b/arch/microblaze/bits/syscall.h.in
index e221a4a6..1b4bad8c 100644
--- a/arch/microblaze/bits/syscall.h.in
+++ b/arch/microblaze/bits/syscall.h.in
@@ -441,4 +441,5 @@
 #define __NR_process_mrelease	448
 #define __NR_futex_waitv	449
 #define __NR_set_mempolicy_home_node	450
+#define __NR_cachestat		451
 
diff --git a/arch/mips/bits/syscall.h.in b/arch/mips/bits/syscall.h.in
index 591f162c..a7b6b21c 100644
--- a/arch/mips/bits/syscall.h.in
+++ b/arch/mips/bits/syscall.h.in
@@ -422,4 +422,5 @@
 #define __NR_process_mrelease	4448
 #define __NR_futex_waitv	4449
 #define __NR_set_mempolicy_home_node	4450
+#define __NR_cachestat		4451
 
diff --git a/arch/mips64/bits/syscall.h.in b/arch/mips64/bits/syscall.h.in
index c579161e..09198a79 100644
--- a/arch/mips64/bits/syscall.h.in
+++ b/arch/mips64/bits/syscall.h.in
@@ -352,4 +352,5 @@
 #define __NR_process_mrelease	5448
 #define __NR_futex_waitv	5449
 #define __NR_set_mempolicy_home_node	5450
+#define __NR_cachestat		5451
 
diff --git a/arch/mipsn32/bits/syscall.h.in b/arch/mipsn32/bits/syscall.h.in
index 1afecd90..0aa50518 100644
--- a/arch/mipsn32/bits/syscall.h.in
+++ b/arch/mipsn32/bits/syscall.h.in
@@ -376,4 +376,5 @@
 #define __NR_process_mrelease	6448
 #define __NR_futex_waitv	6449
 #define __NR_set_mempolicy_home_node	6450
+#define __NR_cachestat		6451
 
diff --git a/arch/or1k/bits/syscall.h.in b/arch/or1k/bits/syscall.h.in
index 067d04f9..5279d3db 100644
--- a/arch/or1k/bits/syscall.h.in
+++ b/arch/or1k/bits/syscall.h.in
@@ -325,4 +325,5 @@
 #define __NR_process_mrelease	448
 #define __NR_futex_waitv	449
 #define __NR_set_mempolicy_home_node	450
+#define __NR_cachestat		451
 
diff --git a/arch/powerpc/bits/syscall.h.in b/arch/powerpc/bits/syscall.h.in
index 3da78244..39564a1b 100644
--- a/arch/powerpc/bits/syscall.h.in
+++ b/arch/powerpc/bits/syscall.h.in
@@ -429,4 +429,5 @@
 #define __NR_process_mrelease	448
 #define __NR_futex_waitv	449
 #define __NR_set_mempolicy_home_node	450
+#define __NR_cachestat		451
 
diff --git a/arch/powerpc64/bits/syscall.h.in b/arch/powerpc64/bits/syscall.h.in
index a6e04d97..e08f264e 100644
--- a/arch/powerpc64/bits/syscall.h.in
+++ b/arch/powerpc64/bits/syscall.h.in
@@ -401,4 +401,5 @@
 #define __NR_process_mrelease	448
 #define __NR_futex_waitv	449
 #define __NR_set_mempolicy_home_node	450
+#define __NR_cachestat		451
 
diff --git a/arch/riscv64/bits/syscall.h.in b/arch/riscv64/bits/syscall.h.in
index be9e401f..dbe05739 100644
--- a/arch/riscv64/bits/syscall.h.in
+++ b/arch/riscv64/bits/syscall.h.in
@@ -303,6 +303,7 @@
 #define __NR_process_mrelease	448
 #define __NR_futex_waitv	449
 #define __NR_set_mempolicy_home_node	450
+#define __NR_cachestat		451
 
 #define __NR_sysriscv __NR_arch_specific_syscall
 #define __NR_riscv_flush_icache (__NR_sysriscv + 15)
diff --git a/arch/s390x/bits/syscall.h.in b/arch/s390x/bits/syscall.h.in
index e0425f54..21577df5 100644
--- a/arch/s390x/bits/syscall.h.in
+++ b/arch/s390x/bits/syscall.h.in
@@ -366,4 +366,5 @@
 #define __NR_process_mrelease	448
 #define __NR_futex_waitv	449
 #define __NR_set_mempolicy_home_node	450
+#define __NR_cachestat		451
 
diff --git a/arch/sh/bits/syscall.h.in b/arch/sh/bits/syscall.h.in
index 79c4d365..da02e9c9 100644
--- a/arch/sh/bits/syscall.h.in
+++ b/arch/sh/bits/syscall.h.in
@@ -413,4 +413,5 @@
 #define __NR_process_mrelease	448
 #define __NR_futex_waitv	449
 #define __NR_set_mempolicy_home_node	450
+#define __NR_cachestat		451
 
diff --git a/arch/x32/bits/syscall.h.in b/arch/x32/bits/syscall.h.in
index 8a2cf7b0..d239c587 100644
--- a/arch/x32/bits/syscall.h.in
+++ b/arch/x32/bits/syscall.h.in
@@ -312,6 +312,7 @@
 #define __NR_process_mrelease	(0x40000000 + 448)
 #define __NR_futex_waitv	(0x40000000 + 449)
 #define __NR_set_mempolicy_home_node	(0x40000000 + 450)
+#define __NR_cachestat		(0x40000000 + 451)
 
 
 #define __NR_rt_sigaction (0x40000000 + 512)
diff --git a/arch/x86_64/bits/syscall.h.in b/arch/x86_64/bits/syscall.h.in
index 439b2bfa..0067d33b 100644
--- a/arch/x86_64/bits/syscall.h.in
+++ b/arch/x86_64/bits/syscall.h.in
@@ -359,4 +359,5 @@
 #define __NR_process_mrelease	448
 #define __NR_futex_waitv	449
 #define __NR_set_mempolicy_home_node	450
+#define __NR_cachestat		451
 
-- 
2.43.2


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

* [musl] [PATCH v2 6/8] remove flag argument from fchmodat syscall
  2024-02-18  2:26 [musl] [PATCH v2 0/8] use new SYS_fchmodat2 syscall to implement fchmodat with flags Gaël PORTAY
                   ` (4 preceding siblings ...)
  2024-02-18  2:26 ` [musl] [PATCH v2 5/8] bits/syscall.h: add cachestat from linux v6.4 Gaël PORTAY
@ 2024-02-18  2:26 ` Gaël PORTAY
  2024-02-18  2:26 ` [musl] [PATCH v2 7/8] bits/syscall.h: add __NR_fchmodat2 from linux v6.6 Gaël PORTAY
  2024-02-18  2:26 ` [musl] [PATCH v2 8/8] use new SYS_fchmodat2 syscall to implement fchmodat with flags Gaël PORTAY
  7 siblings, 0 replies; 11+ messages in thread
From: Gaël PORTAY @ 2024-02-18  2:26 UTC (permalink / raw)
  To: musl; +Cc: Gaël PORTAY

linux's does not have the flag argument for fchmodat syscall.
---
 src/stat/fchmodat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/stat/fchmodat.c b/src/stat/fchmodat.c
index bc581050..41db0c46 100644
--- a/src/stat/fchmodat.c
+++ b/src/stat/fchmodat.c
@@ -5,7 +5,7 @@
 
 int fchmodat(int fd, const char *path, mode_t mode, int flag)
 {
-	if (!flag) return syscall(SYS_fchmodat, fd, path, mode, flag);
+	if (!flag) return syscall(SYS_fchmodat, fd, path, mode);
 
 	if (flag != AT_SYMLINK_NOFOLLOW)
 		return __syscall_ret(-EINVAL);
-- 
2.43.2


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

* [musl] [PATCH v2 7/8] bits/syscall.h: add __NR_fchmodat2 from linux v6.6
  2024-02-18  2:26 [musl] [PATCH v2 0/8] use new SYS_fchmodat2 syscall to implement fchmodat with flags Gaël PORTAY
                   ` (5 preceding siblings ...)
  2024-02-18  2:26 ` [musl] [PATCH v2 6/8] remove flag argument from fchmodat syscall Gaël PORTAY
@ 2024-02-18  2:26 ` Gaël PORTAY
  2024-02-18  2:26 ` [musl] [PATCH v2 8/8] use new SYS_fchmodat2 syscall to implement fchmodat with flags Gaël PORTAY
  7 siblings, 0 replies; 11+ messages in thread
From: Gaël PORTAY @ 2024-02-18  2:26 UTC (permalink / raw)
  To: musl; +Cc: Gaël PORTAY

the linux fchmodat syscall lacks a flag argument that is necessary to
implement the posix api, see

  linux commit 09da082b07bbae1c11d9560c8502800039aebcea
  fs: Add fchmodat2()

  linux commit 78252deb023cf0879256fcfbafe37022c390762b
  arch: Register fchmodat2, usually as syscall 452
---
 arch/aarch64/bits/syscall.h.in    | 1 +
 arch/arm/bits/syscall.h.in        | 1 +
 arch/i386/bits/syscall.h.in       | 1 +
 arch/m68k/bits/syscall.h.in       | 1 +
 arch/microblaze/bits/syscall.h.in | 1 +
 arch/mips/bits/syscall.h.in       | 1 +
 arch/mips64/bits/syscall.h.in     | 1 +
 arch/mipsn32/bits/syscall.h.in    | 1 +
 arch/or1k/bits/syscall.h.in       | 1 +
 arch/powerpc/bits/syscall.h.in    | 1 +
 arch/powerpc64/bits/syscall.h.in  | 1 +
 arch/riscv64/bits/syscall.h.in    | 1 +
 arch/s390x/bits/syscall.h.in      | 1 +
 arch/sh/bits/syscall.h.in         | 1 +
 arch/x32/bits/syscall.h.in        | 1 +
 arch/x86_64/bits/syscall.h.in     | 1 +
 16 files changed, 16 insertions(+)

diff --git a/arch/aarch64/bits/syscall.h.in b/arch/aarch64/bits/syscall.h.in
index f2ea0cbe..7ee0b8c6 100644
--- a/arch/aarch64/bits/syscall.h.in
+++ b/arch/aarch64/bits/syscall.h.in
@@ -304,4 +304,5 @@
 #define __NR_futex_waitv	449
 #define __NR_set_mempolicy_home_node	450
 #define __NR_cachestat		451
+#define __NR_fchmodat2		452
 
diff --git a/arch/arm/bits/syscall.h.in b/arch/arm/bits/syscall.h.in
index ccc023ed..138397b2 100644
--- a/arch/arm/bits/syscall.h.in
+++ b/arch/arm/bits/syscall.h.in
@@ -404,6 +404,7 @@
 #define __NR_futex_waitv	449
 #define __NR_set_mempolicy_home_node	450
 #define __NR_cachestat		451
+#define __NR_fchmodat2		452
 
 #define __ARM_NR_breakpoint	0x0f0001
 #define __ARM_NR_cacheflush	0x0f0002
diff --git a/arch/i386/bits/syscall.h.in b/arch/i386/bits/syscall.h.in
index f11dbac3..55e91cc4 100644
--- a/arch/i386/bits/syscall.h.in
+++ b/arch/i386/bits/syscall.h.in
@@ -441,4 +441,5 @@
 #define __NR_futex_waitv	449
 #define __NR_set_mempolicy_home_node	450
 #define __NR_cachestat		451
+#define __NR_fchmodat2		452
 
diff --git a/arch/m68k/bits/syscall.h.in b/arch/m68k/bits/syscall.h.in
index d8f799e0..d41268c7 100644
--- a/arch/m68k/bits/syscall.h.in
+++ b/arch/m68k/bits/syscall.h.in
@@ -421,3 +421,4 @@
 #define __NR_futex_waitv	449
 #define __NR_set_mempolicy_home_node	450
 #define __NR_cachestat		451
+#define __NR_fchmodat2		452
diff --git a/arch/microblaze/bits/syscall.h.in b/arch/microblaze/bits/syscall.h.in
index 1b4bad8c..8793e0b7 100644
--- a/arch/microblaze/bits/syscall.h.in
+++ b/arch/microblaze/bits/syscall.h.in
@@ -442,4 +442,5 @@
 #define __NR_futex_waitv	449
 #define __NR_set_mempolicy_home_node	450
 #define __NR_cachestat		451
+#define __NR_fchmodat2		452
 
diff --git a/arch/mips/bits/syscall.h.in b/arch/mips/bits/syscall.h.in
index a7b6b21c..b2a75ac8 100644
--- a/arch/mips/bits/syscall.h.in
+++ b/arch/mips/bits/syscall.h.in
@@ -423,4 +423,5 @@
 #define __NR_futex_waitv	4449
 #define __NR_set_mempolicy_home_node	4450
 #define __NR_cachestat		4451
+#define __NR_fchmodat2		4452
 
diff --git a/arch/mips64/bits/syscall.h.in b/arch/mips64/bits/syscall.h.in
index 09198a79..89babd12 100644
--- a/arch/mips64/bits/syscall.h.in
+++ b/arch/mips64/bits/syscall.h.in
@@ -353,4 +353,5 @@
 #define __NR_futex_waitv	5449
 #define __NR_set_mempolicy_home_node	5450
 #define __NR_cachestat		5451
+#define __NR_fchmodat2		5452
 
diff --git a/arch/mipsn32/bits/syscall.h.in b/arch/mipsn32/bits/syscall.h.in
index 0aa50518..f82e7c67 100644
--- a/arch/mipsn32/bits/syscall.h.in
+++ b/arch/mipsn32/bits/syscall.h.in
@@ -377,4 +377,5 @@
 #define __NR_futex_waitv	6449
 #define __NR_set_mempolicy_home_node	6450
 #define __NR_cachestat		6451
+#define __NR_fchmodat2		6452
 
diff --git a/arch/or1k/bits/syscall.h.in b/arch/or1k/bits/syscall.h.in
index 5279d3db..edb65b21 100644
--- a/arch/or1k/bits/syscall.h.in
+++ b/arch/or1k/bits/syscall.h.in
@@ -326,4 +326,5 @@
 #define __NR_futex_waitv	449
 #define __NR_set_mempolicy_home_node	450
 #define __NR_cachestat		451
+#define __NR_fchmodat2		452
 
diff --git a/arch/powerpc/bits/syscall.h.in b/arch/powerpc/bits/syscall.h.in
index 39564a1b..0315ea1d 100644
--- a/arch/powerpc/bits/syscall.h.in
+++ b/arch/powerpc/bits/syscall.h.in
@@ -430,4 +430,5 @@
 #define __NR_futex_waitv	449
 #define __NR_set_mempolicy_home_node	450
 #define __NR_cachestat		451
+#define __NR_fchmodat2		452
 
diff --git a/arch/powerpc64/bits/syscall.h.in b/arch/powerpc64/bits/syscall.h.in
index e08f264e..8b3e3b0b 100644
--- a/arch/powerpc64/bits/syscall.h.in
+++ b/arch/powerpc64/bits/syscall.h.in
@@ -402,4 +402,5 @@
 #define __NR_futex_waitv	449
 #define __NR_set_mempolicy_home_node	450
 #define __NR_cachestat		451
+#define __NR_fchmodat2		452
 
diff --git a/arch/riscv64/bits/syscall.h.in b/arch/riscv64/bits/syscall.h.in
index dbe05739..83c5036c 100644
--- a/arch/riscv64/bits/syscall.h.in
+++ b/arch/riscv64/bits/syscall.h.in
@@ -304,6 +304,7 @@
 #define __NR_futex_waitv	449
 #define __NR_set_mempolicy_home_node	450
 #define __NR_cachestat		451
+#define __NR_fchmodat2		452
 
 #define __NR_sysriscv __NR_arch_specific_syscall
 #define __NR_riscv_flush_icache (__NR_sysriscv + 15)
diff --git a/arch/s390x/bits/syscall.h.in b/arch/s390x/bits/syscall.h.in
index 21577df5..e60711a6 100644
--- a/arch/s390x/bits/syscall.h.in
+++ b/arch/s390x/bits/syscall.h.in
@@ -367,4 +367,5 @@
 #define __NR_futex_waitv	449
 #define __NR_set_mempolicy_home_node	450
 #define __NR_cachestat		451
+#define __NR_fchmodat2		452
 
diff --git a/arch/sh/bits/syscall.h.in b/arch/sh/bits/syscall.h.in
index da02e9c9..7022331a 100644
--- a/arch/sh/bits/syscall.h.in
+++ b/arch/sh/bits/syscall.h.in
@@ -414,4 +414,5 @@
 #define __NR_futex_waitv	449
 #define __NR_set_mempolicy_home_node	450
 #define __NR_cachestat		451
+#define __NR_fchmodat2		452
 
diff --git a/arch/x32/bits/syscall.h.in b/arch/x32/bits/syscall.h.in
index d239c587..1d065eea 100644
--- a/arch/x32/bits/syscall.h.in
+++ b/arch/x32/bits/syscall.h.in
@@ -313,6 +313,7 @@
 #define __NR_futex_waitv	(0x40000000 + 449)
 #define __NR_set_mempolicy_home_node	(0x40000000 + 450)
 #define __NR_cachestat		(0x40000000 + 451)
+#define __NR_fchmodat2		(0x40000000 + 452)
 
 
 #define __NR_rt_sigaction (0x40000000 + 512)
diff --git a/arch/x86_64/bits/syscall.h.in b/arch/x86_64/bits/syscall.h.in
index 0067d33b..6543bbba 100644
--- a/arch/x86_64/bits/syscall.h.in
+++ b/arch/x86_64/bits/syscall.h.in
@@ -360,4 +360,5 @@
 #define __NR_futex_waitv	449
 #define __NR_set_mempolicy_home_node	450
 #define __NR_cachestat		451
+#define __NR_fchmodat2		452
 
-- 
2.43.2


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

* [musl] [PATCH v2 8/8] use new SYS_fchmodat2 syscall to implement fchmodat with flags
  2024-02-18  2:26 [musl] [PATCH v2 0/8] use new SYS_fchmodat2 syscall to implement fchmodat with flags Gaël PORTAY
                   ` (6 preceding siblings ...)
  2024-02-18  2:26 ` [musl] [PATCH v2 7/8] bits/syscall.h: add __NR_fchmodat2 from linux v6.6 Gaël PORTAY
@ 2024-02-18  2:26 ` Gaël PORTAY
  2024-02-23  0:36   ` Rich Felker
  7 siblings, 1 reply; 11+ messages in thread
From: Gaël PORTAY @ 2024-02-18  2:26 UTC (permalink / raw)
  To: musl; +Cc: Gaël PORTAY

commit 0dc4824479e357a3e23a02d35527e23fca920343 worked around for lack
of flags argument in syscall for fchmodat.

linux 6.6 introduced a new syscall, SYS_fchmodat2, fixing this
deficiency. use it if any flags are passed, and fallback to the old
strategy on ENOSYS. continue using the old syscall when there are no
flags. this is the exact same strategy used when SYS_faccessat2 was used
to implement faccessat with flags.
---
 src/stat/fchmodat.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/stat/fchmodat.c b/src/stat/fchmodat.c
index 41db0c46..a3f407e3 100644
--- a/src/stat/fchmodat.c
+++ b/src/stat/fchmodat.c
@@ -5,6 +5,11 @@
 
 int fchmodat(int fd, const char *path, mode_t mode, int flag)
 {
+	if (flag) {
+		int ret = __syscall(SYS_fchmodat2, fd, path, mode, flag);
+		if (ret != -ENOSYS) return __syscall_ret(ret);
+	}
+
 	if (!flag) return syscall(SYS_fchmodat, fd, path, mode);
 
 	if (flag != AT_SYMLINK_NOFOLLOW)
-- 
2.43.2


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

* Re: [musl] [PATCH v2 1/8] bits/syscall.h: add process_madvise from linux v5.14
  2024-02-18  2:26 ` [musl] [PATCH v2 1/8] bits/syscall.h: add process_madvise from linux v5.14 Gaël PORTAY
@ 2024-02-23  0:32   ` Rich Felker
  0 siblings, 0 replies; 11+ messages in thread
From: Rich Felker @ 2024-02-23  0:32 UTC (permalink / raw)
  To: Gaël PORTAY; +Cc: musl

On Sun, Feb 18, 2024 at 03:26:43AM +0100, Gaël PORTAY wrote:
> see
> 
>     linux commit 7bb7f2ac24a028b20fca466b9633847b289b156a
>     arch, mm: wire up memfd_secret system call where relevant
> 
>     linux commit 1507f51255c9ff07d75909a84e7c0d7f3c4b2f49
>     mm: introduce memfd_secret system call to create "secret" memory areas
> 
>     linux commit b633896314c0f78f2b4eb7b19a530d68f2a35445
>     tools headers UAPI: Sync s390 syscall table file that wires up the memfd_secret syscall
> ---
>  arch/aarch64/bits/syscall.h.in    | 1 +
>  arch/arm/bits/syscall.h.in        | 1 +
>  arch/i386/bits/syscall.h.in       | 1 +
>  arch/m68k/bits/syscall.h.in       | 1 +
>  arch/microblaze/bits/syscall.h.in | 1 +
>  arch/mips/bits/syscall.h.in       | 1 +
>  arch/mips64/bits/syscall.h.in     | 1 +
>  arch/mipsn32/bits/syscall.h.in    | 1 +
>  arch/or1k/bits/syscall.h.in       | 1 +
>  arch/powerpc/bits/syscall.h.in    | 1 +
>  arch/powerpc64/bits/syscall.h.in  | 1 +
>  arch/riscv64/bits/syscall.h.in    | 1 +
>  arch/s390x/bits/syscall.h.in      | 1 +
>  arch/sh/bits/syscall.h.in         | 1 +
>  arch/x32/bits/syscall.h.in        | 1 +
>  arch/x86_64/bits/syscall.h.in     | 1 +
>  16 files changed, 16 insertions(+)
> 
> diff --git a/arch/aarch64/bits/syscall.h.in b/arch/aarch64/bits/syscall.h.in
> index 5f420e61..88512ec9 100644
> --- a/arch/aarch64/bits/syscall.h.in
> +++ b/arch/aarch64/bits/syscall.h.in
> @@ -299,4 +299,5 @@
>  #define __NR_landlock_create_ruleset	444
>  #define __NR_landlock_add_rule	445
>  #define __NR_landlock_restrict_self	446
> +// reserved for memfd_secret	447
> [...]

This patch seems mistitled, and should avoid introducing comments
(especially // form which are c89-incompatible) into an installed
header. I've renamed it to:

"bits/syscall.h: add memfd_secret from linux v5.14"

and removed the comments.

(No need to resubmit)

Rich

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

* Re: [musl] [PATCH v2 8/8] use new SYS_fchmodat2 syscall to implement fchmodat with flags
  2024-02-18  2:26 ` [musl] [PATCH v2 8/8] use new SYS_fchmodat2 syscall to implement fchmodat with flags Gaël PORTAY
@ 2024-02-23  0:36   ` Rich Felker
  0 siblings, 0 replies; 11+ messages in thread
From: Rich Felker @ 2024-02-23  0:36 UTC (permalink / raw)
  To: Gaël PORTAY; +Cc: musl

On Sun, Feb 18, 2024 at 03:26:50AM +0100, Gaël PORTAY wrote:
> commit 0dc4824479e357a3e23a02d35527e23fca920343 worked around for lack
> of flags argument in syscall for fchmodat.
> 
> linux 6.6 introduced a new syscall, SYS_fchmodat2, fixing this
> deficiency. use it if any flags are passed, and fallback to the old
> strategy on ENOSYS. continue using the old syscall when there are no
> flags. this is the exact same strategy used when SYS_faccessat2 was used
> to implement faccessat with flags.
> ---
>  src/stat/fchmodat.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/src/stat/fchmodat.c b/src/stat/fchmodat.c
> index 41db0c46..a3f407e3 100644
> --- a/src/stat/fchmodat.c
> +++ b/src/stat/fchmodat.c
> @@ -5,6 +5,11 @@
>  
>  int fchmodat(int fd, const char *path, mode_t mode, int flag)
>  {
> +	if (flag) {
> +		int ret = __syscall(SYS_fchmodat2, fd, path, mode, flag);
> +		if (ret != -ENOSYS) return __syscall_ret(ret);
> +	}
> +
>  	if (!flag) return syscall(SYS_fchmodat, fd, path, mode);
>  
>  	if (flag != AT_SYMLINK_NOFOLLOW)
> -- 
> 2.43.2

I've reordered this to avoid confusing repeating conditionals, so it's
now:

	if (!flag) return syscall(SYS_fchmodat, fd, path, mode);

+       int ret = __syscall(SYS_fchmodat2, fd, path, mode, flag);
+       if (ret != -ENOSYS) return __syscall_ret(ret);

...

(with the later declaration of ret removed).

Thanks for getting these patches in to make it into the release!

Rich

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

end of thread, other threads:[~2024-02-23  0:36 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-18  2:26 [musl] [PATCH v2 0/8] use new SYS_fchmodat2 syscall to implement fchmodat with flags Gaël PORTAY
2024-02-18  2:26 ` [musl] [PATCH v2 1/8] bits/syscall.h: add process_madvise from linux v5.14 Gaël PORTAY
2024-02-23  0:32   ` Rich Felker
2024-02-18  2:26 ` [musl] [PATCH v2 2/8] bits/syscall.h: add process_mrelease from linux v5.15 Gaël PORTAY
2024-02-18  2:26 ` [musl] [PATCH v2 3/8] bits/syscall.h: add futex_waitv from linux v5.16 Gaël PORTAY
2024-02-18  2:26 ` [musl] [PATCH v2 4/8] bits/syscall.h: add set_mempolicy_home_node from linux v5.17 Gaël PORTAY
2024-02-18  2:26 ` [musl] [PATCH v2 5/8] bits/syscall.h: add cachestat from linux v6.4 Gaël PORTAY
2024-02-18  2:26 ` [musl] [PATCH v2 6/8] remove flag argument from fchmodat syscall Gaël PORTAY
2024-02-18  2:26 ` [musl] [PATCH v2 7/8] bits/syscall.h: add __NR_fchmodat2 from linux v6.6 Gaël PORTAY
2024-02-18  2:26 ` [musl] [PATCH v2 8/8] use new SYS_fchmodat2 syscall to implement fchmodat with flags Gaël PORTAY
2024-02-23  0:36   ` Rich Felker

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).