2017-04-06 14:15:45 +00:00
|
|
|
.\" Copyright (c) 2017 David Howells <dhowells@redhat.com>
|
|
|
|
.\"
|
|
|
|
.\" Derived from the stat.2 manual page:
|
|
|
|
.\" Copyright (c) 1992 Drew Eckhardt (drew@cs.colorado.edu), March 28, 1992
|
|
|
|
.\" Parts Copyright (c) 1995 Nicolai Langfeldt (janl@ifi.uio.no), 1/1/95
|
|
|
|
.\" and Copyright (c) 2006, 2007, 2014 Michael Kerrisk <mtk.manpages@gmail.com>
|
|
|
|
.\"
|
|
|
|
.\" %%%LICENSE_START(VERBATIM)
|
|
|
|
.\" Permission is granted to make and distribute verbatim copies of this
|
|
|
|
.\" manual provided the copyright notice and this permission notice are
|
|
|
|
.\" preserved on all copies.
|
|
|
|
.\"
|
|
|
|
.\" Permission is granted to copy and distribute modified versions of this
|
|
|
|
.\" manual under the conditions for verbatim copying, provided that the
|
|
|
|
.\" entire resulting derived work is distributed under the terms of a
|
|
|
|
.\" permission notice identical to this one.
|
|
|
|
.\"
|
|
|
|
.\" Since the Linux kernel and libraries are constantly changing, this
|
|
|
|
.\" manual page may be incorrect or out-of-date. The author(s) assume no
|
|
|
|
.\" responsibility for errors or omissions, or for damages resulting from
|
|
|
|
.\" the use of the information contained herein. The author(s) may not
|
|
|
|
.\" have taken the same level of care in the production of this manual,
|
|
|
|
.\" which is licensed free of charge, as they might when working
|
|
|
|
.\" professionally.
|
|
|
|
.\"
|
|
|
|
.\" Formatted or processed versions of this manual, if unaccompanied by
|
|
|
|
.\" the source, must acknowledge the copyright and authors of this work.
|
|
|
|
.\" %%%LICENSE_END
|
|
|
|
.\"
|
intro.1, clock_getres.2, execve.2, fcntl.2, iopl.2, lseek.2, mknod.2, mmap.2, mount.2, mq_getsetattr.2, pidfd_open.2, prctl.2, setns.2, sgetmask.2, sigaction.2, stat.2, statx.2, sync.2, syscalls.2, syslog.2, timerfd_create.2, umask.2, a64l.3, aio_init.3, atoi.3, dladdr.3, fread.3, getpt.3, isfdtype.3, malloc_stats.3, malloc_trim.3, mkfifo.3, mq_close.3, mq_open.3, mq_receive.3, mq_send.3, mq_unlink.3, posix_memalign.3, posix_openpt.3, pthread_atfork.3, pthread_rwlockattr_setkind_np.3, regex.3, scanf.3, sem_close.3, sem_destroy.3, sem_init.3, sem_open.3, sem_post.3, sem_unlink.3, sigset.3, sigvec.3, strftime.3, termios.3, console_codes.4, dsp56k.4, fd.4, lp.4, mouse.4, pts.4, sk98lin.4, dir_colors.5, proc.5, resolv.conf.5, termcap.5, utmp.5, aio.7, armscii-8.7, arp.7, capabilities.7, cgroups.7, charsets.7, cp1251.7, cp1252.7, environ.7, glob.7, inode.7, iso_8859-1.7, iso_8859-10.7, iso_8859-11.7, iso_8859-13.7, iso_8859-14.7, iso_8859-15.7, iso_8859-16.7, iso_8859-2.7, iso_8859-3.7, iso_8859-4.7, iso_8859-5.7, iso_8859-6.7, iso_8859-7.7, iso_8859-8.7, iso_8859-9.7, keyrings.7, koi8-r.7, koi8-u.7, mailaddr.7, man-pages.7, netdevice.7, operator.7, persistent-keyring.7, process-keyring.7, pthreads.7, pty.7, raw.7, regex.7, session-keyring.7, shm_overview.7, signal.7, socket.7, suffixes.7, thread-keyring.7, unicode.7, units.7, uri.7, user-keyring.7, user-session-keyring.7, iconvconfig.8, ld.so.8, zic.8: tstamp
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-13 08:01:14 +00:00
|
|
|
.TH STATX 2 2020-08-13 "Linux" "Linux Programmer's Manual"
|
2017-04-06 14:15:45 +00:00
|
|
|
.SH NAME
|
2017-04-22 19:15:56 +00:00
|
|
|
statx \- get file status (extended)
|
2017-04-06 14:15:45 +00:00
|
|
|
.SH SYNOPSIS
|
|
|
|
.nf
|
|
|
|
.B #include <sys/types.h>
|
|
|
|
.B #include <sys/stat.h>
|
|
|
|
.B #include <unistd.h>
|
|
|
|
.BR "#include <fcntl.h> " "/* Definition of AT_* constants */"
|
_syscall.2, clock_getres.2, clone.2, copy_file_range.2, create_module.2, delete_module.2, fallocate.2, futex.2, get_kernel_syms.2, get_robust_list.2, getcpu.2, getdents.2, gettid.2, gettimeofday.2, getunwind.2, init_module.2, io_cancel.2, io_destroy.2, io_getevents.2, io_setup.2, io_submit.2, ioctl_userfaultfd.2, ioprio_set.2, kcmp.2, kexec_load.2, keyctl.2, link.2, llseek.2, memfd_create.2, mmap.2, mq_getsetattr.2, msgctl.2, msgget.2, open_by_handle_at.2, outb.2, perf_event_open.2, pivot_root.2, process_vm_readv.2, query_module.2, readdir.2, recvmmsg.2, rename.2, request_key.2, restart_syscall.2, rt_sigqueueinfo.2, s390_pci_mmio_write.2, s390_runtime_instr.2, sched_setattr.2, seccomp.2, select.2, select_tut.2, send.2, sendmmsg.2, set_thread_area.2, set_tid_address.2, sgetmask.2, shmop.2, sigaction.2, sigprocmask.2, splice.2, spu_create.2, spu_run.2, statx.2, subpage_prot.2, sync_file_range.2, syscall.2, sysctl.2, sysfs.2, tee.2, timer_create.2, timer_delete.2, timer_getoverrun.2, timer_settime.2, tkill.2, uselib.2, utimensat.2, vmsplice.2, wait.2, aio_init.3, asinh.3, atan2.3, atanh.3, backtrace.3, basename.3, bswap.3, bzero.3, catgets.3, catopen.3, dladdr.3, dlsym.3, endian.3, envz_add.3, erf.3, erfc.3, error.3, ferror.3, ffs.3, fgetc.3, fmemopen.3, fopen.3, fopencookie.3, fseek.3, ftw.3, futimes.3, getdate.3, getenv.3, getline.3, getlogin.3, getrpcent.3, getsubopt.3, getutmp.3, getw.3, gnu_get_libc_version.3, inet_net_pton.3, isalpha.3, lio_listio.3, makedev.3, malloc_get_state.3, malloc_stats.3, malloc_trim.3, malloc_usable_size.3, matherr.3, memchr.3, nextup.3, ntp_gettime.3, posix_madvise.3, program_invocation_name.3, pthread_atfork.3, pthread_attr_setaffinity_np.3, pthread_attr_setdetachstate.3, pthread_attr_setguardsize.3, pthread_attr_setinheritsched.3, pthread_attr_setschedparam.3, pthread_attr_setschedpolicy.3, pthread_attr_setscope.3, pthread_attr_setstack.3, pthread_attr_setstackaddr.3, pthread_attr_setstacksize.3, pthread_cleanup_push_defer_np.3, pthread_detach.3, pthread_equal.3, pthread_exit.3, pthread_join.3, pthread_kill.3, pthread_kill_other_threads_np.3, pthread_rwlockattr_setkind_np.3, pthread_self.3, pthread_setcancelstate.3, pthread_setconcurrency.3, pthread_setschedprio.3, pthread_testcancel.3, pthread_tryjoin_np.3, pthread_yield.3, puts.3, random.3, random_r.3, rpc.3, sched_getcpu.3, setnetgrent.3, sigwait.3, stdin.3, strerror.3, strfmon.3, timeradd.3, tmpnam.3, toupper.3, towlower.3, towupper.3, ttyname.3, uselocale.3, xdr.3, dsp56k.4, sigevent.7, vdso.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-15 17:26:11 +00:00
|
|
|
.PP
|
2017-04-06 14:15:45 +00:00
|
|
|
.BI "int statx(int " dirfd ", const char *" pathname ", int " flags ","
|
2017-04-27 12:27:15 +00:00
|
|
|
.BI " unsigned int " mask ", struct statx *" statxbuf );
|
2017-04-06 14:15:45 +00:00
|
|
|
.fi
|
|
|
|
.SH DESCRIPTION
|
|
|
|
This function returns information about a file, storing it in the buffer
|
|
|
|
pointed to by
|
2017-04-27 12:27:15 +00:00
|
|
|
.IR statxbuf .
|
2017-04-23 10:05:25 +00:00
|
|
|
The returned buffer is a structure of the following type:
|
2017-04-06 14:15:45 +00:00
|
|
|
.PP
|
|
|
|
.in +4n
|
execve.2, ioctl_console.2, ioctl_iflags.2, ioctl_ns.2, ioctl_userfaultfd.2, kcmp.2, kexec_load.2, keyctl.2, link.2, listxattr.2, membarrier.2, memfd_create.2, mmap.2, modify_ldt.2, mprotect.2, msgctl.2, nanosleep.2, open_by_handle_at.2, perf_event_open.2, poll.2, posix_fadvise.2, process_vm_readv.2, ptrace.2, query_module.2, quotactl.2, readdir.2, readv.2, recv.2, recvmmsg.2, request_key.2, sched_rr_get_interval.2, sched_setaffinity.2, sched_setattr.2, sched_setscheduler.2, seccomp.2, select.2, select_tut.2, semctl.2, semop.2, send.2, sendmmsg.2, set_thread_area.2, setns.2, shmctl.2, shmget.2, sigaction.2, sigaltstack.2, signal.2, sigwaitinfo.2, stat.2, statfs.2, statx.2, sync_file_range.2, syscall.2, sysctl.2, sysinfo.2, tee.2, timer_create.2, timer_settime.2, timerfd_create.2, unshare.2, userfaultfd.2, ustat.2, utime.2, utimensat.2, vmsplice.2, wait.2, adjtime.3, aio_init.3, backtrace.3, basename.3, bswap.3, btree.3, clock_getcpuclockid.3, cmsg.3, confstr.3, dbopen.3, dl_iterate_phdr.3, dladdr.3, dlinfo.3, dlopen.3, duplocale.3, encrypt.3, end.3, endian.3, err.3, errno.3, ether_aton.3, fgetgrent.3, fgetpwent.3, fmemopen.3, frexp.3, ftime.3, fts.3, getaddrinfo.3, getaddrinfo_a.3, getdate.3, getfsent.3, getgrent.3, getgrent_r.3, getgrnam.3, getgrouplist.3, gethostbyname.3, getifaddrs.3, getipnodebyname.3, getmntent.3, getnameinfo.3, getnetent.3, getopt.3, getprotoent.3, getprotoent_r.3, getpw.3, getpwent.3, getpwent_r.3, getpwnam.3, getrpcent.3, getservent.3, getservent_r.3, getspnam.3, getttyent.3, glob.3, gnu_get_libc_version.3, hash.3, hsearch.3, if_nameindex.3, inet.3, inet_net_pton.3, inet_pton.3, insque.3, isalpha.3, makecontext.3, mallinfo.3, malloc_info.3, mallopt.3, matherr.3, mbstowcs.3, mcheck.3, memchr.3, mq_getattr.3, mq_open.3, mq_receive.3, mq_send.3, mtrace.3, newlocale.3, ntp_gettime.3, posix_openpt.3, printf.3, pthread_attr_init.3, pthread_attr_setschedparam.3, pthread_cancel.3, pthread_cleanup_push.3, pthread_cleanup_push_defer_np.3, pthread_create.3, pthread_getattr_default_np.3, pthread_getattr_np.3, pthread_getcpuclockid.3, pthread_setname_np.3, pthread_setschedparam.3, pthread_sigmask.3, pthread_tryjoin_np.3, readdir.3, realpath.3, recno.3, regex.3, rpc.3, scanf.3, sched_getcpu.3, sem_wait.3, setaliasent.3, sigqueue.3, statvfs.3, strcat.3, strcpy.3, strftime.3, strtok.3, strtol.3, strverscmp.3, toupper.3, ttyslot.3, xdr.3, fuse.4, loop.4, rtc.4, st.4, acct.5, core.5, elf.5, slabinfo.5, aio.7, arp.7, capabilities.7, cgroup_namespaces.7, cgroups.7, ddp.7, fanotify.7, feature_test_macros.7, inode.7, inotify.7, ip.7, keyrings.7, locale.7, mount_namespaces.7, namespaces.7, netdevice.7, netlink.7, packet.7, pkeys.7, pthreads.7, sched.7, session-keyring.7, sock_diag.7, socket.7, spufs.7, udplite.7, unix.7, user_namespaces.7, vdso.7, x25.7, ld.so.8: Use consistent markup for code snippets
Change .nf/.fi to .EX/.EE
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-18 19:52:46 +00:00
|
|
|
.EX
|
2017-04-06 14:15:45 +00:00
|
|
|
struct statx {
|
2017-04-21 14:51:52 +00:00
|
|
|
__u32 stx_mask; /* Mask of bits indicating
|
|
|
|
filled fields */
|
|
|
|
__u32 stx_blksize; /* Block size for filesystem I/O */
|
|
|
|
__u64 stx_attributes; /* Extra file attribute indicators */
|
|
|
|
__u32 stx_nlink; /* Number of hard links */
|
|
|
|
__u32 stx_uid; /* User ID of owner */
|
|
|
|
__u32 stx_gid; /* Group ID of owner */
|
|
|
|
__u16 stx_mode; /* File type and mode */
|
|
|
|
__u64 stx_ino; /* Inode number */
|
|
|
|
__u64 stx_size; /* Total size in bytes */
|
|
|
|
__u64 stx_blocks; /* Number of 512B blocks allocated */
|
2017-04-26 12:09:00 +00:00
|
|
|
__u64 stx_attributes_mask;
|
pldd.1, bpf.2, clone.2, dup.2, ioctl_fat.2, nfsservctl.2, open_by_handle_at.2, perf_event_open.2, pivot_root.2, request_key.2, sched_setaffinity.2, seccomp.2, select.2, statx.2, dl_iterate_phdr.3, dlinfo.3, dlopen.3, insque.3, newlocale.3, printf.3, pthread_setname_np.3, rpc.3, stdarg.3, strfmon.3, veth.4, proc.5, slabinfo.5, cgroup_namespaces.7, cgroups.7, cpuset.7, fanotify.7, inotify.7, mount_namespaces.7, sock_diag.7, user_namespaces.7, ld.so.8: Use \(aq instead of ' inside monospace fonts
Use \(aq to get an unslanted single quote inside monospace code
blocks. Using a simple ' results in a slanted quote inside PDFs.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-24 07:32:31 +00:00
|
|
|
/* Mask to show what\(aqs supported
|
2017-04-26 12:09:00 +00:00
|
|
|
in stx_attributes */
|
2017-04-21 14:42:39 +00:00
|
|
|
|
|
|
|
/* The following fields are file timestamps */
|
|
|
|
struct statx_timestamp stx_atime; /* Last access */
|
|
|
|
struct statx_timestamp stx_btime; /* Creation */
|
|
|
|
struct statx_timestamp stx_ctime; /* Last status change */
|
|
|
|
struct statx_timestamp stx_mtime; /* Last modification */
|
|
|
|
|
2017-04-25 11:05:15 +00:00
|
|
|
/* If this file represents a device, then the next two
|
|
|
|
fields contain the ID of the device */
|
2017-04-21 14:51:52 +00:00
|
|
|
__u32 stx_rdev_major; /* Major ID */
|
|
|
|
__u32 stx_rdev_minor; /* Minor ID */
|
2017-04-21 14:42:39 +00:00
|
|
|
|
|
|
|
/* The next two fields contain the ID of the device
|
2017-04-23 11:22:18 +00:00
|
|
|
containing the filesystem where the file resides */
|
2017-04-21 14:51:52 +00:00
|
|
|
__u32 stx_dev_major; /* Major ID */
|
|
|
|
__u32 stx_dev_minor; /* Minor ID */
|
2017-04-06 14:15:45 +00:00
|
|
|
};
|
execve.2, ioctl_console.2, ioctl_iflags.2, ioctl_ns.2, ioctl_userfaultfd.2, kcmp.2, kexec_load.2, keyctl.2, link.2, listxattr.2, membarrier.2, memfd_create.2, mmap.2, modify_ldt.2, mprotect.2, msgctl.2, nanosleep.2, open_by_handle_at.2, perf_event_open.2, poll.2, posix_fadvise.2, process_vm_readv.2, ptrace.2, query_module.2, quotactl.2, readdir.2, readv.2, recv.2, recvmmsg.2, request_key.2, sched_rr_get_interval.2, sched_setaffinity.2, sched_setattr.2, sched_setscheduler.2, seccomp.2, select.2, select_tut.2, semctl.2, semop.2, send.2, sendmmsg.2, set_thread_area.2, setns.2, shmctl.2, shmget.2, sigaction.2, sigaltstack.2, signal.2, sigwaitinfo.2, stat.2, statfs.2, statx.2, sync_file_range.2, syscall.2, sysctl.2, sysinfo.2, tee.2, timer_create.2, timer_settime.2, timerfd_create.2, unshare.2, userfaultfd.2, ustat.2, utime.2, utimensat.2, vmsplice.2, wait.2, adjtime.3, aio_init.3, backtrace.3, basename.3, bswap.3, btree.3, clock_getcpuclockid.3, cmsg.3, confstr.3, dbopen.3, dl_iterate_phdr.3, dladdr.3, dlinfo.3, dlopen.3, duplocale.3, encrypt.3, end.3, endian.3, err.3, errno.3, ether_aton.3, fgetgrent.3, fgetpwent.3, fmemopen.3, frexp.3, ftime.3, fts.3, getaddrinfo.3, getaddrinfo_a.3, getdate.3, getfsent.3, getgrent.3, getgrent_r.3, getgrnam.3, getgrouplist.3, gethostbyname.3, getifaddrs.3, getipnodebyname.3, getmntent.3, getnameinfo.3, getnetent.3, getopt.3, getprotoent.3, getprotoent_r.3, getpw.3, getpwent.3, getpwent_r.3, getpwnam.3, getrpcent.3, getservent.3, getservent_r.3, getspnam.3, getttyent.3, glob.3, gnu_get_libc_version.3, hash.3, hsearch.3, if_nameindex.3, inet.3, inet_net_pton.3, inet_pton.3, insque.3, isalpha.3, makecontext.3, mallinfo.3, malloc_info.3, mallopt.3, matherr.3, mbstowcs.3, mcheck.3, memchr.3, mq_getattr.3, mq_open.3, mq_receive.3, mq_send.3, mtrace.3, newlocale.3, ntp_gettime.3, posix_openpt.3, printf.3, pthread_attr_init.3, pthread_attr_setschedparam.3, pthread_cancel.3, pthread_cleanup_push.3, pthread_cleanup_push_defer_np.3, pthread_create.3, pthread_getattr_default_np.3, pthread_getattr_np.3, pthread_getcpuclockid.3, pthread_setname_np.3, pthread_setschedparam.3, pthread_sigmask.3, pthread_tryjoin_np.3, readdir.3, realpath.3, recno.3, regex.3, rpc.3, scanf.3, sched_getcpu.3, sem_wait.3, setaliasent.3, sigqueue.3, statvfs.3, strcat.3, strcpy.3, strftime.3, strtok.3, strtol.3, strverscmp.3, toupper.3, ttyslot.3, xdr.3, fuse.4, loop.4, rtc.4, st.4, acct.5, core.5, elf.5, slabinfo.5, aio.7, arp.7, capabilities.7, cgroup_namespaces.7, cgroups.7, ddp.7, fanotify.7, feature_test_macros.7, inode.7, inotify.7, ip.7, keyrings.7, locale.7, mount_namespaces.7, namespaces.7, netdevice.7, netlink.7, packet.7, pkeys.7, pthreads.7, sched.7, session-keyring.7, sock_diag.7, socket.7, spufs.7, udplite.7, unix.7, user_namespaces.7, vdso.7, x25.7, ld.so.8: Use consistent markup for code snippets
Change .nf/.fi to .EX/.EE
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-18 19:52:46 +00:00
|
|
|
.EE
|
2017-04-06 14:15:45 +00:00
|
|
|
.in
|
|
|
|
.PP
|
2017-04-21 14:42:39 +00:00
|
|
|
The file timestamps are structures of the following type:
|
2017-04-06 14:15:45 +00:00
|
|
|
.PP
|
|
|
|
.in +4n
|
execve.2, ioctl_console.2, ioctl_iflags.2, ioctl_ns.2, ioctl_userfaultfd.2, kcmp.2, kexec_load.2, keyctl.2, link.2, listxattr.2, membarrier.2, memfd_create.2, mmap.2, modify_ldt.2, mprotect.2, msgctl.2, nanosleep.2, open_by_handle_at.2, perf_event_open.2, poll.2, posix_fadvise.2, process_vm_readv.2, ptrace.2, query_module.2, quotactl.2, readdir.2, readv.2, recv.2, recvmmsg.2, request_key.2, sched_rr_get_interval.2, sched_setaffinity.2, sched_setattr.2, sched_setscheduler.2, seccomp.2, select.2, select_tut.2, semctl.2, semop.2, send.2, sendmmsg.2, set_thread_area.2, setns.2, shmctl.2, shmget.2, sigaction.2, sigaltstack.2, signal.2, sigwaitinfo.2, stat.2, statfs.2, statx.2, sync_file_range.2, syscall.2, sysctl.2, sysinfo.2, tee.2, timer_create.2, timer_settime.2, timerfd_create.2, unshare.2, userfaultfd.2, ustat.2, utime.2, utimensat.2, vmsplice.2, wait.2, adjtime.3, aio_init.3, backtrace.3, basename.3, bswap.3, btree.3, clock_getcpuclockid.3, cmsg.3, confstr.3, dbopen.3, dl_iterate_phdr.3, dladdr.3, dlinfo.3, dlopen.3, duplocale.3, encrypt.3, end.3, endian.3, err.3, errno.3, ether_aton.3, fgetgrent.3, fgetpwent.3, fmemopen.3, frexp.3, ftime.3, fts.3, getaddrinfo.3, getaddrinfo_a.3, getdate.3, getfsent.3, getgrent.3, getgrent_r.3, getgrnam.3, getgrouplist.3, gethostbyname.3, getifaddrs.3, getipnodebyname.3, getmntent.3, getnameinfo.3, getnetent.3, getopt.3, getprotoent.3, getprotoent_r.3, getpw.3, getpwent.3, getpwent_r.3, getpwnam.3, getrpcent.3, getservent.3, getservent_r.3, getspnam.3, getttyent.3, glob.3, gnu_get_libc_version.3, hash.3, hsearch.3, if_nameindex.3, inet.3, inet_net_pton.3, inet_pton.3, insque.3, isalpha.3, makecontext.3, mallinfo.3, malloc_info.3, mallopt.3, matherr.3, mbstowcs.3, mcheck.3, memchr.3, mq_getattr.3, mq_open.3, mq_receive.3, mq_send.3, mtrace.3, newlocale.3, ntp_gettime.3, posix_openpt.3, printf.3, pthread_attr_init.3, pthread_attr_setschedparam.3, pthread_cancel.3, pthread_cleanup_push.3, pthread_cleanup_push_defer_np.3, pthread_create.3, pthread_getattr_default_np.3, pthread_getattr_np.3, pthread_getcpuclockid.3, pthread_setname_np.3, pthread_setschedparam.3, pthread_sigmask.3, pthread_tryjoin_np.3, readdir.3, realpath.3, recno.3, regex.3, rpc.3, scanf.3, sched_getcpu.3, sem_wait.3, setaliasent.3, sigqueue.3, statvfs.3, strcat.3, strcpy.3, strftime.3, strtok.3, strtol.3, strverscmp.3, toupper.3, ttyslot.3, xdr.3, fuse.4, loop.4, rtc.4, st.4, acct.5, core.5, elf.5, slabinfo.5, aio.7, arp.7, capabilities.7, cgroup_namespaces.7, cgroups.7, ddp.7, fanotify.7, feature_test_macros.7, inode.7, inotify.7, ip.7, keyrings.7, locale.7, mount_namespaces.7, namespaces.7, netdevice.7, netlink.7, packet.7, pkeys.7, pthreads.7, sched.7, session-keyring.7, sock_diag.7, socket.7, spufs.7, udplite.7, unix.7, user_namespaces.7, vdso.7, x25.7, ld.so.8: Use consistent markup for code snippets
Change .nf/.fi to .EX/.EE
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-18 19:52:46 +00:00
|
|
|
.EX
|
2017-04-06 14:15:45 +00:00
|
|
|
struct statx_timestamp {
|
2017-04-21 14:42:39 +00:00
|
|
|
__s64 tv_sec; /* Seconds since the Epoch (UNIX time) */
|
2017-04-26 12:09:00 +00:00
|
|
|
__u32 tv_nsec; /* Nanoseconds since tv_sec */
|
2017-04-06 14:15:45 +00:00
|
|
|
};
|
execve.2, ioctl_console.2, ioctl_iflags.2, ioctl_ns.2, ioctl_userfaultfd.2, kcmp.2, kexec_load.2, keyctl.2, link.2, listxattr.2, membarrier.2, memfd_create.2, mmap.2, modify_ldt.2, mprotect.2, msgctl.2, nanosleep.2, open_by_handle_at.2, perf_event_open.2, poll.2, posix_fadvise.2, process_vm_readv.2, ptrace.2, query_module.2, quotactl.2, readdir.2, readv.2, recv.2, recvmmsg.2, request_key.2, sched_rr_get_interval.2, sched_setaffinity.2, sched_setattr.2, sched_setscheduler.2, seccomp.2, select.2, select_tut.2, semctl.2, semop.2, send.2, sendmmsg.2, set_thread_area.2, setns.2, shmctl.2, shmget.2, sigaction.2, sigaltstack.2, signal.2, sigwaitinfo.2, stat.2, statfs.2, statx.2, sync_file_range.2, syscall.2, sysctl.2, sysinfo.2, tee.2, timer_create.2, timer_settime.2, timerfd_create.2, unshare.2, userfaultfd.2, ustat.2, utime.2, utimensat.2, vmsplice.2, wait.2, adjtime.3, aio_init.3, backtrace.3, basename.3, bswap.3, btree.3, clock_getcpuclockid.3, cmsg.3, confstr.3, dbopen.3, dl_iterate_phdr.3, dladdr.3, dlinfo.3, dlopen.3, duplocale.3, encrypt.3, end.3, endian.3, err.3, errno.3, ether_aton.3, fgetgrent.3, fgetpwent.3, fmemopen.3, frexp.3, ftime.3, fts.3, getaddrinfo.3, getaddrinfo_a.3, getdate.3, getfsent.3, getgrent.3, getgrent_r.3, getgrnam.3, getgrouplist.3, gethostbyname.3, getifaddrs.3, getipnodebyname.3, getmntent.3, getnameinfo.3, getnetent.3, getopt.3, getprotoent.3, getprotoent_r.3, getpw.3, getpwent.3, getpwent_r.3, getpwnam.3, getrpcent.3, getservent.3, getservent_r.3, getspnam.3, getttyent.3, glob.3, gnu_get_libc_version.3, hash.3, hsearch.3, if_nameindex.3, inet.3, inet_net_pton.3, inet_pton.3, insque.3, isalpha.3, makecontext.3, mallinfo.3, malloc_info.3, mallopt.3, matherr.3, mbstowcs.3, mcheck.3, memchr.3, mq_getattr.3, mq_open.3, mq_receive.3, mq_send.3, mtrace.3, newlocale.3, ntp_gettime.3, posix_openpt.3, printf.3, pthread_attr_init.3, pthread_attr_setschedparam.3, pthread_cancel.3, pthread_cleanup_push.3, pthread_cleanup_push_defer_np.3, pthread_create.3, pthread_getattr_default_np.3, pthread_getattr_np.3, pthread_getcpuclockid.3, pthread_setname_np.3, pthread_setschedparam.3, pthread_sigmask.3, pthread_tryjoin_np.3, readdir.3, realpath.3, recno.3, regex.3, rpc.3, scanf.3, sched_getcpu.3, sem_wait.3, setaliasent.3, sigqueue.3, statvfs.3, strcat.3, strcpy.3, strftime.3, strtok.3, strtol.3, strverscmp.3, toupper.3, ttyslot.3, xdr.3, fuse.4, loop.4, rtc.4, st.4, acct.5, core.5, elf.5, slabinfo.5, aio.7, arp.7, capabilities.7, cgroup_namespaces.7, cgroups.7, ddp.7, fanotify.7, feature_test_macros.7, inode.7, inotify.7, ip.7, keyrings.7, locale.7, mount_namespaces.7, namespaces.7, netdevice.7, netlink.7, packet.7, pkeys.7, pthreads.7, sched.7, session-keyring.7, sock_diag.7, socket.7, spufs.7, udplite.7, unix.7, user_namespaces.7, vdso.7, x25.7, ld.so.8: Use consistent markup for code snippets
Change .nf/.fi to .EX/.EE
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-18 19:52:46 +00:00
|
|
|
.EE
|
2017-04-06 14:15:45 +00:00
|
|
|
.in
|
|
|
|
.PP
|
2017-04-23 11:22:18 +00:00
|
|
|
(Note that reserved space and padding is omitted.)
|
2017-04-06 14:15:45 +00:00
|
|
|
.SS
|
|
|
|
Invoking \fBstatx\fR():
|
2017-04-21 14:44:51 +00:00
|
|
|
To access a file's status, no permissions are required on the file itself,
|
|
|
|
but in the case of
|
2017-04-06 14:15:45 +00:00
|
|
|
.BR statx ()
|
2017-04-22 19:15:56 +00:00
|
|
|
with a pathname,
|
2017-04-21 14:44:51 +00:00
|
|
|
execute (search) permission is required on all of the directories in
|
2017-04-06 14:15:45 +00:00
|
|
|
.I pathname
|
|
|
|
that lead to the file.
|
|
|
|
.PP
|
|
|
|
.BR statx ()
|
|
|
|
uses
|
2017-04-21 14:42:39 +00:00
|
|
|
.IR pathname ,
|
|
|
|
.IR dirfd ,
|
|
|
|
and
|
|
|
|
.IR flags
|
2017-04-25 19:39:56 +00:00
|
|
|
to identify the target file in one of the following ways:
|
2017-04-06 14:15:45 +00:00
|
|
|
.TP
|
2017-04-23 11:09:43 +00:00
|
|
|
An absolute pathname
|
|
|
|
If
|
2017-04-06 14:15:45 +00:00
|
|
|
.I pathname
|
2017-04-23 11:09:43 +00:00
|
|
|
begins with a slash,
|
|
|
|
then it is an absolute pathname that identifies the target file.
|
|
|
|
In this case,
|
2017-04-06 14:15:45 +00:00
|
|
|
.I dirfd
|
2017-04-21 14:44:51 +00:00
|
|
|
is ignored.
|
2017-04-06 14:15:45 +00:00
|
|
|
.TP
|
2017-04-23 11:09:43 +00:00
|
|
|
A relative pathname
|
|
|
|
If
|
2017-04-06 14:15:45 +00:00
|
|
|
.I pathname
|
2017-04-23 11:09:43 +00:00
|
|
|
is a string that begins with a character other than a slash and
|
2017-04-21 14:42:39 +00:00
|
|
|
.IR dirfd
|
|
|
|
is
|
2017-04-23 11:09:43 +00:00
|
|
|
.BR AT_FDCWD ,
|
|
|
|
then
|
|
|
|
.I pathname
|
|
|
|
is a relative pathname that is interpreted relative to the process's
|
|
|
|
current working directory.
|
2017-04-06 14:15:45 +00:00
|
|
|
.TP
|
2017-04-26 12:09:00 +00:00
|
|
|
A directory-relative pathname
|
2017-04-23 11:09:43 +00:00
|
|
|
If
|
2017-04-06 14:15:45 +00:00
|
|
|
.I pathname
|
2017-04-23 11:09:43 +00:00
|
|
|
is a string that begins with a character other than a slash and
|
2017-04-06 14:15:45 +00:00
|
|
|
.I dirfd
|
2017-04-23 11:09:43 +00:00
|
|
|
is a file descriptor that refers to a directory, then
|
|
|
|
.I pathname
|
|
|
|
is a relative pathname that is interpreted relative to the directory
|
|
|
|
referred to by
|
2017-04-06 14:15:45 +00:00
|
|
|
.IR dirfd .
|
|
|
|
.TP
|
2017-04-23 11:09:43 +00:00
|
|
|
By file descriptor
|
|
|
|
If
|
2017-04-21 14:51:52 +00:00
|
|
|
.IR pathname
|
2017-04-27 12:20:52 +00:00
|
|
|
is an empty string and the
|
2017-04-23 11:09:43 +00:00
|
|
|
.B AT_EMPTY_PATH
|
2017-04-27 12:20:52 +00:00
|
|
|
flag is specified in
|
|
|
|
.IR flags
|
|
|
|
(see below),
|
|
|
|
then the target file is the one referred to by the file descriptor
|
|
|
|
.IR dirfd .
|
2017-04-06 14:15:45 +00:00
|
|
|
.PP
|
|
|
|
.I flags
|
2017-04-22 19:15:56 +00:00
|
|
|
can be used to influence a pathname-based lookup.
|
2017-04-21 14:44:51 +00:00
|
|
|
A value for
|
2017-04-06 14:15:45 +00:00
|
|
|
.I flags
|
2017-04-23 10:05:25 +00:00
|
|
|
is constructed by ORing together zero or more of the following constants:
|
2017-04-06 14:15:45 +00:00
|
|
|
.TP
|
|
|
|
.BR AT_EMPTY_PATH
|
|
|
|
.\" commit 65cfc6722361570bfe255698d9cd4dccaf47570d
|
|
|
|
If
|
|
|
|
.I pathname
|
|
|
|
is an empty string, operate on the file referred to by
|
|
|
|
.IR dirfd
|
|
|
|
(which may have been obtained using the
|
|
|
|
.BR open (2)
|
|
|
|
.B O_PATH
|
|
|
|
flag).
|
2017-04-27 12:20:52 +00:00
|
|
|
In this case,
|
|
|
|
.I dirfd
|
|
|
|
can refer to any type of file, not just a directory.
|
_syscall.2, bpf.2, cacheflush.2, capget.2, chdir.2, chmod.2, chroot.2, clock_getres.2, clock_nanosleep.2, clone.2, close.2, connect.2, copy_file_range.2, create_module.2, delete_module.2, dup.2, epoll_create.2, epoll_ctl.2, epoll_wait.2, eventfd.2, execve.2, execveat.2, fallocate.2, flock.2, fork.2, fsync.2, futex.2, futimesat.2, get_kernel_syms.2, get_mempolicy.2, get_robust_list.2, getcpu.2, getdents.2, getdomainname.2, getgid.2, getgroups.2, gethostname.2, getitimer.2, getpagesize.2, getpeername.2, getpriority.2, getrandom.2, getresuid.2, getrlimit.2, getrusage.2, getsid.2, getsockname.2, getsockopt.2, gettid.2, gettimeofday.2, getuid.2, getunwind.2, init_module.2, inotify_add_watch.2, inotify_init.2, inotify_rm_watch.2, intro.2, io_cancel.2, io_destroy.2, io_getevents.2, io_setup.2, io_submit.2, ioctl_fat.2, ioctl_ficlonerange.2, ioctl_fideduperange.2, ioctl_tty.2, ioctl_userfaultfd.2, ioperm.2, iopl.2, ioprio_set.2, kcmp.2, kexec_load.2, keyctl.2, kill.2, link.2, listen.2, listxattr.2, llseek.2, lookup_dcookie.2, lseek.2, madvise.2, mbind.2, membarrier.2, memfd_create.2, migrate_pages.2, mincore.2, mkdir.2, mknod.2, mlock.2, mmap.2, mmap2.2, modify_ldt.2, move_pages.2, mprotect.2, mq_getsetattr.2, mremap.2, msgctl.2, msgget.2, msgop.2, msync.2, nanosleep.2, nfsservctl.2, nice.2, open_by_handle_at.2, outb.2, perf_event_open.2, perfmonctl.2, personality.2, pivot_root.2, pkey_alloc.2, poll.2, posix_fadvise.2, prctl.2, pread.2, process_vm_readv.2, ptrace.2, query_module.2, quotactl.2, read.2, readahead.2, readdir.2, readv.2, reboot.2, recv.2, recvmmsg.2, remap_file_pages.2, rename.2, request_key.2, restart_syscall.2, rt_sigqueueinfo.2, s390_pci_mmio_write.2, s390_runtime_instr.2, sched_get_priority_max.2, sched_rr_get_interval.2, sched_setaffinity.2, sched_setattr.2, sched_setparam.2, sched_setscheduler.2, sched_yield.2, seccomp.2, select.2, select_tut.2, semctl.2, semget.2, semop.2, send.2, sendfile.2, sendmmsg.2, set_mempolicy.2, set_thread_area.2, set_tid_address.2, seteuid.2, setfsgid.2, setfsuid.2, setgid.2, setns.2, setpgid.2, setresuid.2, setreuid.2, setsid.2, setuid.2, sgetmask.2, shmctl.2, shmget.2, shmop.2, sigaction.2, sigaltstack.2, sigpending.2, sigprocmask.2, sigreturn.2, sigsuspend.2, sigwaitinfo.2, socket.2, socketcall.2, socketpair.2, splice.2, spu_create.2, spu_run.2, stat.2, statfs.2, statx.2, subpage_prot.2, swapon.2, symlink.2, sync.2, sync_file_range.2, syscalls.2, sysctl.2, sysinfo.2, syslog.2, tee.2, time.2, timer_create.2, timer_getoverrun.2, timer_settime.2, timerfd_create.2, times.2, tkill.2, truncate.2, umask.2, umount.2, unimplemented.2, unlink.2, unshare.2, uselib.2, userfaultfd.2, utime.2, utimensat.2, vfork.2, vmsplice.2, wait.2, wait4.2, write.2: Formatting fix: replace blank lines with .PP/.IP
Blank lines shouldn't generally appear in *roff source (other
than in code examples), since they create large vertical
spaces between text blocks.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-16 07:30:51 +00:00
|
|
|
.IP
|
2017-04-06 14:15:45 +00:00
|
|
|
If
|
|
|
|
.I dirfd
|
|
|
|
is
|
|
|
|
.BR AT_FDCWD ,
|
|
|
|
the call operates on the current working directory.
|
_syscall.2, bpf.2, cacheflush.2, capget.2, chdir.2, chmod.2, chroot.2, clock_getres.2, clock_nanosleep.2, clone.2, close.2, connect.2, copy_file_range.2, create_module.2, delete_module.2, dup.2, epoll_create.2, epoll_ctl.2, epoll_wait.2, eventfd.2, execve.2, execveat.2, fallocate.2, flock.2, fork.2, fsync.2, futex.2, futimesat.2, get_kernel_syms.2, get_mempolicy.2, get_robust_list.2, getcpu.2, getdents.2, getdomainname.2, getgid.2, getgroups.2, gethostname.2, getitimer.2, getpagesize.2, getpeername.2, getpriority.2, getrandom.2, getresuid.2, getrlimit.2, getrusage.2, getsid.2, getsockname.2, getsockopt.2, gettid.2, gettimeofday.2, getuid.2, getunwind.2, init_module.2, inotify_add_watch.2, inotify_init.2, inotify_rm_watch.2, intro.2, io_cancel.2, io_destroy.2, io_getevents.2, io_setup.2, io_submit.2, ioctl_fat.2, ioctl_ficlonerange.2, ioctl_fideduperange.2, ioctl_tty.2, ioctl_userfaultfd.2, ioperm.2, iopl.2, ioprio_set.2, kcmp.2, kexec_load.2, keyctl.2, kill.2, link.2, listen.2, listxattr.2, llseek.2, lookup_dcookie.2, lseek.2, madvise.2, mbind.2, membarrier.2, memfd_create.2, migrate_pages.2, mincore.2, mkdir.2, mknod.2, mlock.2, mmap.2, mmap2.2, modify_ldt.2, move_pages.2, mprotect.2, mq_getsetattr.2, mremap.2, msgctl.2, msgget.2, msgop.2, msync.2, nanosleep.2, nfsservctl.2, nice.2, open_by_handle_at.2, outb.2, perf_event_open.2, perfmonctl.2, personality.2, pivot_root.2, pkey_alloc.2, poll.2, posix_fadvise.2, prctl.2, pread.2, process_vm_readv.2, ptrace.2, query_module.2, quotactl.2, read.2, readahead.2, readdir.2, readv.2, reboot.2, recv.2, recvmmsg.2, remap_file_pages.2, rename.2, request_key.2, restart_syscall.2, rt_sigqueueinfo.2, s390_pci_mmio_write.2, s390_runtime_instr.2, sched_get_priority_max.2, sched_rr_get_interval.2, sched_setaffinity.2, sched_setattr.2, sched_setparam.2, sched_setscheduler.2, sched_yield.2, seccomp.2, select.2, select_tut.2, semctl.2, semget.2, semop.2, send.2, sendfile.2, sendmmsg.2, set_mempolicy.2, set_thread_area.2, set_tid_address.2, seteuid.2, setfsgid.2, setfsuid.2, setgid.2, setns.2, setpgid.2, setresuid.2, setreuid.2, setsid.2, setuid.2, sgetmask.2, shmctl.2, shmget.2, shmop.2, sigaction.2, sigaltstack.2, sigpending.2, sigprocmask.2, sigreturn.2, sigsuspend.2, sigwaitinfo.2, socket.2, socketcall.2, socketpair.2, splice.2, spu_create.2, spu_run.2, stat.2, statfs.2, statx.2, subpage_prot.2, swapon.2, symlink.2, sync.2, sync_file_range.2, syscalls.2, sysctl.2, sysinfo.2, syslog.2, tee.2, time.2, timer_create.2, timer_getoverrun.2, timer_settime.2, timerfd_create.2, times.2, tkill.2, truncate.2, umask.2, umount.2, unimplemented.2, unlink.2, unshare.2, uselib.2, userfaultfd.2, utime.2, utimensat.2, vfork.2, vmsplice.2, wait.2, wait4.2, write.2: Formatting fix: replace blank lines with .PP/.IP
Blank lines shouldn't generally appear in *roff source (other
than in code examples), since they create large vertical
spaces between text blocks.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-16 07:30:51 +00:00
|
|
|
.IP
|
2017-04-06 14:15:45 +00:00
|
|
|
This flag is Linux-specific; define
|
|
|
|
.B _GNU_SOURCE
|
|
|
|
.\" Before glibc 2.16, defining _ATFILE_SOURCE sufficed
|
|
|
|
to obtain its definition.
|
|
|
|
.TP
|
|
|
|
.BR AT_NO_AUTOMOUNT
|
|
|
|
Don't automount the terminal ("basename") component of
|
|
|
|
.I pathname
|
|
|
|
if it is a directory that is an automount point.
|
|
|
|
This allows the caller to gather attributes of an automount point
|
|
|
|
(rather than the location it would mount).
|
|
|
|
This flag can be used in tools that scan directories
|
|
|
|
to prevent mass-automounting of a directory of automount points.
|
|
|
|
The
|
|
|
|
.B AT_NO_AUTOMOUNT
|
|
|
|
flag has no effect if the mount point has already been mounted over.
|
|
|
|
This flag is Linux-specific; define
|
|
|
|
.B _GNU_SOURCE
|
|
|
|
.\" Before glibc 2.16, defining _ATFILE_SOURCE sufficed
|
|
|
|
to obtain its definition.
|
|
|
|
.TP
|
|
|
|
.B AT_SYMLINK_NOFOLLOW
|
|
|
|
If
|
|
|
|
.I pathname
|
|
|
|
is a symbolic link, do not dereference it:
|
|
|
|
instead return information about the link itself, like
|
2017-04-21 14:42:39 +00:00
|
|
|
.BR lstat (2).
|
2017-04-06 14:15:45 +00:00
|
|
|
.PP
|
|
|
|
.I flags
|
2017-04-21 14:44:51 +00:00
|
|
|
can also be used to control what sort of synchronization the kernel will do
|
|
|
|
when querying a file on a remote filesystem.
|
2017-04-23 10:05:25 +00:00
|
|
|
This is done by ORing in one of the following values:
|
2017-04-06 14:15:45 +00:00
|
|
|
.TP
|
2017-04-21 14:47:05 +00:00
|
|
|
.B AT_STATX_SYNC_AS_STAT
|
2017-04-06 14:15:45 +00:00
|
|
|
Do whatever
|
2017-04-21 14:42:39 +00:00
|
|
|
.BR stat (2)
|
2017-04-21 14:44:51 +00:00
|
|
|
does.
|
2017-04-25 19:39:56 +00:00
|
|
|
This is the default and is very much filesystem-specific.
|
2017-04-06 14:15:45 +00:00
|
|
|
.TP
|
2017-04-21 14:47:05 +00:00
|
|
|
.B AT_STATX_FORCE_SYNC
|
2017-04-22 18:55:24 +00:00
|
|
|
Force the attributes to be synchronized with the server.
|
2017-04-21 14:44:51 +00:00
|
|
|
This may require that
|
2017-04-06 14:15:45 +00:00
|
|
|
a network filesystem perform a data writeback to get the timestamps correct.
|
|
|
|
.TP
|
2017-04-21 14:47:05 +00:00
|
|
|
.B AT_STATX_DONT_SYNC
|
2017-04-22 18:55:24 +00:00
|
|
|
Don't synchronize anything, but rather just take whatever
|
2017-04-21 14:48:55 +00:00
|
|
|
the system has cached if possible.
|
2017-04-21 14:44:51 +00:00
|
|
|
This may mean that the information returned is approximate, but,
|
2017-04-06 14:15:45 +00:00
|
|
|
on a network filesystem, it may not involve a round trip to the server - even
|
|
|
|
if no lease is held.
|
|
|
|
.PP
|
|
|
|
The
|
|
|
|
.I mask
|
|
|
|
argument to
|
|
|
|
.BR statx ()
|
|
|
|
is used to tell the kernel which fields the caller is interested in.
|
|
|
|
.I mask
|
2017-04-23 10:05:25 +00:00
|
|
|
is an ORed combination of the following constants:
|
2017-04-06 14:15:45 +00:00
|
|
|
.PP
|
|
|
|
.in +4n
|
|
|
|
.TS
|
|
|
|
lB l.
|
|
|
|
STATX_TYPE Want stx_mode & S_IFMT
|
intro.1, clock_getres.2, clone.2, futex.2, ioctl_fat.2, mkdir.2, mknod.2, mmap.2, open.2, statx.2, umask.2, userfaultfd.2, glob.3, mkfifo.3, termios.3, wordexp.3, console_codes.4, sk98lin.4, vcs.4, dir_colors.5, hosts.equiv.5, proc.5, termcap.5, utmp.5, ascii.7, bpf-helpers.7, charsets.7, environ.7, glob.7, mailaddr.7, netlink.7, operator.7, suffixes.7, tcp.7, unicode.7, uri.7, zic.8: Use "\(ti" instead of "~"
A naked tilde ("~") renders poorly in PDF. Instead use "\(ti",
which renders better in a PDF, and produces the same glyph
when rendering on a terminal.
Reported-by: Geoff Clare <gwc@opengroup.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-06 19:43:46 +00:00
|
|
|
STATX_MODE Want stx_mode & \(tiS_IFMT
|
2017-04-06 14:15:45 +00:00
|
|
|
STATX_NLINK Want stx_nlink
|
|
|
|
STATX_UID Want stx_uid
|
|
|
|
STATX_GID Want stx_gid
|
2017-04-23 11:12:12 +00:00
|
|
|
STATX_ATIME Want stx_atime
|
|
|
|
STATX_MTIME Want stx_mtime
|
|
|
|
STATX_CTIME Want stx_ctime
|
2017-04-06 14:15:45 +00:00
|
|
|
STATX_INO Want stx_ino
|
|
|
|
STATX_SIZE Want stx_size
|
|
|
|
STATX_BLOCKS Want stx_blocks
|
|
|
|
STATX_BASIC_STATS [All of the above]
|
2017-04-23 11:12:12 +00:00
|
|
|
STATX_BTIME Want stx_btime
|
2017-04-06 14:15:45 +00:00
|
|
|
STATX_ALL [All currently available fields]
|
|
|
|
.TE
|
|
|
|
.in
|
|
|
|
.PP
|
2019-08-20 07:29:49 +00:00
|
|
|
Note that, in general, the kernel does
|
2017-04-23 11:15:33 +00:00
|
|
|
.I not
|
|
|
|
reject values in
|
|
|
|
.I mask
|
|
|
|
other than the above.
|
2019-08-20 07:29:49 +00:00
|
|
|
(For an exception, see
|
|
|
|
.B EINVAL
|
|
|
|
in errors.)
|
2017-04-23 11:15:33 +00:00
|
|
|
Instead, it simply informs the caller which values are supported
|
|
|
|
by this kernel and filesystem via the
|
|
|
|
.I statx.stx_mask
|
|
|
|
field.
|
|
|
|
Therefore,
|
|
|
|
.I "do not"
|
2017-04-06 14:15:45 +00:00
|
|
|
simply set
|
|
|
|
.I mask
|
2017-04-21 14:47:05 +00:00
|
|
|
to
|
|
|
|
.B UINT_MAX
|
2017-04-23 11:15:33 +00:00
|
|
|
(all bits set),
|
2017-04-21 14:47:05 +00:00
|
|
|
as one or more bits may, in the future, be used to specify an
|
2017-04-06 14:15:45 +00:00
|
|
|
extension to the buffer.
|
|
|
|
.SS
|
|
|
|
The returned information
|
|
|
|
The status information for the target file is returned in the
|
|
|
|
.I statx
|
|
|
|
structure pointed to by
|
2017-04-27 12:27:15 +00:00
|
|
|
.IR statxbuf .
|
2017-04-06 14:15:45 +00:00
|
|
|
Included in this is
|
|
|
|
.I stx_mask
|
|
|
|
which indicates what other information has been returned.
|
|
|
|
.I stx_mask
|
2017-04-23 11:22:18 +00:00
|
|
|
has the same format as the
|
|
|
|
.I mask
|
|
|
|
argument and bits are set in it to indicate
|
2017-04-06 14:15:45 +00:00
|
|
|
which fields have been filled in.
|
|
|
|
.PP
|
2017-04-21 14:48:55 +00:00
|
|
|
It should be noted that the kernel may return fields that weren't
|
|
|
|
requested and may fail to return fields that were requested,
|
|
|
|
depending on what the backing filesystem supports.
|
2017-04-26 19:09:00 +00:00
|
|
|
(Fields that are given values despite being unrequested can just be ignored.)
|
2017-04-21 14:44:51 +00:00
|
|
|
In either case,
|
2017-04-06 14:15:45 +00:00
|
|
|
.I stx_mask
|
|
|
|
will not be equal
|
|
|
|
.IR mask .
|
|
|
|
.PP
|
2017-04-21 14:48:55 +00:00
|
|
|
If a filesystem does not support a field or if it has
|
|
|
|
an unrepresentable value (for instance, a file with an exotic type),
|
|
|
|
then the mask bit corresponding to that field will be cleared in
|
2017-04-06 14:15:45 +00:00
|
|
|
.I stx_mask
|
|
|
|
even if the user asked for it and a dummy value will be filled in for
|
2017-04-22 19:15:56 +00:00
|
|
|
compatibility purposes if one is available (e.g., a dummy UID and GID may be
|
2017-04-06 14:15:45 +00:00
|
|
|
specified to mount under some circumstances).
|
|
|
|
.PP
|
|
|
|
A filesystem may also fill in fields that the caller didn't ask for if it has
|
2017-04-22 19:15:56 +00:00
|
|
|
values for them available and the information is available at no extra cost.
|
2017-04-21 14:44:51 +00:00
|
|
|
If this happens, the corresponding bits will be set in
|
2017-04-06 14:15:45 +00:00
|
|
|
.IR stx_mask .
|
|
|
|
.PP
|
|
|
|
.\" Background: inode attributes are modified with i_mutex held, but
|
|
|
|
.\" read by stat() without taking the mutex.
|
2017-04-22 19:15:56 +00:00
|
|
|
.IR Note :
|
|
|
|
for performance and simplicity reasons, different fields in the
|
2017-04-06 14:15:45 +00:00
|
|
|
.I statx
|
|
|
|
structure may contain state information from different moments
|
|
|
|
during the execution of the system call.
|
|
|
|
For example, if
|
|
|
|
.IR stx_mode
|
|
|
|
or
|
|
|
|
.IR stx_uid
|
|
|
|
is changed by another process by calling
|
|
|
|
.BR chmod (2)
|
|
|
|
or
|
|
|
|
.BR chown (2),
|
|
|
|
.BR stat ()
|
|
|
|
might return the old
|
|
|
|
.I stx_mode
|
|
|
|
together with the new
|
|
|
|
.IR stx_uid ,
|
|
|
|
or the old
|
|
|
|
.I stx_uid
|
|
|
|
together with the new
|
|
|
|
.IR stx_mode .
|
|
|
|
.PP
|
2017-04-21 14:51:52 +00:00
|
|
|
Apart from
|
|
|
|
.I stx_mask
|
|
|
|
(which is described above), the fields in the
|
2017-04-06 14:15:45 +00:00
|
|
|
.I statx
|
|
|
|
structure are:
|
|
|
|
.TP
|
2017-04-26 12:21:59 +00:00
|
|
|
.I stx_blksize
|
|
|
|
The "preferred" block size for efficient filesystem I/O.
|
|
|
|
(Writing to a file in
|
|
|
|
smaller chunks may cause an inefficient read-modify-rewrite.)
|
|
|
|
.TP
|
|
|
|
.I stx_attributes
|
|
|
|
Further status information about the file (see below for more information).
|
|
|
|
.TP
|
|
|
|
.I stx_nlink
|
|
|
|
The number of hard links on a file.
|
|
|
|
.TP
|
|
|
|
.I stx_uid
|
|
|
|
This field contains the user ID of the owner of the file.
|
|
|
|
.TP
|
|
|
|
.I stx_gid
|
|
|
|
This field contains the ID of the group owner of the file.
|
2017-04-26 12:09:00 +00:00
|
|
|
.TP
|
2017-04-06 14:15:45 +00:00
|
|
|
.I stx_mode
|
2017-04-21 14:44:51 +00:00
|
|
|
The file type and mode.
|
2017-04-22 19:50:10 +00:00
|
|
|
See
|
|
|
|
.BR inode (7)
|
|
|
|
for details.
|
2017-04-06 14:15:45 +00:00
|
|
|
.TP
|
2017-04-26 12:23:19 +00:00
|
|
|
.I stx_ino
|
|
|
|
The inode number of the file.
|
|
|
|
.TP
|
2017-04-06 14:15:45 +00:00
|
|
|
.I stx_size
|
|
|
|
The size of the file (if it is a regular file or a symbolic link) in bytes.
|
2017-04-21 14:48:55 +00:00
|
|
|
The size of a symbolic link is the length of the pathname it contains,
|
|
|
|
without a terminating null byte.
|
2017-04-06 14:15:45 +00:00
|
|
|
.TP
|
|
|
|
.I stx_blocks
|
|
|
|
The number of blocks allocated to the file on the medium, in 512-byte units.
|
|
|
|
(This may be smaller than
|
|
|
|
.IR stx_size /512
|
|
|
|
when the file has holes.)
|
|
|
|
.TP
|
2017-04-26 12:21:59 +00:00
|
|
|
.I stx_attributes_mask
|
|
|
|
A mask indicating which bits in
|
|
|
|
.IR stx_attributes
|
|
|
|
are supported by the VFS and the filesystem.
|
2017-04-06 14:15:45 +00:00
|
|
|
.TP
|
|
|
|
.I stx_atime
|
|
|
|
The file's last access timestamp.
|
|
|
|
.TP
|
|
|
|
.I stx_btime
|
2017-04-21 14:44:51 +00:00
|
|
|
The file's creation timestamp.
|
2017-04-06 14:15:45 +00:00
|
|
|
.TP
|
|
|
|
.I stx_ctime
|
2017-04-21 14:44:51 +00:00
|
|
|
The file's last status change timestamp.
|
2017-04-06 14:15:45 +00:00
|
|
|
.TP
|
|
|
|
.I stx_mtime
|
2017-04-21 14:44:51 +00:00
|
|
|
The file's last modification timestamp.
|
2017-04-26 12:21:59 +00:00
|
|
|
.TP
|
|
|
|
.IR stx_dev_major " and " stx_dev_minor
|
|
|
|
The device on which this file (inode) resides.
|
|
|
|
.TP
|
|
|
|
.IR stx_rdev_major " and " stx_rdev_minor
|
|
|
|
The device that this file (inode) represents if the file is of block or
|
|
|
|
character device type.
|
2017-04-06 14:15:45 +00:00
|
|
|
.PP
|
2017-04-22 19:50:10 +00:00
|
|
|
For further information on the above fields, see
|
|
|
|
.BR inode (7).
|
2017-04-21 14:44:51 +00:00
|
|
|
.\"
|
2017-04-06 14:15:45 +00:00
|
|
|
.SS File attributes
|
|
|
|
The
|
|
|
|
.I stx_attributes
|
2017-04-23 10:05:25 +00:00
|
|
|
field contains a set of ORed flags that indicate additional attributes
|
2017-04-26 12:09:00 +00:00
|
|
|
of the file.
|
|
|
|
Note that any attribute that is not indicated as supported by
|
|
|
|
.I stx_attributes_mask
|
|
|
|
has no usable value here.
|
|
|
|
The bits in
|
|
|
|
.I stx_attributes_mask
|
|
|
|
correspond bit-by-bit to
|
|
|
|
.IR stx_attributes .
|
_syscall.2, bpf.2, cacheflush.2, capget.2, chdir.2, chmod.2, chroot.2, clock_getres.2, clock_nanosleep.2, clone.2, close.2, connect.2, copy_file_range.2, create_module.2, delete_module.2, dup.2, epoll_create.2, epoll_ctl.2, epoll_wait.2, eventfd.2, execve.2, execveat.2, fallocate.2, flock.2, fork.2, fsync.2, futex.2, futimesat.2, get_kernel_syms.2, get_mempolicy.2, get_robust_list.2, getcpu.2, getdents.2, getdomainname.2, getgid.2, getgroups.2, gethostname.2, getitimer.2, getpagesize.2, getpeername.2, getpriority.2, getrandom.2, getresuid.2, getrlimit.2, getrusage.2, getsid.2, getsockname.2, getsockopt.2, gettid.2, gettimeofday.2, getuid.2, getunwind.2, init_module.2, inotify_add_watch.2, inotify_init.2, inotify_rm_watch.2, intro.2, io_cancel.2, io_destroy.2, io_getevents.2, io_setup.2, io_submit.2, ioctl_fat.2, ioctl_ficlonerange.2, ioctl_fideduperange.2, ioctl_tty.2, ioctl_userfaultfd.2, ioperm.2, iopl.2, ioprio_set.2, kcmp.2, kexec_load.2, keyctl.2, kill.2, link.2, listen.2, listxattr.2, llseek.2, lookup_dcookie.2, lseek.2, madvise.2, mbind.2, membarrier.2, memfd_create.2, migrate_pages.2, mincore.2, mkdir.2, mknod.2, mlock.2, mmap.2, mmap2.2, modify_ldt.2, move_pages.2, mprotect.2, mq_getsetattr.2, mremap.2, msgctl.2, msgget.2, msgop.2, msync.2, nanosleep.2, nfsservctl.2, nice.2, open_by_handle_at.2, outb.2, perf_event_open.2, perfmonctl.2, personality.2, pivot_root.2, pkey_alloc.2, poll.2, posix_fadvise.2, prctl.2, pread.2, process_vm_readv.2, ptrace.2, query_module.2, quotactl.2, read.2, readahead.2, readdir.2, readv.2, reboot.2, recv.2, recvmmsg.2, remap_file_pages.2, rename.2, request_key.2, restart_syscall.2, rt_sigqueueinfo.2, s390_pci_mmio_write.2, s390_runtime_instr.2, sched_get_priority_max.2, sched_rr_get_interval.2, sched_setaffinity.2, sched_setattr.2, sched_setparam.2, sched_setscheduler.2, sched_yield.2, seccomp.2, select.2, select_tut.2, semctl.2, semget.2, semop.2, send.2, sendfile.2, sendmmsg.2, set_mempolicy.2, set_thread_area.2, set_tid_address.2, seteuid.2, setfsgid.2, setfsuid.2, setgid.2, setns.2, setpgid.2, setresuid.2, setreuid.2, setsid.2, setuid.2, sgetmask.2, shmctl.2, shmget.2, shmop.2, sigaction.2, sigaltstack.2, sigpending.2, sigprocmask.2, sigreturn.2, sigsuspend.2, sigwaitinfo.2, socket.2, socketcall.2, socketpair.2, splice.2, spu_create.2, spu_run.2, stat.2, statfs.2, statx.2, subpage_prot.2, swapon.2, symlink.2, sync.2, sync_file_range.2, syscalls.2, sysctl.2, sysinfo.2, syslog.2, tee.2, time.2, timer_create.2, timer_getoverrun.2, timer_settime.2, timerfd_create.2, times.2, tkill.2, truncate.2, umask.2, umount.2, unimplemented.2, unlink.2, unshare.2, uselib.2, userfaultfd.2, utime.2, utimensat.2, vfork.2, vmsplice.2, wait.2, wait4.2, write.2: Formatting fix: replace blank lines with .PP/.IP
Blank lines shouldn't generally appear in *roff source (other
than in code examples), since they create large vertical
spaces between text blocks.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-16 07:30:51 +00:00
|
|
|
.PP
|
2017-04-26 12:09:00 +00:00
|
|
|
The flags are as follows:
|
2017-04-06 14:15:45 +00:00
|
|
|
.TP
|
2017-04-21 14:51:52 +00:00
|
|
|
.B STATX_ATTR_COMPRESSED
|
2017-04-25 19:39:56 +00:00
|
|
|
The file is compressed by the filesystem and may take extra resources
|
|
|
|
to access.
|
2017-04-06 14:15:45 +00:00
|
|
|
.TP
|
2017-04-21 14:51:52 +00:00
|
|
|
.B STATX_ATTR_IMMUTABLE
|
2017-04-21 14:48:55 +00:00
|
|
|
The file cannot be modified: it cannot be deleted or renamed,
|
|
|
|
no hard links can be created to this file and no data can be written to it.
|
2017-04-21 14:47:05 +00:00
|
|
|
See
|
|
|
|
.BR chattr (1).
|
2017-04-06 14:15:45 +00:00
|
|
|
.TP
|
2017-04-21 14:51:52 +00:00
|
|
|
.B STATX_ATTR_APPEND
|
2017-04-21 14:44:51 +00:00
|
|
|
The file can only be opened in append mode for writing.
|
|
|
|
Random access writing
|
|
|
|
is not permitted.
|
2017-04-21 14:47:05 +00:00
|
|
|
See
|
|
|
|
.BR chattr (1).
|
2017-04-06 14:15:45 +00:00
|
|
|
.TP
|
2017-04-21 14:51:52 +00:00
|
|
|
.B STATX_ATTR_NODUMP
|
2017-04-21 14:47:05 +00:00
|
|
|
File is not a candidate for backup when a backup program such as
|
|
|
|
.BR dump (8)
|
|
|
|
is run.
|
|
|
|
See
|
|
|
|
.BR chattr (1).
|
2017-04-06 14:15:45 +00:00
|
|
|
.TP
|
2017-04-21 14:51:52 +00:00
|
|
|
.B STATX_ATTR_ENCRYPTED
|
2017-04-06 14:15:45 +00:00
|
|
|
A key is required for the file to be encrypted by the filesystem.
|
2020-01-28 19:24:49 +00:00
|
|
|
.TP
|
2020-03-12 08:20:50 +00:00
|
|
|
.BR STATX_ATTR_VERITY " (since Linux 5.5)"
|
|
|
|
.\" commit 3ad2522c64cff1f5aebb987b00683268f0cc7c29
|
|
|
|
The file has fs-verity enabled.
|
|
|
|
It cannot be written to, and all reads from it will be verified
|
|
|
|
against a cryptographic hash that covers the
|
|
|
|
entire file (e.g., via a Merkle tree).
|
2020-05-05 00:20:16 +00:00
|
|
|
.TP
|
|
|
|
.BR STATX_ATTR_DAX (since Linux 5.8)
|
|
|
|
The file is in the DAX (cpu direct access) state. DAX state attempts to
|
|
|
|
minimize software cache effects for both I/O and memory mappings of this file.
|
|
|
|
It requires a file system which has been configured to support DAX.
|
|
|
|
.PP
|
|
|
|
DAX generally assumes all accesses are via cpu load / store instructions which
|
|
|
|
can minimize overhead for small accesses, but may adversely affect cpu
|
|
|
|
utilization for large transfers.
|
|
|
|
.PP
|
|
|
|
File I/O is done directly to/from user-space buffers and memory mapped I/O may
|
|
|
|
be performed with direct memory mappings that bypass kernel page cache.
|
|
|
|
.PP
|
|
|
|
While the DAX property tends to result in data being transferred synchronously,
|
|
|
|
it does not give the same guarantees of O_SYNC where data and the necessary
|
|
|
|
metadata are transferred together.
|
|
|
|
.PP
|
|
|
|
A DAX file may support being mapped with the MAP_SYNC flag, which enables a
|
|
|
|
program to use CPU cache flush instructions to persist CPU store operations
|
|
|
|
without an explicit
|
|
|
|
.BR fsync(2).
|
|
|
|
See
|
|
|
|
.BR mmap(2)
|
|
|
|
for more information.
|
2017-04-06 14:15:45 +00:00
|
|
|
.SH RETURN VALUE
|
|
|
|
On success, zero is returned.
|
|
|
|
On error, \-1 is returned, and
|
|
|
|
.I errno
|
|
|
|
is set appropriately.
|
|
|
|
.SH ERRORS
|
|
|
|
.TP
|
|
|
|
.B EACCES
|
|
|
|
Search permission is denied for one of the directories
|
|
|
|
in the path prefix of
|
|
|
|
.IR pathname .
|
|
|
|
(See also
|
|
|
|
.BR path_resolution (7).)
|
|
|
|
.TP
|
|
|
|
.B EBADF
|
|
|
|
.I dirfd
|
|
|
|
is not a valid open file descriptor.
|
|
|
|
.TP
|
|
|
|
.B EFAULT
|
2017-04-27 12:26:31 +00:00
|
|
|
.I pathname
|
|
|
|
or
|
2017-04-27 12:27:15 +00:00
|
|
|
.I statxbuf
|
2017-04-27 12:26:31 +00:00
|
|
|
is NULL or points to a location outside the process's
|
|
|
|
accessible address space.
|
2017-04-06 14:15:45 +00:00
|
|
|
.TP
|
2017-04-23 11:29:00 +00:00
|
|
|
.B EINVAL
|
|
|
|
Invalid flag specified in
|
|
|
|
.IR flags .
|
|
|
|
.TP
|
2017-04-26 12:09:00 +00:00
|
|
|
.B EINVAL
|
|
|
|
Reserved flag specified in
|
|
|
|
.IR mask .
|
2019-08-20 07:29:49 +00:00
|
|
|
(Currently, there is one such flag, designated by the constant
|
|
|
|
.BR STATX__RESERVED ,
|
|
|
|
with the value 0x80000000U.)
|
2017-04-26 12:09:00 +00:00
|
|
|
.TP
|
2017-04-06 14:15:45 +00:00
|
|
|
.B ELOOP
|
2017-04-22 19:15:56 +00:00
|
|
|
Too many symbolic links encountered while traversing the pathname.
|
2017-04-06 14:15:45 +00:00
|
|
|
.TP
|
|
|
|
.B ENAMETOOLONG
|
|
|
|
.I pathname
|
|
|
|
is too long.
|
|
|
|
.TP
|
|
|
|
.B ENOENT
|
|
|
|
A component of
|
|
|
|
.I pathname
|
|
|
|
does not exist, or
|
|
|
|
.I pathname
|
2017-04-23 10:05:25 +00:00
|
|
|
is an empty string and
|
|
|
|
.B AT_EMPTY_PATH
|
|
|
|
was not specified in
|
|
|
|
.IR flags .
|
2017-04-06 14:15:45 +00:00
|
|
|
.TP
|
|
|
|
.B ENOMEM
|
|
|
|
Out of memory (i.e., kernel memory).
|
|
|
|
.TP
|
|
|
|
.B ENOTDIR
|
|
|
|
A component of the path prefix of
|
|
|
|
.I pathname
|
|
|
|
is not a directory or
|
|
|
|
.I pathname
|
|
|
|
is relative and
|
|
|
|
.I dirfd
|
|
|
|
is a file descriptor referring to a file other than a directory.
|
|
|
|
.SH VERSIONS
|
|
|
|
.BR statx ()
|
2018-07-17 10:33:21 +00:00
|
|
|
was added to Linux in kernel 4.11; library support was added in glibc 2.28.
|
2017-04-23 10:02:52 +00:00
|
|
|
.SH CONFORMING TO
|
|
|
|
.BR statx ()
|
2017-04-25 19:39:56 +00:00
|
|
|
is Linux-specific.
|
2017-04-06 14:15:45 +00:00
|
|
|
.SH SEE ALSO
|
|
|
|
.BR ls (1),
|
|
|
|
.BR stat (1),
|
|
|
|
.BR access (2),
|
|
|
|
.BR chmod (2),
|
|
|
|
.BR chown (2),
|
|
|
|
.BR readlink (2),
|
2017-09-06 19:10:48 +00:00
|
|
|
.BR stat (2),
|
2017-04-06 14:15:45 +00:00
|
|
|
.BR utime (2),
|
|
|
|
.BR capabilities (7),
|
2017-04-22 19:54:23 +00:00
|
|
|
.BR inode (7),
|
2017-04-06 14:15:45 +00:00
|
|
|
.BR symlink (7)
|