Alexey Perevalov has uploaded this change for review.
unix: fsmount fspick fsopen fsconfig linux syscall
Patches were submitted to Linux manpages:
https://lwn.net/Articles/802096/, but not yet applied.
Generated on linux kernel v5.16.
Change-Id: I7f9560f4bc5b4bbe1e00c63ce1bc25c781aa1293
---
M unix/linux/types.go
M unix/syscall_linux.go
M unix/zsyscall_linux.go
M unix/ztypes_linux.go
4 files changed, 117 insertions(+), 0 deletions(-)
diff --git a/unix/linux/types.go b/unix/linux/types.go
index c8d176e..8a2d090 100644
--- a/unix/linux/types.go
+++ b/unix/linux/types.go
@@ -905,6 +905,24 @@
OPEN_TREE_CLONE = C.OPEN_TREE_CLONE
OPEN_TREE_CLOEXEC = C.OPEN_TREE_CLOEXEC
+
+ FSOPEN_CLOEXEC = C.FSOPEN_CLOEXEC
+
+ FSPICK_CLOEXEC = C.FSPICK_CLOEXEC
+ FSPICK_SYMLINK_NOFOLLOW = C.FSPICK_SYMLINK_NOFOLLOW
+ FSPICK_NO_AUTOMOUNT = C.FSPICK_NO_AUTOMOUNT
+ FSPICK_EMPTY_PATH = C.FSPICK_EMPTY_PATH
+
+ FSCONFIG_SET_FLAG = C.FSCONFIG_SET_FLAG
+ FSCONFIG_SET_STRING = C.FSCONFIG_SET_STRING
+ FSCONFIG_SET_BINARY = C.FSCONFIG_SET_BINARY
+ FSCONFIG_SET_PATH = C.FSCONFIG_SET_PATH
+ FSCONFIG_SET_PATH_EMPTY = C.FSCONFIG_SET_PATH_EMPTY
+ FSCONFIG_SET_FD = C.FSCONFIG_SET_FD
+ FSCONFIG_CMD_CREATE = C.FSCONFIG_CMD_CREATE
+ FSCONFIG_CMD_RECONFIGURE = C.FSCONFIG_CMD_RECONFIGURE
+
+ FSMOUNT_CLOEXEC = C.FSMOUNT_CLOEXEC
)
type OpenHow C.struct_open_how
diff --git a/unix/syscall_linux.go b/unix/syscall_linux.go
index 298323e..81769bb 100644
--- a/unix/syscall_linux.go
+++ b/unix/syscall_linux.go
@@ -1829,6 +1829,10 @@
//sys Fremovexattr(fd int, attr string) (err error)
//sys Fsetxattr(fd int, attr string, dest []byte, flags int) (err error)
//sys Fsync(fd int) (err error)
+//sys Fsconfig(fd *int, cmd int, key string, value []byte, aux int) (err error)
+//sys Fsmount(fd int, flags int, mountAttrs int) (fd int, err error)
+//sys Fsopen(fsName string, flags int) (fd int, err error)
+//sys Fspick(dirfd int, pathName string, flags int) (fd int, err error)
//sys Getdents(fd int, buf []byte) (n int, err error) = SYS_GETDENTS64
//sysnb Getpgid(pid int) (pgid int, err error)
diff --git a/unix/zsyscall_linux.go b/unix/zsyscall_linux.go
index ca65ac8..8ff8a19 100644
--- a/unix/zsyscall_linux.go
+++ b/unix/zsyscall_linux.go
@@ -828,6 +828,70 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+func Fsconfig(fd *int, cmd int, key string, value []byte, aux int) (err error) {
+ var _p0 *byte
+ _p0, err = BytePtrFromString(key)
+ if err != nil {
+ return
+ }
+ var _p1 unsafe.Pointer
+ if len(value) > 0 {
+ _p1 = unsafe.Pointer(&value[0])
+ } else {
+ _p1 = unsafe.Pointer(&_zero)
+ }
+ _, _, e1 := Syscall6(SYS_FSCONFIG, uintptr(unsafe.Pointer(fd)), uintptr(cmd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(value)), uintptr(aux))
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func Fsmount(fd int, flags int, mountAttrs int) (fd int, err error) {
+ r0, _, e1 := Syscall(SYS_FSMOUNT, uintptr(fd), uintptr(flags), uintptr(mountAttrs))
+ fd = int(r0)
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func Fsopen(fsName string, flags int) (fd int, err error) {
+ var _p0 *byte
+ _p0, err = BytePtrFromString(fsName)
+ if err != nil {
+ return
+ }
+ r0, _, e1 := Syscall(SYS_FSOPEN, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)
+ fd = int(r0)
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func Fspick(dirfd int, pathName string, flags int) (fd int, err error) {
+ var _p0 *byte
+ _p0, err = BytePtrFromString(pathName)
+ if err != nil {
+ return
+ }
+ r0, _, e1 := Syscall(SYS_FSPICK, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags))
+ fd = int(r0)
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
func Getdents(fd int, buf []byte) (n int, err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
diff --git a/unix/ztypes_linux.go b/unix/ztypes_linux.go
index e61891d..d8f4ae9 100644
--- a/unix/ztypes_linux.go
+++ b/unix/ztypes_linux.go
@@ -756,6 +756,24 @@
AT_EACCESS = 0x200
OPEN_TREE_CLONE = 0x1
+
+ FSOPEN_CLOEXEC = 0x1
+
+ FSPICK_CLOEXEC = 0x1
+ FSPICK_SYMLINK_NOFOLLOW = 0x2
+ FSPICK_NO_AUTOMOUNT = 0x4
+ FSPICK_EMPTY_PATH = 0x8
+
+ FSCONFIG_SET_FLAG = 0x0
+ FSCONFIG_SET_STRING = 0x1
+ FSCONFIG_SET_BINARY = 0x2
+ FSCONFIG_SET_PATH = 0x3
+ FSCONFIG_SET_PATH_EMPTY = 0x4
+ FSCONFIG_SET_FD = 0x5
+ FSCONFIG_CMD_CREATE = 0x6
+ FSCONFIG_CMD_RECONFIGURE = 0x7
+
+ FSMOUNT_CLOEXEC = 0x1
)
type OpenHow struct {
To view, visit change 398434. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Alexey Perevalov, Tobias Klauser, Brad Fitzpatrick.
1 comment:
File unix/syscall_linux.go:
Patch Set #1, Line 1832: //sys Fsconfig(fd *int, cmd int, key string, value []byte, aux int) (err error)
I don't understand why the fd argument is *int rather than int. But if it's really *int, then this won't work, because the type "int" has a different size for C and Go.
To view, visit change 398434. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Tobias Klauser, Brad Fitzpatrick, Ian Lance Taylor.
1 comment:
File unix/syscall_linux.go:
Patch Set #1, Line 1832: //sys Fsconfig(fd *int, cmd int, key string, value []byte, aux int) (err error)
I don't understand why the fd argument is *int rather than int. […]
My fault, sorry, infidelity it should be int, not a *int, I tried it in runc (https://github.com/AlexeyPerevalov/runc/commit/e2f388c03014e0810d889bb9662dfab234e48fe5#diff-e0932af06cb46065b2ef5fc89bc2bd9b880c9578e01b89ef4ecaeffb78a8bef0L13), but when I copied func signature from https://lwn.net/Articles/802096/ I incidentally preserve *int.
To view, visit change 398434. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Tobias Klauser, Brad Fitzpatrick, Ian Lance Taylor.
Alexey Perevalov uploaded patch set #2 to this change.
unix: fsmount fspick fsopen fsconfig linux syscall
Patches were submitted to Linux manpages:
https://lwn.net/Articles/802096/, but not yet applied.
Generated on linux kernel v5.16.
Change-Id: I7f9560f4bc5b4bbe1e00c63ce1bc25c781aa1293
---
M unix/linux/types.go
M unix/syscall_linux.go
M unix/zsyscall_linux.go
M unix/ztypes_linux.go
4 files changed, 117 insertions(+), 0 deletions(-)
To view, visit change 398434. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Alexey Perevalov, Tobias Klauser, Brad Fitzpatrick.
Patch set 2:Run-TryBot +1Code-Review +2
1 comment:
Patchset:
Thanks.
To view, visit change 398434. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Alexey Perevalov, Tobias Klauser, Brad Fitzpatrick.
Patch set 2:-Code-Review
Attention is currently required from: Alexey Perevalov, Tobias Klauser, Brad Fitzpatrick.
Alexey Perevalov uploaded patch set #3 to this change.
unix: fsmount fspick fsopen linux syscall
Patches were submitted to Linux manpages:
https://lwn.net/Articles/802096/, but not yet applied.
Generated on linux kernel v5.16.
Fsconfig couldn't implemented by generator, it requires
special cases handling.
Change-Id: I7f9560f4bc5b4bbe1e00c63ce1bc25c781aa1293
---
M unix/linux/types.go
M unix/syscall_linux.go
M unix/zsyscall_linux.go
M unix/ztypes_linux.go
4 files changed, 80 insertions(+), 0 deletions(-)
To view, visit change 398434. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Tobias Klauser, Brad Fitzpatrick.
1 comment:
Patchset:
fsconfig will be in the next patch, since too many questions with it.
To view, visit change 398434. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Alexey Perevalov, Tobias Klauser, Brad Fitzpatrick.
Patch set 3:Run-TryBot +1
Attention is currently required from: Alexey Perevalov, Tobias Klauser, Brad Fitzpatrick.
Patch set 3:Auto-Submit +1Code-Review +2
1 comment:
Patchset:
Thanks.
To view, visit change 398434. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Alexey Perevalov, Brad Fitzpatrick.
Patch set 3:Code-Review +2
Attention is currently required from: Alexey Perevalov, Brad Fitzpatrick, Ian Lance Taylor.
1 comment:
File unix/syscall_linux.go:
Patch Set #1, Line 1832: //sys Fsconfig(fd *int, cmd int, key string, value []byte, aux int) (err error)
My fault, sorry, infidelity it should be int, not a *int, I tried it in runc (https://github. […]
Done
To view, visit change 398434. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Alexey Perevalov, Brad Fitzpatrick, Ian Lance Taylor.
Patch set 3:Auto-Submit +1
Attention is currently required from: Alexey Perevalov, Brad Fitzpatrick, Ian Lance Taylor.
Patch set 3:Code-Review +1
Gopher Robot submitted this change.
unix: fsmount fspick fsopen linux syscall
Patches were submitted to Linux manpages:
https://lwn.net/Articles/802096/, but not yet applied.
Generated on linux kernel v5.16.
Fsconfig couldn't implemented by generator, it requires
special cases handling.
Change-Id: I7f9560f4bc5b4bbe1e00c63ce1bc25c781aa1293
Reviewed-on: https://go-review.googlesource.com/c/sys/+/398434
Run-TryBot: Ian Lance Taylor <ia...@golang.org>
TryBot-Result: Gopher Robot <go...@golang.org>
Reviewed-by: Ian Lance Taylor <ia...@google.com>
Auto-Submit: Ian Lance Taylor <ia...@google.com>
Reviewed-by: Tobias Klauser <tobias....@gmail.com>
Auto-Submit: Tobias Klauser <tobias....@gmail.com>
Reviewed-by: Benny Siegert <bsie...@gmail.com>
---
M unix/linux/types.go
M unix/syscall_linux.go
M unix/zsyscall_linux.go
M unix/ztypes_linux.go
4 files changed, 88 insertions(+), 0 deletions(-)
diff --git a/unix/linux/types.go b/unix/linux/types.go
index 8065a33..af78e11 100644
--- a/unix/linux/types.go
+++ b/unix/linux/types.go
@@ -914,6 +914,15 @@
MOVE_MOUNT_T_AUTOMOUNTS = C.MOVE_MOUNT_T_AUTOMOUNTS
MOVE_MOUNT_T_EMPTY_PATH = C.MOVE_MOUNT_T_EMPTY_PATH
MOVE_MOUNT_SET_GROUP = C.MOVE_MOUNT_SET_GROUP
+
+ FSOPEN_CLOEXEC = C.FSOPEN_CLOEXEC
+
+ FSPICK_CLOEXEC = C.FSPICK_CLOEXEC
+ FSPICK_SYMLINK_NOFOLLOW = C.FSPICK_SYMLINK_NOFOLLOW
+ FSPICK_NO_AUTOMOUNT = C.FSPICK_NO_AUTOMOUNT
+ FSPICK_EMPTY_PATH = C.FSPICK_EMPTY_PATH
+
+ FSMOUNT_CLOEXEC = C.FSMOUNT_CLOEXEC
)
type OpenHow C.struct_open_how
diff --git a/unix/syscall_linux.go b/unix/syscall_linux.go
index eeae6db..cb03b72 100644
--- a/unix/syscall_linux.go
+++ b/unix/syscall_linux.go
@@ -1829,6 +1829,9 @@
//sys Fremovexattr(fd int, attr string) (err error)
//sys Fsetxattr(fd int, attr string, dest []byte, flags int) (err error)
//sys Fsync(fd int) (err error)
+//sys Fsmount(fd int, flags int, mountAttrs int) (fsfd int, err error)
+//sys Fsopen(fsName string, flags int) (fd int, err error)
+//sys Fspick(dirfd int, pathName string, flags int) (fd int, err error)
//sys Getdents(fd int, buf []byte) (n int, err error) = SYS_GETDENTS64
//sysnb Getpgid(pid int) (pgid int, err error)
diff --git a/unix/zsyscall_linux.go b/unix/zsyscall_linux.go
index 198b4ac..bc4a275 100644
--- a/unix/zsyscall_linux.go
+++ b/unix/zsyscall_linux.go
@@ -828,6 +828,49 @@
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+func Fsmount(fd int, flags int, mountAttrs int) (fsfd int, err error) {
+ r0, _, e1 := Syscall(SYS_FSMOUNT, uintptr(fd), uintptr(flags), uintptr(mountAttrs))
+ fsfd = int(r0)index c55b617..9962d26 100644
--- a/unix/ztypes_linux.go
+++ b/unix/ztypes_linux.go
@@ -764,6 +764,15 @@
MOVE_MOUNT_T_AUTOMOUNTS = 0x20
MOVE_MOUNT_T_EMPTY_PATH = 0x40
MOVE_MOUNT_SET_GROUP = 0x100
+
+ FSOPEN_CLOEXEC = 0x1
+
+ FSPICK_CLOEXEC = 0x1
+ FSPICK_SYMLINK_NOFOLLOW = 0x2
+ FSPICK_NO_AUTOMOUNT = 0x4
+ FSPICK_EMPTY_PATH = 0x8
+
+ FSMOUNT_CLOEXEC = 0x1
)
type OpenHow struct {
To view, visit change 398434. To unsubscribe, or for help writing mail filters, visit settings.
1 comment:
File unix/syscall_linux.go:
Patch Set #1, Line 1832: //sys Fsconfig(fd *int, cmd int, key string, value []byte, aux int) (err error)
My fault, sorry, infidelity it should be int, not a *int, I tried it in runc (https://github. […]
Ack
To view, visit change 398434. To unsubscribe, or for help writing mail filters, visit settings.