[00/11] Update for linux v5.1

Submitted by Szabolcs Nagy on May 12, 2019, 2:53 p.m.

Details

Message ID 20190512145324.GB16415@port70.net
State New
Series "Update for linux v5.1"
Headers show

Commit Message

Szabolcs Nagy May 12, 2019, 2:53 p.m.
* Rich Felker <dalias@libc.org> [2019-05-11 20:17:39 -0400]:
> On Sat, May 11, 2019 at 06:46:15PM +0200, Szabolcs Nagy wrote:
> > tested on x86_64 and i486, build tested on other targets.
> > the SYS_ipc change does not affect the stripped libc.so on i486.
> > (the other changes are header definitions only)
> 
> I think the SYS_ipc stuff should be ok, but please keep commit
> messages to 76 columns or fewer (resulting in 80 with the 4-space
> indent git prints). I can reformat if you have a pattern you'd like to
> follow, but it's not obvious what the nicest one would be.

ok, changed the commit message formatting

Patch hide | download patch | download mbox

From 071b6ba516a25db7d27868813c213eb898f15484 Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <nsz@port70.net>
Date: Thu, 9 May 2019 20:44:27 +0000
Subject: [PATCH 11/11] add new syscall numbers from linux v5.1

syscall numbers are now synced up across targets (starting from 403 the
numbers are the same on all targets other than an arch specific offset)

IPC syscalls sem*, shm*, msg* got added where they were missing (except
for semop: only semtimedop got added), the new semctl, shmctl, msgctl
imply IPC_64, see

  linux commit 0d6040d4681735dfc47565de288525de405a5c99
  arch: add split IPC system calls where needed

new 64bit time_t syscall variants got added on 32bit targets, see

  linux commit 48166e6ea47d23984f0b481ca199250e1ce0730a
  y2038: add 64-bit time_t syscalls to all 32-bit architectures

new async io syscalls got added, see

  linux commit 2b188cc1bb857a9d4701ae59aa7768b5124e262e
  Add io_uring IO interface

  linux commit edafccee56ff31678a091ddb7219aba9b28bc3cb
  io_uring: add support for pre-mapped user IO buffers

a new syscall got added that uses the fd of /proc/<pid> as a stable
handle for processes: allows sending signals without pid reuse issues,
intended to eventually replace rt_sigqueueinfo, kill, tgkill and
rt_tgsigqueueinfo, see

  linux commit 3eb39f47934f9d5a3027fe00d906a45fe3a15fad
  signal: add pidfd_send_signal() syscall

on some targets (arm, m68k, s390x, sh) some previously missing syscall
numbers got added as well.
---
 arch/aarch64/bits/syscall.h.in    |  4 ++++
 arch/arm/bits/syscall.h.in        | 26 +++++++++++++++++++++
 arch/i386/bits/syscall.h.in       | 34 +++++++++++++++++++++++++++
 arch/m68k/bits/syscall.h.in       | 39 +++++++++++++++++++++++++++++++
 arch/microblaze/bits/syscall.h.in | 24 +++++++++++++++++++
 arch/mips/bits/syscall.h.in       | 34 +++++++++++++++++++++++++++
 arch/mips64/bits/syscall.h.in     |  4 ++++
 arch/mipsn32/bits/syscall.h.in    | 24 +++++++++++++++++++
 arch/or1k/bits/syscall.h.in       | 24 +++++++++++++++++++
 arch/powerpc/bits/syscall.h.in    | 34 +++++++++++++++++++++++++++
 arch/powerpc64/bits/syscall.h.in  | 15 ++++++++++++
 arch/s390x/bits/syscall.h.in      | 18 ++++++++++++++
 arch/sh/bits/syscall.h.in         | 39 +++++++++++++++++++++++++++++++
 arch/x32/bits/syscall.h.in        |  4 ++++
 arch/x86_64/bits/syscall.h.in     |  4 ++++
 15 files changed, 327 insertions(+)

diff --git a/arch/aarch64/bits/syscall.h.in b/arch/aarch64/bits/syscall.h.in
index 4db85162..eed5a612 100644
--- a/arch/aarch64/bits/syscall.h.in
+++ b/arch/aarch64/bits/syscall.h.in
@@ -277,4 +277,8 @@ 
 #define __NR_io_pgetevents 292
 #define __NR_rseq 293
 #define __NR_kexec_file_load 294
+#define __NR_pidfd_send_signal 424
+#define __NR_io_uring_setup 425
+#define __NR_io_uring_enter 426
+#define __NR_io_uring_register 427
 
diff --git a/arch/arm/bits/syscall.h.in b/arch/arm/bits/syscall.h.in
index 1787099d..8ce1d70a 100644
--- a/arch/arm/bits/syscall.h.in
+++ b/arch/arm/bits/syscall.h.in
@@ -355,6 +355,32 @@ 
 #define __NR_statx	397
 #define __NR_rseq	398
 #define __NR_io_pgetevents	399
+#define __NR_migrate_pages	400
+#define __NR_kexec_file_load	401
+#define __NR_clock_gettime64	403
+#define __NR_clock_settime64	404
+#define __NR_clock_adjtime64	405
+#define __NR_clock_getres_time64	406
+#define __NR_clock_nanosleep_time64	407
+#define __NR_timer_gettime64	408
+#define __NR_timer_settime64	409
+#define __NR_timerfd_gettime64	410
+#define __NR_timerfd_settime64	411
+#define __NR_utimensat_time64	412
+#define __NR_pselect6_time64	413
+#define __NR_ppoll_time64	414
+#define __NR_io_pgetevents_time64	416
+#define __NR_recvmmsg_time64	417
+#define __NR_mq_timedsend_time64	418
+#define __NR_mq_timedreceive_time64	419
+#define __NR_semtimedop_time64	420
+#define __NR_rt_sigtimedwait_time64	421
+#define __NR_futex_time64	422
+#define __NR_sched_rr_get_interval_time64	423
+#define __NR_pidfd_send_signal	424
+#define __NR_io_uring_setup	425
+#define __NR_io_uring_enter	426
+#define __NR_io_uring_register	427
 
 #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 47f4ae03..fdfdc710 100644
--- a/arch/i386/bits/syscall.h.in
+++ b/arch/i386/bits/syscall.h.in
@@ -384,4 +384,38 @@ 
 #define __NR_arch_prctl		384
 #define __NR_io_pgetevents	385
 #define __NR_rseq		386
+#define __NR_semget		393
+#define __NR_semctl		394
+#define __NR_shmget		395
+#define __NR_shmctl		396
+#define __NR_shmat		397
+#define __NR_shmdt		398
+#define __NR_msgget		399
+#define __NR_msgsnd		400
+#define __NR_msgrcv		401
+#define __NR_msgctl		402
+#define __NR_clock_gettime64	403
+#define __NR_clock_settime64	404
+#define __NR_clock_adjtime64	405
+#define __NR_clock_getres_time64 406
+#define __NR_clock_nanosleep_time64 407
+#define __NR_timer_gettime64	408
+#define __NR_timer_settime64	409
+#define __NR_timerfd_gettime64	410
+#define __NR_timerfd_settime64	411
+#define __NR_utimensat_time64	412
+#define __NR_pselect6_time64	413
+#define __NR_ppoll_time64	414
+#define __NR_io_pgetevents_time64 416
+#define __NR_recvmmsg_time64	417
+#define __NR_mq_timedsend_time64 418
+#define __NR_mq_timedreceive_time64 419
+#define __NR_semtimedop_time64	420
+#define __NR_rt_sigtimedwait_time64 421
+#define __NR_futex_time64	422
+#define __NR_sched_rr_get_interval_time64 423
+#define __NR_pidfd_send_signal	424
+#define __NR_io_uring_setup	425
+#define __NR_io_uring_enter	426
+#define __NR_io_uring_register	427
 
diff --git a/arch/m68k/bits/syscall.h.in b/arch/m68k/bits/syscall.h.in
index 89cf114c..c7859b99 100644
--- a/arch/m68k/bits/syscall.h.in
+++ b/arch/m68k/bits/syscall.h.in
@@ -359,3 +359,42 @@ 
 #define __NR_preadv2		377
 #define __NR_pwritev2		378
 #define __NR_statx		379
+#define __NR_seccomp		380
+#define __NR_pkey_mprotect	381
+#define __NR_pkey_alloc		382
+#define __NR_pkey_free		383
+#define __NR_rseq		384
+#define __NR_semget		393
+#define __NR_semctl		394
+#define __NR_shmget		395
+#define __NR_shmctl		396
+#define __NR_shmat		397
+#define __NR_shmdt		398
+#define __NR_msgget		399
+#define __NR_msgsnd		400
+#define __NR_msgrcv		401
+#define __NR_msgctl		402
+#define __NR_clock_gettime64	403
+#define __NR_clock_settime64	404
+#define __NR_clock_adjtime64	405
+#define __NR_clock_getres_time64 406
+#define __NR_clock_nanosleep_time64 407
+#define __NR_timer_gettime64	408
+#define __NR_timer_settime64	409
+#define __NR_timerfd_gettime64	410
+#define __NR_timerfd_settime64	411
+#define __NR_utimensat_time64	412
+#define __NR_pselect6_time64	413
+#define __NR_ppoll_time64	414
+#define __NR_io_pgetevents_time64 416
+#define __NR_recvmmsg_time64	417
+#define __NR_mq_timedsend_time64 418
+#define __NR_mq_timedreceive_time64 419
+#define __NR_semtimedop_time64	420
+#define __NR_rt_sigtimedwait_time64 421
+#define __NR_futex_time64	422
+#define __NR_sched_rr_get_interval_time64 423
+#define __NR_pidfd_send_signal	424
+#define __NR_io_uring_setup	425
+#define __NR_io_uring_enter	426
+#define __NR_io_uring_register	427
diff --git a/arch/microblaze/bits/syscall.h.in b/arch/microblaze/bits/syscall.h.in
index f0583961..91bc244e 100644
--- a/arch/microblaze/bits/syscall.h.in
+++ b/arch/microblaze/bits/syscall.h.in
@@ -395,4 +395,28 @@ 
 #define __NR_statx 398
 #define __NR_io_pgetevents 399
 #define __NR_rseq 400
+#define __NR_clock_gettime64 403
+#define __NR_clock_settime64 404
+#define __NR_clock_adjtime64 405
+#define __NR_clock_getres_time64 406
+#define __NR_clock_nanosleep_time64 407
+#define __NR_timer_gettime64 408
+#define __NR_timer_settime64 409
+#define __NR_timerfd_gettime64 410
+#define __NR_timerfd_settime64 411
+#define __NR_utimensat_time64 412
+#define __NR_pselect6_time64 413
+#define __NR_ppoll_time64 414
+#define __NR_io_pgetevents_time64 416
+#define __NR_recvmmsg_time64 417
+#define __NR_mq_timedsend_time64 418
+#define __NR_mq_timedreceive_time64 419
+#define __NR_semtimedop_time64 420
+#define __NR_rt_sigtimedwait_time64 421
+#define __NR_futex_time64 422
+#define __NR_sched_rr_get_interval_time64 423
+#define __NR_pidfd_send_signal 424
+#define __NR_io_uring_setup 425
+#define __NR_io_uring_enter 426
+#define __NR_io_uring_register 427
 
diff --git a/arch/mips/bits/syscall.h.in b/arch/mips/bits/syscall.h.in
index be8c3207..6175a7c2 100644
--- a/arch/mips/bits/syscall.h.in
+++ b/arch/mips/bits/syscall.h.in
@@ -366,4 +366,38 @@ 
 #define __NR_statx                   4366
 #define __NR_rseq                    4367
 #define __NR_io_pgetevents           4368
+#define __NR_semget                  4393
+#define __NR_semctl                  4394
+#define __NR_shmget                  4395
+#define __NR_shmctl                  4396
+#define __NR_shmat                   4397
+#define __NR_shmdt                   4398
+#define __NR_msgget                  4399
+#define __NR_msgsnd                  4400
+#define __NR_msgrcv                  4401
+#define __NR_msgctl                  4402
+#define __NR_clock_gettime64         4403
+#define __NR_clock_settime64         4404
+#define __NR_clock_adjtime64         4405
+#define __NR_clock_getres_time64     4406
+#define __NR_clock_nanosleep_time64  4407
+#define __NR_timer_gettime64         4408
+#define __NR_timer_settime64         4409
+#define __NR_timerfd_gettime64       4410
+#define __NR_timerfd_settime64       4411
+#define __NR_utimensat_time64        4412
+#define __NR_pselect6_time64         4413
+#define __NR_ppoll_time64            4414
+#define __NR_io_pgetevents_time64    4416
+#define __NR_recvmmsg_time64         4417
+#define __NR_mq_timedsend_time64     4418
+#define __NR_mq_timedreceive_time64  4419
+#define __NR_semtimedop_time64       4420
+#define __NR_rt_sigtimedwait_time64  4421
+#define __NR_futex_time64            4422
+#define __NR_sched_rr_get_interval_time64 4423
+#define __NR_pidfd_send_signal       4424
+#define __NR_io_uring_setup          4425
+#define __NR_io_uring_enter          4426
+#define __NR_io_uring_register       4427
 
diff --git a/arch/mips64/bits/syscall.h.in b/arch/mips64/bits/syscall.h.in
index 9eebbb6a..ca99e453 100644
--- a/arch/mips64/bits/syscall.h.in
+++ b/arch/mips64/bits/syscall.h.in
@@ -326,4 +326,8 @@ 
 #define __NR_statx			5326
 #define __NR_rseq			5327
 #define __NR_io_pgetevents		5328
+#define __NR_pidfd_send_signal		5424
+#define __NR_io_uring_setup		5425
+#define __NR_io_uring_enter		5426
+#define __NR_io_uring_register		5427
 
diff --git a/arch/mipsn32/bits/syscall.h.in b/arch/mipsn32/bits/syscall.h.in
index c1726180..f31ee446 100644
--- a/arch/mipsn32/bits/syscall.h.in
+++ b/arch/mipsn32/bits/syscall.h.in
@@ -330,4 +330,28 @@ 
 #define __NR_statx			6330
 #define __NR_rseq			6331
 #define __NR_io_pgetevents		6332
+#define __NR_clock_gettime64		6403
+#define __NR_clock_settime64		6404
+#define __NR_clock_adjtime64		6405
+#define __NR_clock_getres_time64	6406
+#define __NR_clock_nanosleep_time64	6407
+#define __NR_timer_gettime64		6408
+#define __NR_timer_settime64		6409
+#define __NR_timerfd_gettime64		6410
+#define __NR_timerfd_settime64		6411
+#define __NR_utimensat_time64		6412
+#define __NR_pselect6_time64		6413
+#define __NR_ppoll_time64		6414
+#define __NR_io_pgetevents_time64	6416
+#define __NR_recvmmsg_time64		6417
+#define __NR_mq_timedsend_time64	6418
+#define __NR_mq_timedreceive_time64	6419
+#define __NR_semtimedop_time64		6420
+#define __NR_rt_sigtimedwait_time64	6421
+#define __NR_futex_time64		6422
+#define __NR_sched_rr_get_interval_time64 6423
+#define __NR_pidfd_send_signal		6424
+#define __NR_io_uring_setup		6425
+#define __NR_io_uring_enter		6426
+#define __NR_io_uring_register		6427
 
diff --git a/arch/or1k/bits/syscall.h.in b/arch/or1k/bits/syscall.h.in
index 4c3df0a3..33a86861 100644
--- a/arch/or1k/bits/syscall.h.in
+++ b/arch/or1k/bits/syscall.h.in
@@ -279,4 +279,28 @@ 
 #define __NR_io_pgetevents 292
 #define __NR_rseq 293
 #define __NR_kexec_file_load 294
+#define __NR_clock_gettime64 403
+#define __NR_clock_settime64 404
+#define __NR_clock_adjtime64 405
+#define __NR_clock_getres_time64 406
+#define __NR_clock_nanosleep_time64 407
+#define __NR_timer_gettime64 408
+#define __NR_timer_settime64 409
+#define __NR_timerfd_gettime64 410
+#define __NR_timerfd_settime64 411
+#define __NR_utimensat_time64 412
+#define __NR_pselect6_time64 413
+#define __NR_ppoll_time64 414
+#define __NR_io_pgetevents_time64 416
+#define __NR_recvmmsg_time64 417
+#define __NR_mq_timedsend_time64 418
+#define __NR_mq_timedreceive_time64 419
+#define __NR_semtimedop_time64 420
+#define __NR_rt_sigtimedwait_time64 421
+#define __NR_futex_time64 422
+#define __NR_sched_rr_get_interval_time64 423
+#define __NR_pidfd_send_signal 424
+#define __NR_io_uring_setup 425
+#define __NR_io_uring_enter 426
+#define __NR_io_uring_register 427
 
diff --git a/arch/powerpc/bits/syscall.h.in b/arch/powerpc/bits/syscall.h.in
index 54e155f2..0a6c9add 100644
--- a/arch/powerpc/bits/syscall.h.in
+++ b/arch/powerpc/bits/syscall.h.in
@@ -373,4 +373,38 @@ 
 #define __NR_pkey_mprotect         386
 #define __NR_rseq                  387
 #define __NR_io_pgetevents         388
+#define __NR_semget                393
+#define __NR_semctl                394
+#define __NR_shmget                395
+#define __NR_shmctl                396
+#define __NR_shmat                 397
+#define __NR_shmdt                 398
+#define __NR_msgget                399
+#define __NR_msgsnd                400
+#define __NR_msgrcv                401
+#define __NR_msgctl                402
+#define __NR_clock_gettime64       403
+#define __NR_clock_settime64       404
+#define __NR_clock_adjtime64       405
+#define __NR_clock_getres_time64   406
+#define __NR_clock_nanosleep_time64 407
+#define __NR_timer_gettime64       408
+#define __NR_timer_settime64       409
+#define __NR_timerfd_gettime64     410
+#define __NR_timerfd_settime64     411
+#define __NR_utimensat_time64      412
+#define __NR_pselect6_time64       413
+#define __NR_ppoll_time64          414
+#define __NR_io_pgetevents_time64  416
+#define __NR_recvmmsg_time64       417
+#define __NR_mq_timedsend_time64   418
+#define __NR_mq_timedreceive_time64 419
+#define __NR_semtimedop_time64     420
+#define __NR_rt_sigtimedwait_time64 421
+#define __NR_futex_time64          422
+#define __NR_sched_rr_get_interval_time64 423
+#define __NR_pidfd_send_signal     424
+#define __NR_io_uring_setup        425
+#define __NR_io_uring_enter        426
+#define __NR_io_uring_register     427
 
diff --git a/arch/powerpc64/bits/syscall.h.in b/arch/powerpc64/bits/syscall.h.in
index 4e29cedf..0c894a23 100644
--- a/arch/powerpc64/bits/syscall.h.in
+++ b/arch/powerpc64/bits/syscall.h.in
@@ -364,4 +364,19 @@ 
 #define __NR_pkey_mprotect          386
 #define __NR_rseq                   387
 #define __NR_io_pgetevents          388
+#define __NR_semtimedop             392
+#define __NR_semget                 393
+#define __NR_semctl                 394
+#define __NR_shmget                 395
+#define __NR_shmctl                 396
+#define __NR_shmat                  397
+#define __NR_shmdt                  398
+#define __NR_msgget                 399
+#define __NR_msgsnd                 400
+#define __NR_msgrcv                 401
+#define __NR_msgctl                 402
+#define __NR_pidfd_send_signal      424
+#define __NR_io_uring_setup         425
+#define __NR_io_uring_enter         426
+#define __NR_io_uring_register      427
 
diff --git a/arch/s390x/bits/syscall.h.in b/arch/s390x/bits/syscall.h.in
index 85a18e79..72fd2cce 100644
--- a/arch/s390x/bits/syscall.h.in
+++ b/arch/s390x/bits/syscall.h.in
@@ -326,4 +326,22 @@ 
 #define __NR_kexec_file_load            381
 #define __NR_io_pgetevents              382
 #define __NR_rseq                       383
+#define __NR_pkey_mprotect              384
+#define __NR_pkey_alloc                 385
+#define __NR_pkey_free                  386
+#define __NR_semtimedop                 392
+#define __NR_semget                     393
+#define __NR_semctl                     394
+#define __NR_shmget                     395
+#define __NR_shmctl                     396
+#define __NR_shmat                      397
+#define __NR_shmdt                      398
+#define __NR_msgget                     399
+#define __NR_msgsnd                     400
+#define __NR_msgrcv                     401
+#define __NR_msgctl                     402
+#define __NR_pidfd_send_signal          424
+#define __NR_io_uring_setup             425
+#define __NR_io_uring_enter             426
+#define __NR_io_uring_register          427
 
diff --git a/arch/sh/bits/syscall.h.in b/arch/sh/bits/syscall.h.in
index 420f4a0f..ad35fc64 100644
--- a/arch/sh/bits/syscall.h.in
+++ b/arch/sh/bits/syscall.h.in
@@ -352,4 +352,43 @@ 
 #define __NR_copy_file_range        380
 #define __NR_preadv2                381
 #define __NR_pwritev2               382
+#define __NR_statx                  383
+#define __NR_pkey_mprotect          384
+#define __NR_pkey_alloc             385
+#define __NR_pkey_free              386
+#define __NR_rseq                   387
+#define __NR_semget                 393
+#define __NR_semctl                 394
+#define __NR_shmget                 395
+#define __NR_shmctl                 396
+#define __NR_shmat                  397
+#define __NR_shmdt                  398
+#define __NR_msgget                 399
+#define __NR_msgsnd                 400
+#define __NR_msgrcv                 401
+#define __NR_msgctl                 402
+#define __NR_clock_gettime64        403
+#define __NR_clock_settime64        404
+#define __NR_clock_adjtime64        405
+#define __NR_clock_getres_time64    406
+#define __NR_clock_nanosleep_time64 407
+#define __NR_timer_gettime64        408
+#define __NR_timer_settime64        409
+#define __NR_timerfd_gettime64      410
+#define __NR_timerfd_settime64      411
+#define __NR_utimensat_time64       412
+#define __NR_pselect6_time64        413
+#define __NR_ppoll_time64           414
+#define __NR_io_pgetevents_time64   416
+#define __NR_recvmmsg_time64        417
+#define __NR_mq_timedsend_time64    418
+#define __NR_mq_timedreceive_time64 419
+#define __NR_semtimedop_time64      420
+#define __NR_rt_sigtimedwait_time64 421
+#define __NR_futex_time64           422
+#define __NR_sched_rr_get_interval_time64 423
+#define __NR_pidfd_send_signal      424
+#define __NR_io_uring_setup         425
+#define __NR_io_uring_enter         426
+#define __NR_io_uring_register      427
 
diff --git a/arch/x32/bits/syscall.h.in b/arch/x32/bits/syscall.h.in
index 67d89f91..77ec432f 100644
--- a/arch/x32/bits/syscall.h.in
+++ b/arch/x32/bits/syscall.h.in
@@ -286,6 +286,10 @@ 
 #define __NR_statx (0x40000000 + 332)
 #define __NR_io_pgetevents (0x40000000 + 333)
 #define __NR_rseq (0x40000000 + 334)
+#define __NR_pidfd_send_signal (0x40000000 + 424)
+#define __NR_io_uring_setup (0x40000000 + 425)
+#define __NR_io_uring_enter (0x40000000 + 426)
+#define __NR_io_uring_register (0x40000000 + 427)
 
 #define __NR_rt_sigaction (0x40000000 + 512)
 #define __NR_rt_sigreturn (0x40000000 + 513)
diff --git a/arch/x86_64/bits/syscall.h.in b/arch/x86_64/bits/syscall.h.in
index 9cdb7789..49572ef2 100644
--- a/arch/x86_64/bits/syscall.h.in
+++ b/arch/x86_64/bits/syscall.h.in
@@ -333,4 +333,8 @@ 
 #define __NR_statx				332
 #define __NR_io_pgetevents			333
 #define __NR_rseq				334
+#define __NR_pidfd_send_signal			424
+#define __NR_io_uring_setup			425
+#define __NR_io_uring_enter			426
+#define __NR_io_uring_register			427
 
-- 
2.21.0


Comments

Rich Felker May 21, 2019, 11:11 p.m.
On Sun, May 12, 2019 at 04:53:24PM +0200, Szabolcs Nagy wrote:
> * Rich Felker <dalias@libc.org> [2019-05-11 20:17:39 -0400]:
> > On Sat, May 11, 2019 at 06:46:15PM +0200, Szabolcs Nagy wrote:
> > > tested on x86_64 and i486, build tested on other targets.
> > > the SYS_ipc change does not affect the stripped libc.so on i486.
> > > (the other changes are header definitions only)
> > 
> > I think the SYS_ipc stuff should be ok, but please keep commit
> > messages to 76 columns or fewer (resulting in 80 with the 4-space
> > indent git prints). I can reformat if you have a pattern you'd like to
> > follow, but it's not obvious what the nicest one would be.
> 
> ok, changed the commit message formatting

Sorry, a few more things now that I've reviewed them all in more
detail...

> From f6cc4cdf345d1785659ed9b59f3a2827c3fd3c53 Mon Sep 17 00:00:00 2001
> From: Szabolcs Nagy <nsz@port70.net>
> Date: Thu, 9 May 2019 19:20:17 +0000
> Subject: [PATCH 06/11] sys/socket.h: add new SO_ definitions from linux v5.1
> 
> the new definitions are from commits
> 
>   linux commit a9beb86ae6e55bd92f38453c8623de60b8e5a308
>   sock: Add SO_RCVTIMEO_NEW and SO_SNDTIMEO_NEW
> 
>   linux commit 45bdc66159d49bfc7f75fe02d25bc74f5d2660cf
>   socket: Rename SO_RCVTIMEO/ SO_SNDTIMEO with _OLD suffixes
> 
>   linux commit 9718475e69084de15c3930ce35672a7dc6da866b
>   socket: Add SO_TIMESTAMPING_NEW
> 
>   linux commit 887feae36aee6c08e0dafcdaa5ba921abbb2c56b
>   socket: Add SO_TIMESTAMP[NS]_NEW
> 
>   linux commit 7f1bc6e95d7840d4305595b3e4025cddda88cee5
>   sockopt: Rename SO_TIMESTAMP* to SO_TIMESTAMP*_OLD
> 
>   linux commit f5dd3d0c9638a9d9a02b5964c4ad636f06cf7e2c
>   net: introduce SO_BINDTOIFINDEX sockopt
> 
> SO_BINDTOIFINDEX behaves similar to SO_BINDTODEVICE, but takes a
> network interface index as argument, rather than the network
> interface name.
> 
> _NEW socket options got introduced for 64bit time_t support on 32bit
> targets, in musl the affected socket options are always the same as
> the _OLD values since different time_t requires a new abi, so the
> _OLD vs _NEW dispatch logic was not copied from the uapi headers.

Are the _OLD and _NEW ones intended to be application-facing APIs? I
think this is a question both of the kernel's intent and our intent.
When we add 64-bit time_t, however we do it, we'll need to emulate the
_NEW version on old kernels that lack it, and it's not clear that we'd
want to expose the _OLD version at all.

Perhaps we should split this patch into the time64 stuff and the other
changes so that the other changes can be applied right away if there's
further discussion to be had about time64.

> From 01dcbc761ace09ddc7295e14f33d95bc32a15318 Mon Sep 17 00:00:00 2001
> From: Szabolcs Nagy <nsz@port70.net>
> Date: Thu, 9 May 2019 22:49:28 +0000
> Subject: [PATCH 10/11] ipc: prefer SYS_ipc when it is defined
> 
> Linux v5.1 introduced ipc syscalls on targets where previously only
> SYS_ipc was available, change the logic such that the ipc code keeps
> using SYS_ipc which works backward compatibly on older kernels.

I think this patch changes behavior at least on microblaze, which
already had both. A casual grep of arch/*/bits/syscall.h.in for
__NR_ipc and __NR_semget suggests there are no others affected, so
perhaps it's no big deal. Thoughts?

> From 071b6ba516a25db7d27868813c213eb898f15484 Mon Sep 17 00:00:00 2001
> From: Szabolcs Nagy <nsz@port70.net>
> Date: Thu, 9 May 2019 20:44:27 +0000
> Subject: [PATCH 11/11] add new syscall numbers from linux v5.1
> 
> syscall numbers are now synced up across targets (starting from 403 the
> numbers are the same on all targets other than an arch specific offset)
> 
> IPC syscalls sem*, shm*, msg* got added where they were missing (except
> for semop: only semtimedop got added), the new semctl, shmctl, msgctl
> imply IPC_64, see
> 
>   linux commit 0d6040d4681735dfc47565de288525de405a5c99
>   arch: add split IPC system calls where needed
> 
> new 64bit time_t syscall variants got added on 32bit targets, see
> 
>   linux commit 48166e6ea47d23984f0b481ca199250e1ce0730a
>   y2038: add 64-bit time_t syscalls to all 32-bit architectures
> 
> new async io syscalls got added, see
> 
>   linux commit 2b188cc1bb857a9d4701ae59aa7768b5124e262e
>   Add io_uring IO interface
> 
>   linux commit edafccee56ff31678a091ddb7219aba9b28bc3cb
>   io_uring: add support for pre-mapped user IO buffers
> 
> a new syscall got added that uses the fd of /proc/<pid> as a stable
> handle for processes: allows sending signals without pid reuse issues,
> intended to eventually replace rt_sigqueueinfo, kill, tgkill and
> rt_tgsigqueueinfo, see

FWIW I don't think it can replace any of them, because open can fail
due to ENFILE/EMFILE/missing-proc/etc. This doesn't need any change;
just a comment.

Otherwise, these look good.x

Rich
Szabolcs Nagy May 22, 2019, 9:41 a.m.
* Rich Felker <dalias@libc.org> [2019-05-21 19:11:47 -0400]:
> On Sun, May 12, 2019 at 04:53:24PM +0200, Szabolcs Nagy wrote:
> > From f6cc4cdf345d1785659ed9b59f3a2827c3fd3c53 Mon Sep 17 00:00:00 2001
> > From: Szabolcs Nagy <nsz@port70.net>
> > Date: Thu, 9 May 2019 19:20:17 +0000
> > Subject: [PATCH 06/11] sys/socket.h: add new SO_ definitions from linux v5.1
> > 
> > the new definitions are from commits
> > 
> >   linux commit a9beb86ae6e55bd92f38453c8623de60b8e5a308
> >   sock: Add SO_RCVTIMEO_NEW and SO_SNDTIMEO_NEW
> > 
> >   linux commit 45bdc66159d49bfc7f75fe02d25bc74f5d2660cf
> >   socket: Rename SO_RCVTIMEO/ SO_SNDTIMEO with _OLD suffixes
> > 
> >   linux commit 9718475e69084de15c3930ce35672a7dc6da866b
> >   socket: Add SO_TIMESTAMPING_NEW
> > 
> >   linux commit 887feae36aee6c08e0dafcdaa5ba921abbb2c56b
> >   socket: Add SO_TIMESTAMP[NS]_NEW
> > 
> >   linux commit 7f1bc6e95d7840d4305595b3e4025cddda88cee5
> >   sockopt: Rename SO_TIMESTAMP* to SO_TIMESTAMP*_OLD
> > 
> >   linux commit f5dd3d0c9638a9d9a02b5964c4ad636f06cf7e2c
> >   net: introduce SO_BINDTOIFINDEX sockopt
> > 
> > SO_BINDTOIFINDEX behaves similar to SO_BINDTODEVICE, but takes a
> > network interface index as argument, rather than the network
> > interface name.
> > 
> > _NEW socket options got introduced for 64bit time_t support on 32bit
> > targets, in musl the affected socket options are always the same as
> > the _OLD values since different time_t requires a new abi, so the
> > _OLD vs _NEW dispatch logic was not copied from the uapi headers.
> 
> Are the _OLD and _NEW ones intended to be application-facing APIs? I
> think this is a question both of the kernel's intent and our intent.
> When we add 64-bit time_t, however we do it, we'll need to emulate the
> _NEW version on old kernels that lack it, and it's not clear that we'd
> want to expose the _OLD version at all.
> 
> Perhaps we should split this patch into the time64 stuff and the other
> changes so that the other changes can be applied right away if there's
> further discussion to be had about time64.

ok i can split this.

i think the intent is that the public api is SO_FOO,
the kernel defines SO_FOO_OLD and SO_FOO_NEW for the
old and new time_t abi respectively and then SO_FOO
is defined using those like

#define SO_FOO (sizeof(long)==4 && sizeof(time_t)==8 ? SO_FOO_NEW : SO_FOO_OLD)

or similar, since on glibc the abi is based on feature
test macros, but for us SO_FOO is always SO_FOO_OLD
so it seemed simplest to just introduce the _OLD, _NEW
names and leave the SO_FOO definitions alone.

(i'm not sure what SO_FOO_NEW means on 64bit targets
where time_t is already 64bit)

> > From 01dcbc761ace09ddc7295e14f33d95bc32a15318 Mon Sep 17 00:00:00 2001
> > From: Szabolcs Nagy <nsz@port70.net>
> > Date: Thu, 9 May 2019 22:49:28 +0000
> > Subject: [PATCH 10/11] ipc: prefer SYS_ipc when it is defined
> > 
> > Linux v5.1 introduced ipc syscalls on targets where previously only
> > SYS_ipc was available, change the logic such that the ipc code keeps
> > using SYS_ipc which works backward compatibly on older kernels.
> 
> I think this patch changes behavior at least on microblaze, which
> already had both. A casual grep of arch/*/bits/syscall.h.in for
> __NR_ipc and __NR_semget suggests there are no others affected, so
> perhaps it's no big deal. Thoughts?

i didnt notice that, i guess microblaze works either way.

it's also possible to change to the new calls and fall back
to SYS_ipc when that's available, however i think semtimedop
will only have 64bit time_t variant on 32bit targets and
IPC_64 should not be passed explicitly to the new syscalls,
so dealing with those seemed to be messy.