]> Cypherpunks repositories - gostls13.git/commit
syscall: add new CLONE_ flags for Linux
authorKir Kolyshkin <kolyshkin@gmail.com>
Fri, 20 May 2022 05:25:42 +0000 (22:25 -0700)
committerGopher Robot <gobot@golang.org>
Fri, 19 Aug 2022 16:12:50 +0000 (16:12 +0000)
commit3204e62dd1abe087430e37e8c33c3d010606aabe
treeb3d7db6f455734d265754007ffeea183d9e3687f
parentd654117075d1dd0686aa6833b22f28275623c759
syscall: add new CLONE_ flags for Linux

The constants for these were auto-generated from the C includes
into zerrors_linux* files quite some time ago. The generator is
currently broken, but some new flags need to be added nevertheless.

As the flags won't change and the values are the same for all
architectures, we can just define them statically (as it's already
done in the runtime package):

 - remove the CLONE_* constants from zerrors_linux_*.go;
 - patch mkerrors.sh to not generate CLONE_ constants
   (in case it will be fixed and used in the future);
 - add the constants and some comments about them to exec_linux.go,
   using Linux v5.17 include/uapi/sched.h as the ultimate source.

This adds the following new flags:

 - CLONE_CLEAR_SIGHAND
 - CLONE_INTO_CGROUP
 - CLONE_NEWCGROUP
 - CLONE_NEWTIME
 - CLONE_PIDFD

For #51246.

Change-Id: I0c635723926218bd403d37e113ee4d62194463a8
Reviewed-on: https://go-review.googlesource.com/c/go/+/407574
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Joedian Reid <joedian@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
16 files changed:
api/next/51246.txt [new file with mode: 0644]
src/syscall/exec_linux.go
src/syscall/mkerrors.sh
src/syscall/zerrors_linux_386.go
src/syscall/zerrors_linux_amd64.go
src/syscall/zerrors_linux_arm.go
src/syscall/zerrors_linux_arm64.go
src/syscall/zerrors_linux_loong64.go
src/syscall/zerrors_linux_mips.go
src/syscall/zerrors_linux_mips64.go
src/syscall/zerrors_linux_mips64le.go
src/syscall/zerrors_linux_mipsle.go
src/syscall/zerrors_linux_ppc64.go
src/syscall/zerrors_linux_ppc64le.go
src/syscall/zerrors_linux_riscv64.go
src/syscall/zerrors_linux_s390x.go