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 <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Benny Siegert <bsiegert@gmail.com>
This commit is contained in:
Alexey Perevalov 2022-04-04 16:35:58 +00:00 коммит произвёл Gopher Robot
Родитель 83041a38b1
Коммит 889880a91f
4 изменённых файлов: 64 добавлений и 0 удалений

Просмотреть файл

@ -914,6 +914,15 @@ const (
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

Просмотреть файл

@ -1829,6 +1829,9 @@ func Dup2(oldfd, newfd int) error {
//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)

Просмотреть файл

@ -828,6 +828,49 @@ func Fsync(fd int) (err error) {
// 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)
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 {

Просмотреть файл

@ -764,6 +764,15 @@ const (
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 {