sys: add statx syscall

The statx syscall was added in Linux 4.11, check out the kernel
documentation[1] for more information.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a528d35e8bfcc521d7cb70aaf03e1bd296c8493f

Signed-off-by: Jess Frazelle <acidburn@google.com>
This commit is contained in:
Jess Frazelle 2017-05-31 15:32:48 -04:00
parent 536006ee07
commit b44d379ad7
No known key found for this signature in database
GPG Key ID: 18F3685C0022BFF3
4 changed files with 99 additions and 0 deletions

View File

@ -97,6 +97,7 @@ vmsplice(fd fd, vec ptr[in, array[iovec_in]], vlen len[vec], f flags[splice_flag
sendfile(fdout fd, fdin fd, off ptr[inout, fileoff[int64], opt], count int64)
stat(file ptr[in, filename], statbuf ptr[out, stat])
statx(dfd int64, file ptr[in, filename], flags flags[statx_flags], mask flags[statx_mask], statxbuf ptr[out, statx])
lstat(file ptr[in, filename], statbuf ptr[out, stat])
fstat(fd fd, statbuf ptr[out, stat])
@ -543,6 +544,30 @@ stat {
pad2 int32
}
statx {
mask int32
blksize int32
attributes int64
nlink int32
uid int32
gid int32
mode int16
__spare0 int16
ino int64
size int64
blocks int64
__spare1 int64
atime statx_timestamp
btime statx_timestamp
ctime statx_timestamp
mtime statx_timestamp
rdev_major int32
rdev_minor int32
dev_major int32
dev_minor int32
__spare2 array[int64, 14]
}
pollfd {
fd fd
events flags[pollfd_events, int16]
@ -564,6 +589,12 @@ timespec {
nsec intptr
}
statx_timestamp {
sec int64
nsec int32
__reserved int32
}
# prog knowns about this struct type
timeval {
sec intptr
@ -937,6 +968,8 @@ renameat2_flags = RENAME_EXCHANGE, RENAME_NOREPLACE, RENAME_WHITEOUT
flock_op = LOCK_SH, LOCK_EX, LOCK_UN, LOCK_NB
seccomp_op = SECCOMP_SET_MODE_STRICT, SECCOMP_SET_MODE_FILTER
seccomp_flags = 0, SECCOMP_FILTER_FLAG_TSYNC
statx_flags = STATX_ATTR_COMPRESSED, STATX_ATTR_IMMUTABLE, STATX_ATTR_APPEND, STATX_ATTR_NODUMP, STATX_ATTR_ENCRYPTED, KSTAT_ATTR_FS_IOC_FLAGS, STATX_ATTR_AUTOMOUNT
statx_mask = STATX_TYPE, STATX_MODE, STATX_NLINK, STATX_UID, STATX_GID, STATX_ATIME, STATX_MTIME, STATX_CTIME, STATX_INO, STATX_SIZE, STATX_BLOCKS, STATX_BASIC_STATS, STATX_BTIME, STATX_ALL
name_to_handle_at_flags = AT_EMPTY_PATH, AT_SYMLINK_FOLLOW
mq_open_flags = O_RDONLY, O_WRONLY, O_RDWR, O_NONBLOCK, O_CREAT, O_EXCL, O_CREAT
mount_flags = MS_BIND, MS_DIRSYNC, MS_MANDLOCK, MS_MOVE, MS_NOATIME, MS_NODEV, MS_NODIRATIME, MS_NOEXEC, MS_NOSUID, MS_RDONLY, MS_RELATIME, MS_REMOUNT, MS_SILENT, MS_STRICTATIME, MS_SYNCHRONOUS, MS_REC, MS_POSIXACL, MS_UNBINDABLE, MS_PRIVATE, MS_SLAVE, MS_SHARED, MS_I_VERSION, MS_LAZYTIME

View File

@ -200,6 +200,7 @@ KEXEC_ARCH_SH = 2752512
KEXEC_ARCH_X86_64 = 4063232
KEXEC_ON_CRASH = 1
KEXEC_PRESERVE_CONTEXT = 2
KSTAT_ATTR_FS_IOC_FLAGS = 2164
LOCK_EX = 2
LOCK_NB = 4
LOCK_SH = 1
@ -522,6 +523,26 @@ SPLICE_F_GIFT = 8
SPLICE_F_MORE = 4
SPLICE_F_MOVE = 1
SPLICE_F_NONBLOCK = 2
STATX_ALL = 4095
STATX_ATIME = 32
STATX_ATTR_APPEND = 32
STATX_ATTR_AUTOMOUNT = 4096
STATX_ATTR_COMPRESSED = 4
STATX_ATTR_ENCRYPTED = 2048
STATX_ATTR_IMMUTABLE = 16
STATX_ATTR_NODUMP = 64
STATX_BASIC_STATS = 2047
STATX_BLOCKS = 1024
STATX_BTIME = 2048
STATX_CTIME = 128
STATX_GID = 16
STATX_INO = 256
STATX_MODE = 2
STATX_MTIME = 64
STATX_NLINK = 4
STATX_SIZE = 512
STATX_TYPE = 1
STATX_UID = 8
STICKY_TIMEOUTS = 67108864
SYNC_FILE_RANGE_WAIT_AFTER = 4
SYNC_FILE_RANGE_WAIT_BEFORE = 1
@ -793,6 +814,7 @@ __NR_signalfd4 = 289
__NR_splice = 275
__NR_stat = 4
__NR_statfs = 137
__NR_statx = 332
__NR_symlink = 88
__NR_symlinkat = 266
__NR_sync = 162

View File

@ -200,6 +200,7 @@ KEXEC_ARCH_SH = 2752512
KEXEC_ARCH_X86_64 = 4063232
KEXEC_ON_CRASH = 1
KEXEC_PRESERVE_CONTEXT = 2
KSTAT_ATTR_FS_IOC_FLAGS = 2164
LOCK_EX = 2
LOCK_NB = 4
LOCK_SH = 1
@ -515,6 +516,26 @@ SPLICE_F_GIFT = 8
SPLICE_F_MORE = 4
SPLICE_F_MOVE = 1
SPLICE_F_NONBLOCK = 2
STATX_ALL = 4095
STATX_ATIME = 32
STATX_ATTR_APPEND = 32
STATX_ATTR_AUTOMOUNT = 4096
STATX_ATTR_COMPRESSED = 4
STATX_ATTR_ENCRYPTED = 2048
STATX_ATTR_IMMUTABLE = 16
STATX_ATTR_NODUMP = 64
STATX_BASIC_STATS = 2047
STATX_BLOCKS = 1024
STATX_BTIME = 2048
STATX_CTIME = 128
STATX_GID = 16
STATX_INO = 256
STATX_MODE = 2
STATX_MTIME = 64
STATX_NLINK = 4
STATX_SIZE = 512
STATX_TYPE = 1
STATX_UID = 8
STICKY_TIMEOUTS = 67108864
SYNC_FILE_RANGE_WAIT_AFTER = 4
SYNC_FILE_RANGE_WAIT_BEFORE = 1
@ -752,6 +773,7 @@ __NR_sigaltstack = 132
__NR_signalfd4 = 74
__NR_splice = 76
__NR_statfs = 43
__NR_statx = 291
__NR_symlinkat = 36
__NR_sync = 81
__NR_sync_file_range = 84

View File

@ -200,6 +200,7 @@ KEXEC_ARCH_SH = 2752512
KEXEC_ARCH_X86_64 = 4063232
KEXEC_ON_CRASH = 1
KEXEC_PRESERVE_CONTEXT = 2
KSTAT_ATTR_FS_IOC_FLAGS = 2164
LOCK_EX = 2
LOCK_NB = 4
LOCK_SH = 1
@ -519,6 +520,26 @@ SPLICE_F_GIFT = 8
SPLICE_F_MORE = 4
SPLICE_F_MOVE = 1
SPLICE_F_NONBLOCK = 2
STATX_ALL = 4095
STATX_ATIME = 32
STATX_ATTR_APPEND = 32
STATX_ATTR_AUTOMOUNT = 4096
STATX_ATTR_COMPRESSED = 4
STATX_ATTR_ENCRYPTED = 2048
STATX_ATTR_IMMUTABLE = 16
STATX_ATTR_NODUMP = 64
STATX_BASIC_STATS = 2047
STATX_BLOCKS = 1024
STATX_BTIME = 2048
STATX_CTIME = 128
STATX_GID = 16
STATX_INO = 256
STATX_MODE = 2
STATX_MTIME = 64
STATX_NLINK = 4
STATX_SIZE = 512
STATX_TYPE = 1
STATX_UID = 8
STICKY_TIMEOUTS = 67108864
SYNC_FILE_RANGE_WAIT_AFTER = 4
SYNC_FILE_RANGE_WAIT_BEFORE = 1
@ -784,6 +805,7 @@ __NR_signalfd4 = 313
__NR_splice = 283
__NR_stat = 106
__NR_statfs = 99
__NR_statx = 383
__NR_symlink = 83
__NR_symlinkat = 295
__NR_sync = 36