mailing list of musl libc
 help / color / mirror / code / Atom feed
* [musl] [PATCH 0/3] use new SYS_fchmodat2 syscall to implement fchmodat with flags
@ 2024-01-18  0:05 Gaël PORTAY
  2024-01-18  0:05 ` [musl] [PATCH 1/3] remove flag argument from fchmodat syscall Gaël PORTAY
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Gaël PORTAY @ 2024-01-18  0:05 UTC (permalink / raw)
  To: musl; +Cc: gael.portay

hello,

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

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

the second patch defines the syscall itself in headers.

the third 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!

note: I fails to subscribe to mailing list; please make sure I receive a
copy of any response, I am in cc; sorry for the inconvenience. I hope I
did everything correctly.

regards,
Gaël PORTAY (3):
  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/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 +
 src/stat/fchmodat.c               | 7 ++++++-
 16 files changed, 21 insertions(+), 1 deletion(-)

-- 
2.43.0


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

* [musl] [PATCH 1/3] remove flag argument from fchmodat syscall
  2024-01-18  0:05 [musl] [PATCH 0/3] use new SYS_fchmodat2 syscall to implement fchmodat with flags Gaël PORTAY
@ 2024-01-18  0:05 ` Gaël PORTAY
  2024-01-18  0:05 ` [musl] [PATCH 2/3] bits/syscall.h: add __NR_fchmodat2 from linux v6.6 Gaël PORTAY
  2024-01-18  0:05 ` [musl] [PATCH 3/3] use new SYS_fchmodat2 syscall to implement fchmodat with flags Gaël PORTAY
  2 siblings, 0 replies; 5+ messages in thread
From: Gaël PORTAY @ 2024-01-18  0:05 UTC (permalink / raw)
  To: musl; +Cc: gael.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.0


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

* [musl] [PATCH 2/3] bits/syscall.h: add __NR_fchmodat2 from linux v6.6
  2024-01-18  0:05 [musl] [PATCH 0/3] use new SYS_fchmodat2 syscall to implement fchmodat with flags Gaël PORTAY
  2024-01-18  0:05 ` [musl] [PATCH 1/3] remove flag argument from fchmodat syscall Gaël PORTAY
@ 2024-01-18  0:05 ` Gaël PORTAY
  2024-02-08  2:10   ` Rich Felker
  2024-01-18  0:05 ` [musl] [PATCH 3/3] use new SYS_fchmodat2 syscall to implement fchmodat with flags Gaël PORTAY
  2 siblings, 1 reply; 5+ messages in thread
From: Gaël PORTAY @ 2024-01-18  0:05 UTC (permalink / raw)
  To: musl; +Cc: gael.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/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 +
 15 files changed, 15 insertions(+)

diff --git a/arch/arm/bits/syscall.h.in b/arch/arm/bits/syscall.h.in
index 048fdea7..e5b9ca9d 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
+#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 46ffe1d9..e746d58c 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_fchmodat2		452
 
diff --git a/arch/m68k/bits/syscall.h.in b/arch/m68k/bits/syscall.h.in
index a0c63323..43030eea 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
+#define __NR_fchmodat2		452
diff --git a/arch/microblaze/bits/syscall.h.in b/arch/microblaze/bits/syscall.h.in
index 931d7919..48669e4f 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
+#define __NR_fchmodat2		452
 
diff --git a/arch/mips/bits/syscall.h.in b/arch/mips/bits/syscall.h.in
index 63e3503a..eaba97c6 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
+#define __NR_fchmodat2		4452
 
diff --git a/arch/mips64/bits/syscall.h.in b/arch/mips64/bits/syscall.h.in
index b89965d1..c1f8f399 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
+#define __NR_fchmodat2		5452
 
diff --git a/arch/mipsn32/bits/syscall.h.in b/arch/mipsn32/bits/syscall.h.in
index bb2d04a8..9d952459 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
+#define __NR_fchmodat2		6452
 
diff --git a/arch/or1k/bits/syscall.h.in b/arch/or1k/bits/syscall.h.in
index 2b5f2052..b24fd784 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
+#define __NR_fchmodat2		452
 
diff --git a/arch/powerpc/bits/syscall.h.in b/arch/powerpc/bits/syscall.h.in
index b1605a58..5dcab5a1 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
+#define __NR_fchmodat2		452
 
diff --git a/arch/powerpc64/bits/syscall.h.in b/arch/powerpc64/bits/syscall.h.in
index b3a8fba0..4a6d7e3c 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
+#define __NR_fchmodat2		452
 
diff --git a/arch/riscv64/bits/syscall.h.in b/arch/riscv64/bits/syscall.h.in
index b534afe8..1e610e53 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
+#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 dfc38479..6c0cdf93 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_fchmodat2		452
 
diff --git a/arch/sh/bits/syscall.h.in b/arch/sh/bits/syscall.h.in
index ff14f54d..5e5d5ff0 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
+#define __NR_fchmodat2		452
 
diff --git a/arch/x32/bits/syscall.h.in b/arch/x32/bits/syscall.h.in
index 5d22fa17..69bd42d5 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_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 c3882de7..f83a0987 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_fchmodat2			452
 
-- 
2.43.0


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

* [musl] [PATCH 3/3] use new SYS_fchmodat2 syscall to implement fchmodat with flags
  2024-01-18  0:05 [musl] [PATCH 0/3] use new SYS_fchmodat2 syscall to implement fchmodat with flags Gaël PORTAY
  2024-01-18  0:05 ` [musl] [PATCH 1/3] remove flag argument from fchmodat syscall Gaël PORTAY
  2024-01-18  0:05 ` [musl] [PATCH 2/3] bits/syscall.h: add __NR_fchmodat2 from linux v6.6 Gaël PORTAY
@ 2024-01-18  0:05 ` Gaël PORTAY
  2 siblings, 0 replies; 5+ messages in thread
From: Gaël PORTAY @ 2024-01-18  0:05 UTC (permalink / raw)
  To: musl; +Cc: gael.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.0


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

* Re: [musl] [PATCH 2/3] bits/syscall.h: add __NR_fchmodat2 from linux v6.6
  2024-01-18  0:05 ` [musl] [PATCH 2/3] bits/syscall.h: add __NR_fchmodat2 from linux v6.6 Gaël PORTAY
@ 2024-02-08  2:10   ` Rich Felker
  0 siblings, 0 replies; 5+ messages in thread
From: Rich Felker @ 2024-02-08  2:10 UTC (permalink / raw)
  To: Gaël PORTAY; +Cc: musl

On Thu, Jan 18, 2024 at 01:05:39AM +0100, Gaël PORTAY wrote:
> 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/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 +
>  15 files changed, 15 insertions(+)
> 
> diff --git a/arch/arm/bits/syscall.h.in b/arch/arm/bits/syscall.h.in
> index 048fdea7..e5b9ca9d 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
> +#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 46ffe1d9..e746d58c 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_fchmodat2		452
>  
> diff --git a/arch/m68k/bits/syscall.h.in b/arch/m68k/bits/syscall.h.in
> index a0c63323..43030eea 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
> +#define __NR_fchmodat2		452
> diff --git a/arch/microblaze/bits/syscall.h.in b/arch/microblaze/bits/syscall.h.in
> index 931d7919..48669e4f 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
> +#define __NR_fchmodat2		452
>  
> diff --git a/arch/mips/bits/syscall.h.in b/arch/mips/bits/syscall.h.in
> index 63e3503a..eaba97c6 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
> +#define __NR_fchmodat2		4452
>  
> diff --git a/arch/mips64/bits/syscall.h.in b/arch/mips64/bits/syscall.h.in
> index b89965d1..c1f8f399 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
> +#define __NR_fchmodat2		5452
>  
> diff --git a/arch/mipsn32/bits/syscall.h.in b/arch/mipsn32/bits/syscall.h.in
> index bb2d04a8..9d952459 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
> +#define __NR_fchmodat2		6452
>  
> diff --git a/arch/or1k/bits/syscall.h.in b/arch/or1k/bits/syscall.h.in
> index 2b5f2052..b24fd784 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
> +#define __NR_fchmodat2		452
>  
> diff --git a/arch/powerpc/bits/syscall.h.in b/arch/powerpc/bits/syscall.h.in
> index b1605a58..5dcab5a1 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
> +#define __NR_fchmodat2		452
>  
> diff --git a/arch/powerpc64/bits/syscall.h.in b/arch/powerpc64/bits/syscall.h.in
> index b3a8fba0..4a6d7e3c 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
> +#define __NR_fchmodat2		452
>  
> diff --git a/arch/riscv64/bits/syscall.h.in b/arch/riscv64/bits/syscall.h.in
> index b534afe8..1e610e53 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
> +#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 dfc38479..6c0cdf93 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_fchmodat2		452
>  
> diff --git a/arch/sh/bits/syscall.h.in b/arch/sh/bits/syscall.h.in
> index ff14f54d..5e5d5ff0 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
> +#define __NR_fchmodat2		452
>  
> diff --git a/arch/x32/bits/syscall.h.in b/arch/x32/bits/syscall.h.in
> index 5d22fa17..69bd42d5 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_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 c3882de7..f83a0987 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_fchmodat2			452
>  
> -- 
> 2.43.0

I want to apply this series, but noticed there's a big gap of syscall
numbers we haven't added yet. Would you be willing to prepare a patch
bringing all the syscall.h.in files up to date with current
assignments?

Rich

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

end of thread, other threads:[~2024-02-08  2:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-18  0:05 [musl] [PATCH 0/3] use new SYS_fchmodat2 syscall to implement fchmodat with flags Gaël PORTAY
2024-01-18  0:05 ` [musl] [PATCH 1/3] remove flag argument from fchmodat syscall Gaël PORTAY
2024-01-18  0:05 ` [musl] [PATCH 2/3] bits/syscall.h: add __NR_fchmodat2 from linux v6.6 Gaël PORTAY
2024-02-08  2:10   ` Rich Felker
2024-01-18  0:05 ` [musl] [PATCH 3/3] use new SYS_fchmodat2 syscall to implement fchmodat with flags Gaël PORTAY

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).