2 * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
3 * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
4 * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
5 * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. The name of the author may not be used to endorse or promote products
17 * derived from this software without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
20 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
23 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
24 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 #if defined(SPARC) || defined(SPARC64)
37 unsigned short st_dev;
39 unsigned short st_mode;
41 unsigned short st_uid;
42 unsigned short st_gid;
43 unsigned short st_rdev;
46 unsigned int __unused1;
48 unsigned int __unused2;
50 unsigned int __unused3;
53 unsigned int __unused4[2];
60 unsigned int st_nlink;
70 unsigned long __unused4[2];
73 # define stat kernel_stat
74 # include <asm/stat.h>
78 unsigned long long st_dev;
79 unsigned long long st_ino;
80 unsigned long long st_nlink;
86 unsigned long long st_rdev;
91 unsigned long long st_atime;
92 unsigned long long st_atime_nsec;
93 unsigned long long st_mtime;
94 unsigned long long st_mtime_nsec;
95 unsigned long long st_ctime;
96 unsigned long long st_ctime_nsec;
97 long long __unused[3];
101 unsigned long long st_dev;
102 unsigned char __pad0[4];
103 unsigned long __st_ino;
104 unsigned int st_mode;
105 unsigned int st_nlink;
106 unsigned long st_uid;
107 unsigned long st_gid;
108 unsigned long long st_rdev;
109 unsigned char __pad3[4];
111 unsigned long st_blksize;
112 unsigned long long st_blocks;
113 unsigned long st_atime;
114 unsigned long st_atime_nsec;
115 unsigned long st_mtime;
116 unsigned int st_mtime_nsec;
117 unsigned long st_ctime;
118 unsigned long st_ctime_nsec;
119 unsigned long long st_ino;
130 # define dev_t __kernel_dev_t
131 # define ino_t __kernel_ino_t
132 # define mode_t __kernel_mode_t
133 # define nlink_t __kernel_nlink_t
134 # define uid_t __kernel_uid_t
135 # define gid_t __kernel_gid_t
136 # define off_t __kernel_off_t
137 # define loff_t __kernel_loff_t
139 # include <asm/stat.h>
151 # define mode_t mode_t
152 # define nlink_t nlink_t
156 # define loff_t loff_t
159 #ifdef HPPA /* asm-parisc/stat.h defines stat64 */
162 #define stat libc_stat
163 #define stat64 libc_stat64
164 #include <sys/stat.h>
167 /* These might be macros. */
172 # define stat64 hpux_stat64
176 #ifdef HAVE_SYS_VFS_H
177 # include <sys/vfs.h>
179 #ifdef HAVE_LINUX_XATTR_H
180 # include <linux/xattr.h>
182 # define XATTR_CREATE 1
183 # define XATTR_REPLACE 2
186 #ifdef MAJOR_IN_SYSMACROS
187 # include <sys/sysmacros.h>
190 #ifdef MAJOR_IN_MKDEV
191 # include <sys/mkdev.h>
194 #ifdef HAVE_SYS_ASYNCH_H
195 # include <sys/asynch.h>
198 struct kernel_dirent {
201 unsigned short d_reclen;
205 const struct xlat open_access_modes[] = {
206 { O_RDONLY, "O_RDONLY" },
207 { O_WRONLY, "O_WRONLY" },
208 { O_RDWR, "O_RDWR" },
210 { O_ACCMODE, "O_ACCMODE" },
215 const struct xlat open_mode_flags[] = {
216 { O_CREAT, "O_CREAT" },
217 { O_EXCL, "O_EXCL" },
218 { O_NOCTTY, "O_NOCTTY" },
219 { O_TRUNC, "O_TRUNC" },
220 { O_APPEND, "O_APPEND" },
221 { O_NONBLOCK, "O_NONBLOCK" },
223 { O_SYNC, "O_SYNC" },
226 { O_ASYNC, "O_ASYNC" },
229 { O_DSYNC, "O_DSYNC" },
232 { O_RSYNC, "O_RSYNC" },
234 #if defined(O_NDELAY) && (O_NDELAY != O_NONBLOCK)
235 { O_NDELAY, "O_NDELAY" },
238 { O_PRIV, "O_PRIV" },
241 { O_DIRECT, "O_DIRECT" },
244 # if O_LARGEFILE == 0 /* biarch platforms in 64-bit mode */
247 # define O_LARGEFILE 0x40000
248 # elif defined X86_64 || defined S390X
249 # define O_LARGEFILE 0100000
253 { O_LARGEFILE, "O_LARGEFILE" },
257 { O_DIRECTORY, "O_DIRECTORY" },
260 { O_NOFOLLOW, "O_NOFOLLOW" },
263 { O_NOATIME, "O_NOATIME" },
266 { O_CLOEXEC, "O_CLOEXEC" },
269 { FNDELAY, "FNDELAY" },
272 { FAPPEND, "FAPPEND" },
278 { FDEFER, "FDEFER" },
281 { FASYNC, "FASYNC" },
284 { FSHLOCK, "FSHLOCK" },
287 { FEXLOCK, "FEXLOCK" },
290 { FCREAT, "FCREAT" },
293 { FTRUNC, "FTRUNC" },
305 { FNOCTTY, "FNOCTTY" },
308 { O_SHLOCK, "O_SHLOCK" },
311 { O_EXLOCK, "O_EXLOCK" },
317 # define AT_FDCWD -100
320 /* The fd is an "int", so when decoding x86 on x86_64, we need to force sign
321 * extension to get the right value. We do this by declaring fd as int here.
324 print_dirfd(struct tcb *tcp, int fd)
327 tprints("AT_FDCWD, ");
335 * low bits of the open(2) flags define access mode,
336 * other bits are real flags.
339 sprint_open_modes(mode_t flags)
341 static char outstr[(1 + ARRAY_SIZE(open_mode_flags)) * sizeof("O_LARGEFILE")];
345 const struct xlat *x;
348 p = stpcpy(outstr, "flags");
349 str = xlookup(open_access_modes, flags & 3);
359 for (x = open_mode_flags; x->str; x++) {
360 if ((flags & x->val) == x->val) {
362 p = stpcpy(p, x->str);
369 /* flags is still nonzero */
371 sprintf(p, "%#x", flags);
376 tprint_open_modes(mode_t flags)
378 tprints(sprint_open_modes(flags) + sizeof("flags"));
382 decode_open(struct tcb *tcp, int offset)
385 printpath(tcp, tcp->u_arg[offset]);
388 tprint_open_modes(tcp->u_arg[offset + 1]);
389 if (tcp->u_arg[offset + 1] & O_CREAT) {
391 tprintf(", %#lo", tcp->u_arg[offset + 2]);
398 sys_open(struct tcb *tcp)
400 return decode_open(tcp, 0);
404 sys_openat(struct tcb *tcp)
407 print_dirfd(tcp, tcp->u_arg[0]);
408 return decode_open(tcp, 1);
411 #if defined(SPARC) || defined(SPARC64)
412 static const struct xlat openmodessol[] = {
416 { 0x80, "O_NONBLOCK" },
418 { 0x100, "O_CREAT" },
419 { 0x200, "O_TRUNC" },
421 { 0x800, "O_NOCTTY" },
424 { 0x8000, "O_RSYNC" },
426 { 0x1000, "O_PRIV" },
431 solaris_open(struct tcb *tcp)
434 printpath(tcp, tcp->u_arg[0]);
437 printflags(openmodessol, tcp->u_arg[1] + 1, "O_???");
438 if (tcp->u_arg[1] & 0x100) {
440 tprintf(", %#lo", tcp->u_arg[2]);
449 sys_creat(struct tcb *tcp)
452 printpath(tcp, tcp->u_arg[0]);
453 tprintf(", %#lo", tcp->u_arg[1]);
458 static const struct xlat access_flags[] = {
464 { EFF_ONLY_OK, "EFF_ONLY_OK" },
473 decode_access(struct tcb *tcp, int offset)
476 printpath(tcp, tcp->u_arg[offset]);
478 printflags(access_flags, tcp->u_arg[offset + 1], "?_OK");
484 sys_access(struct tcb *tcp)
486 return decode_access(tcp, 0);
490 sys_faccessat(struct tcb *tcp)
493 print_dirfd(tcp, tcp->u_arg[0]);
494 return decode_access(tcp, 1);
498 sys_umask(struct tcb *tcp)
501 tprintf("%#lo", tcp->u_arg[0]);
506 const struct xlat whence_codes[] = {
507 { SEEK_SET, "SEEK_SET" },
508 { SEEK_CUR, "SEEK_CUR" },
509 { SEEK_END, "SEEK_END" },
511 { SEEK_DATA, "SEEK_DATA" },
514 { SEEK_HOLE, "SEEK_HOLE" },
519 /* Linux kernel has exactly one version of lseek:
520 * fs/read_write.c::SYSCALL_DEFINE3(lseek, unsigned, fd, off_t, offset, unsigned, origin)
521 * In kernel, off_t is always the same as (kernel's) long
522 * (see include/uapi/asm-generic/posix_types.h),
523 * which means that on x32 we need to use tcp->ext_arg[N] to get offset argument.
524 * Use test/x32_lseek.c to test lseek decoding.
526 #if defined(LINUX_MIPSN32) || defined(X32)
528 sys_lseek(struct tcb *tcp)
534 printfd(tcp, tcp->u_arg[0]);
535 offset = tcp->ext_arg[1];
536 whence = tcp->u_arg[2];
537 if (whence == SEEK_SET)
538 tprintf(", %llu, ", offset);
540 tprintf(", %lld, ", offset);
541 printxval(whence_codes, whence, "SEEK_???");
543 return RVAL_LUDECIMAL;
547 sys_lseek(struct tcb *tcp)
553 printfd(tcp, tcp->u_arg[0]);
554 offset = tcp->u_arg[1];
555 whence = tcp->u_arg[2];
556 if (whence == SEEK_SET)
557 tprintf(", %lu, ", offset);
559 tprintf(", %ld, ", offset);
560 printxval(whence_codes, whence, "SEEK_???");
562 return RVAL_UDECIMAL;
566 /* llseek syscall takes explicitly two ulong arguments hi, lo,
567 * rather than one 64-bit argument for which LONG_LONG works
568 * appropriate for the native byte order.
570 * See kernel's fs/read_write.c::SYSCALL_DEFINE5(llseek, ...)
572 * hi,lo are "unsigned longs" and combined exactly this way in kernel:
573 * ((loff_t) hi << 32) | lo
574 * Note that for architectures with kernel's long wider than userspace long
575 * (such as x32), combining code will use *kernel's*, i.e. *wide* longs
576 * for hi and lo. We would need to use tcp->ext_arg[N] on x32...
577 * ...however, x32 (and x86_64) does not _have_ llseek syscall as such.
580 sys_llseek(struct tcb *tcp)
583 printfd(tcp, tcp->u_arg[0]);
584 if (tcp->u_arg[4] == SEEK_SET)
586 ((long long) tcp->u_arg[1]) << 32 |
587 (unsigned long long) (unsigned) tcp->u_arg[2]);
590 ((long long) tcp->u_arg[1]) << 32 |
591 (unsigned long long) (unsigned) tcp->u_arg[2]);
595 if (syserror(tcp) || umove(tcp, tcp->u_arg[3], &off) < 0)
596 tprintf("%#lx, ", tcp->u_arg[3]);
598 tprintf("[%llu], ", off);
599 printxval(whence_codes, tcp->u_arg[4], "SEEK_???");
605 sys_readahead(struct tcb *tcp)
609 printfd(tcp, tcp->u_arg[0]);
610 argn = printllval(tcp, ", %lld", 1);
611 tprintf(", %ld", tcp->u_arg[argn]);
617 sys_truncate(struct tcb *tcp)
620 printpath(tcp, tcp->u_arg[0]);
621 tprintf(", %lu", tcp->u_arg[1]);
628 sys_truncate64(struct tcb *tcp)
631 printpath(tcp, tcp->u_arg[0]);
632 printllval(tcp, ", %llu", 1);
639 sys_ftruncate(struct tcb *tcp)
642 printfd(tcp, tcp->u_arg[0]);
643 tprintf(", %lu", tcp->u_arg[1]);
650 sys_ftruncate64(struct tcb *tcp)
653 printfd(tcp, tcp->u_arg[0]);
654 printllval(tcp, ", %llu", 1);
662 static const struct xlat modetypes[] = {
663 { S_IFREG, "S_IFREG" },
664 { S_IFSOCK, "S_IFSOCK" },
665 { S_IFIFO, "S_IFIFO" },
666 { S_IFLNK, "S_IFLNK" },
667 { S_IFDIR, "S_IFDIR" },
668 { S_IFBLK, "S_IFBLK" },
669 { S_IFCHR, "S_IFCHR" },
676 static char buf[sizeof("S_IFSOCK|S_ISUID|S_ISGID|S_ISVTX|%o")
681 if ((mode & S_IFMT) == 0)
683 else if ((s = xlookup(modetypes, mode & S_IFMT)) == NULL) {
684 sprintf(buf, "%#o", mode);
687 s = buf + sprintf(buf, "%s%s%s%s", s,
688 (mode & S_ISUID) ? "|S_ISUID" : "",
689 (mode & S_ISGID) ? "|S_ISGID" : "",
690 (mode & S_ISVTX) ? "|S_ISVTX" : "");
691 mode &= ~(S_IFMT|S_ISUID|S_ISGID|S_ISVTX);
693 sprintf((char*)s, "|%#o", mode);
694 s = (*buf == '|') ? buf + 1 : buf;
702 static char buf[sizeof("yyyy/mm/dd-hh:mm:ss")];
710 snprintf(buf, sizeof buf, "%02d/%02d/%02d-%02d:%02d:%02d",
711 tmp->tm_year + 1900, tmp->tm_mon + 1, tmp->tm_mday,
712 tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
714 snprintf(buf, sizeof buf, "%lu", (unsigned long) t);
719 #if defined(SPARC) || defined(SPARC64)
727 int st_pad1[3]; /* network id */
736 int st_pad3; /* st_size, off_t expansion */
737 timestruct_t st_atime;
738 timestruct_t st_mtime;
739 timestruct_t st_ctime;
743 int st_pad4[8]; /* expansion area */
747 printstatsol(struct tcb *tcp, long addr)
749 struct solstat statbuf;
751 if (umove(tcp, addr, &statbuf) < 0) {
756 tprintf("{st_dev=makedev(%lu, %lu), st_ino=%lu, st_mode=%s, ",
757 (unsigned long) ((statbuf.st_dev >> 18) & 0x3fff),
758 (unsigned long) (statbuf.st_dev & 0x3ffff),
759 (unsigned long) statbuf.st_ino,
760 sprintmode(statbuf.st_mode));
761 tprintf("st_nlink=%lu, st_uid=%lu, st_gid=%lu, ",
762 (unsigned long) statbuf.st_nlink,
763 (unsigned long) statbuf.st_uid,
764 (unsigned long) statbuf.st_gid);
765 tprintf("st_blksize=%lu, ", (unsigned long) statbuf.st_blksize);
766 tprintf("st_blocks=%lu, ", (unsigned long) statbuf.st_blocks);
769 tprintf("{st_mode=%s, ", sprintmode(statbuf.st_mode));
770 switch (statbuf.st_mode & S_IFMT) {
771 case S_IFCHR: case S_IFBLK:
772 tprintf("st_rdev=makedev(%lu, %lu), ",
773 (unsigned long) ((statbuf.st_rdev >> 18) & 0x3fff),
774 (unsigned long) (statbuf.st_rdev & 0x3ffff));
777 tprintf("st_size=%u, ", statbuf.st_size);
781 tprintf("st_atime=%s, ", sprinttime(statbuf.st_atime.tv_sec));
782 tprintf("st_mtime=%s, ", sprinttime(statbuf.st_mtime.tv_sec));
783 tprintf("st_ctime=%s}", sprinttime(statbuf.st_ctime.tv_sec));
789 # if defined(SPARC64)
791 printstat_sparc64(struct tcb *tcp, long addr)
793 struct stat_sparc64 statbuf;
795 if (umove(tcp, addr, &statbuf) < 0) {
801 tprintf("{st_dev=makedev(%lu, %lu), st_ino=%lu, st_mode=%s, ",
802 (unsigned long) major(statbuf.st_dev),
803 (unsigned long) minor(statbuf.st_dev),
804 (unsigned long) statbuf.st_ino,
805 sprintmode(statbuf.st_mode));
806 tprintf("st_nlink=%lu, st_uid=%lu, st_gid=%lu, ",
807 (unsigned long) statbuf.st_nlink,
808 (unsigned long) statbuf.st_uid,
809 (unsigned long) statbuf.st_gid);
810 tprintf("st_blksize=%lu, ",
811 (unsigned long) statbuf.st_blksize);
812 tprintf("st_blocks=%lu, ",
813 (unsigned long) statbuf.st_blocks);
816 tprintf("{st_mode=%s, ", sprintmode(statbuf.st_mode));
817 switch (statbuf.st_mode & S_IFMT) {
818 case S_IFCHR: case S_IFBLK:
819 tprintf("st_rdev=makedev(%lu, %lu), ",
820 (unsigned long) major(statbuf.st_rdev),
821 (unsigned long) minor(statbuf.st_rdev));
824 tprintf("st_size=%lu, ", statbuf.st_size);
828 tprintf("st_atime=%s, ", sprinttime(statbuf.st_atime));
829 tprintf("st_mtime=%s, ", sprinttime(statbuf.st_mtime));
830 tprintf("st_ctime=%s}", sprinttime(statbuf.st_ctime));
835 # endif /* SPARC64 */
836 #endif /* SPARC[64] */
838 #if defined POWERPC64
839 struct stat_powerpc32 {
842 unsigned int st_mode;
843 unsigned short st_nlink;
846 unsigned int st_rdev;
847 unsigned int st_size;
848 unsigned int st_blksize;
849 unsigned int st_blocks;
850 unsigned int st_atime;
851 unsigned int st_atime_nsec;
852 unsigned int st_mtime;
853 unsigned int st_mtime_nsec;
854 unsigned int st_ctime;
855 unsigned int st_ctime_nsec;
856 unsigned int __unused4;
857 unsigned int __unused5;
861 printstat_powerpc32(struct tcb *tcp, long addr)
863 struct stat_powerpc32 statbuf;
865 if (umove(tcp, addr, &statbuf) < 0) {
871 tprintf("{st_dev=makedev(%u, %u), st_ino=%u, st_mode=%s, ",
872 major(statbuf.st_dev), minor(statbuf.st_dev),
874 sprintmode(statbuf.st_mode));
875 tprintf("st_nlink=%u, st_uid=%u, st_gid=%u, ",
876 statbuf.st_nlink, statbuf.st_uid, statbuf.st_gid);
877 tprintf("st_blksize=%u, ", statbuf.st_blksize);
878 tprintf("st_blocks=%u, ", statbuf.st_blocks);
881 tprintf("{st_mode=%s, ", sprintmode(statbuf.st_mode));
882 switch (statbuf.st_mode & S_IFMT) {
883 case S_IFCHR: case S_IFBLK:
884 tprintf("st_rdev=makedev(%lu, %lu), ",
885 (unsigned long) major(statbuf.st_rdev),
886 (unsigned long) minor(statbuf.st_rdev));
889 tprintf("st_size=%u, ", statbuf.st_size);
893 tprintf("st_atime=%s, ", sprinttime(statbuf.st_atime));
894 tprintf("st_mtime=%s, ", sprinttime(statbuf.st_mtime));
895 tprintf("st_ctime=%s}", sprinttime(statbuf.st_ctime));
900 #endif /* POWERPC64 */
902 static const struct xlat fileflags[] = {
907 realprintstat(struct tcb *tcp, struct stat *statbuf)
910 tprintf("{st_dev=makedev(%lu, %lu), st_ino=%lu, st_mode=%s, ",
911 (unsigned long) major(statbuf->st_dev),
912 (unsigned long) minor(statbuf->st_dev),
913 (unsigned long) statbuf->st_ino,
914 sprintmode(statbuf->st_mode));
915 tprintf("st_nlink=%lu, st_uid=%lu, st_gid=%lu, ",
916 (unsigned long) statbuf->st_nlink,
917 (unsigned long) statbuf->st_uid,
918 (unsigned long) statbuf->st_gid);
919 #ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
920 tprintf("st_blksize=%lu, ", (unsigned long) statbuf->st_blksize);
922 #ifdef HAVE_STRUCT_STAT_ST_BLOCKS
923 tprintf("st_blocks=%lu, ", (unsigned long) statbuf->st_blocks);
927 tprintf("{st_mode=%s, ", sprintmode(statbuf->st_mode));
928 switch (statbuf->st_mode & S_IFMT) {
929 case S_IFCHR: case S_IFBLK:
930 #ifdef HAVE_STRUCT_STAT_ST_RDEV
931 tprintf("st_rdev=makedev(%lu, %lu), ",
932 (unsigned long) major(statbuf->st_rdev),
933 (unsigned long) minor(statbuf->st_rdev));
934 #else /* !HAVE_STRUCT_STAT_ST_RDEV */
935 tprintf("st_size=makedev(%lu, %lu), ",
936 (unsigned long) major(statbuf->st_size),
937 (unsigned long) minor(statbuf->st_size));
938 #endif /* !HAVE_STRUCT_STAT_ST_RDEV */
941 tprintf("st_size=%lu, ", (unsigned long) statbuf->st_size);
945 tprintf("st_atime=%s, ", sprinttime(statbuf->st_atime));
946 tprintf("st_mtime=%s, ", sprinttime(statbuf->st_mtime));
947 tprintf("st_ctime=%s", sprinttime(statbuf->st_ctime));
948 #if HAVE_STRUCT_STAT_ST_FLAGS
949 tprints(", st_flags=");
950 printflags(fileflags, statbuf->st_flags, "UF_???");
952 #if HAVE_STRUCT_STAT_ST_ACLCNT
953 tprintf(", st_aclcnt=%d", statbuf->st_aclcnt);
955 #if HAVE_STRUCT_STAT_ST_LEVEL
956 tprintf(", st_level=%ld", statbuf->st_level);
958 #if HAVE_STRUCT_STAT_ST_FSTYPE
959 tprintf(", st_fstype=%.*s",
960 (int) sizeof statbuf->st_fstype, statbuf->st_fstype);
962 #if HAVE_STRUCT_STAT_ST_GEN
963 tprintf(", st_gen=%u", statbuf->st_gen);
972 printstat(struct tcb *tcp, long addr)
980 if (syserror(tcp) || !verbose(tcp)) {
981 tprintf("%#lx", addr);
985 #if defined(SPARC) || defined(SPARC64)
986 if (current_personality == 1) {
987 printstatsol(tcp, addr);
991 else if (current_personality == 2) {
992 printstat_sparc64(tcp, addr);
996 #endif /* SPARC[64] */
998 #if defined POWERPC64
999 if (current_personality == 1) {
1000 printstat_powerpc32(tcp, addr);
1005 if (umove(tcp, addr, &statbuf) < 0) {
1010 realprintstat(tcp, &statbuf);
1013 #if !defined HAVE_STAT64 && defined X86_64
1015 * Linux x86_64 has unified `struct stat' but its i386 biarch needs
1016 * `struct stat64'. Its <asm-i386/stat.h> definition expects 32-bit `long'.
1017 * <linux/include/asm-x86_64/ia32.h> is not in the public includes set.
1018 * __GNUC__ is needed for the required __attribute__ below.
1021 unsigned long long st_dev;
1022 unsigned char __pad0[4];
1023 unsigned int __st_ino;
1024 unsigned int st_mode;
1025 unsigned int st_nlink;
1026 unsigned int st_uid;
1027 unsigned int st_gid;
1028 unsigned long long st_rdev;
1029 unsigned char __pad3[4];
1031 unsigned int st_blksize;
1032 unsigned long long st_blocks;
1033 unsigned int st_atime;
1034 unsigned int st_atime_nsec;
1035 unsigned int st_mtime;
1036 unsigned int st_mtime_nsec;
1037 unsigned int st_ctime;
1038 unsigned int st_ctime_nsec;
1039 unsigned long long st_ino;
1040 } __attribute__((packed));
1041 # define HAVE_STAT64 1
1042 # define STAT64_SIZE 96
1047 printstat64(struct tcb *tcp, long addr)
1049 struct stat64 statbuf;
1052 (void) sizeof(char[sizeof statbuf == STAT64_SIZE ? 1 : -1]);
1059 if (syserror(tcp) || !verbose(tcp)) {
1060 tprintf("%#lx", addr);
1064 #if defined(SPARC) || defined(SPARC64)
1065 if (current_personality == 1) {
1066 printstatsol(tcp, addr);
1070 else if (current_personality == 2) {
1071 printstat_sparc64(tcp, addr);
1075 #endif /* SPARC[64] */
1078 if (current_personality != 1) {
1079 printstat(tcp, addr);
1084 if (umove(tcp, addr, &statbuf) < 0) {
1090 #ifdef HAVE_LONG_LONG
1091 tprintf("{st_dev=makedev(%lu, %lu), st_ino=%llu, st_mode=%s, ",
1093 tprintf("{st_dev=makedev(%lu, %lu), st_ino=%lu, st_mode=%s, ",
1095 (unsigned long) major(statbuf.st_dev),
1096 (unsigned long) minor(statbuf.st_dev),
1097 #ifdef HAVE_LONG_LONG
1098 (unsigned long long) statbuf.st_ino,
1100 (unsigned long) statbuf.st_ino,
1102 sprintmode(statbuf.st_mode));
1103 tprintf("st_nlink=%lu, st_uid=%lu, st_gid=%lu, ",
1104 (unsigned long) statbuf.st_nlink,
1105 (unsigned long) statbuf.st_uid,
1106 (unsigned long) statbuf.st_gid);
1107 #ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
1108 tprintf("st_blksize=%lu, ",
1109 (unsigned long) statbuf.st_blksize);
1110 #endif /* HAVE_STRUCT_STAT_ST_BLKSIZE */
1111 #ifdef HAVE_STRUCT_STAT_ST_BLOCKS
1112 tprintf("st_blocks=%lu, ", (unsigned long) statbuf.st_blocks);
1113 #endif /* HAVE_STRUCT_STAT_ST_BLOCKS */
1116 tprintf("{st_mode=%s, ", sprintmode(statbuf.st_mode));
1117 switch (statbuf.st_mode & S_IFMT) {
1118 case S_IFCHR: case S_IFBLK:
1119 #ifdef HAVE_STRUCT_STAT_ST_RDEV
1120 tprintf("st_rdev=makedev(%lu, %lu), ",
1121 (unsigned long) major(statbuf.st_rdev),
1122 (unsigned long) minor(statbuf.st_rdev));
1123 #else /* !HAVE_STRUCT_STAT_ST_RDEV */
1124 tprintf("st_size=makedev(%lu, %lu), ",
1125 (unsigned long) major(statbuf.st_size),
1126 (unsigned long) minor(statbuf.st_size));
1127 #endif /* !HAVE_STRUCT_STAT_ST_RDEV */
1130 #ifdef HAVE_LONG_LONG
1131 tprintf("st_size=%llu, ", (unsigned long long) statbuf.st_size);
1133 tprintf("st_size=%lu, ", (unsigned long) statbuf.st_size);
1138 tprintf("st_atime=%s, ", sprinttime(statbuf.st_atime));
1139 tprintf("st_mtime=%s, ", sprinttime(statbuf.st_mtime));
1140 tprintf("st_ctime=%s", sprinttime(statbuf.st_ctime));
1141 #if HAVE_STRUCT_STAT_ST_FLAGS
1142 tprints(", st_flags=");
1143 printflags(fileflags, statbuf.st_flags, "UF_???");
1145 #if HAVE_STRUCT_STAT_ST_ACLCNT
1146 tprintf(", st_aclcnt=%d", statbuf.st_aclcnt);
1148 #if HAVE_STRUCT_STAT_ST_LEVEL
1149 tprintf(", st_level=%ld", statbuf.st_level);
1151 #if HAVE_STRUCT_STAT_ST_FSTYPE
1152 tprintf(", st_fstype=%.*s",
1153 (int) sizeof statbuf.st_fstype, statbuf.st_fstype);
1155 #if HAVE_STRUCT_STAT_ST_GEN
1156 tprintf(", st_gen=%u", statbuf.st_gen);
1163 #endif /* HAVE_STAT64 */
1165 #if defined(HAVE_STRUCT___OLD_KERNEL_STAT)
1167 convertoldstat(const struct __old_kernel_stat *oldbuf, struct stat *newbuf)
1169 newbuf->st_dev = oldbuf->st_dev;
1170 newbuf->st_ino = oldbuf->st_ino;
1171 newbuf->st_mode = oldbuf->st_mode;
1172 newbuf->st_nlink = oldbuf->st_nlink;
1173 newbuf->st_uid = oldbuf->st_uid;
1174 newbuf->st_gid = oldbuf->st_gid;
1175 newbuf->st_rdev = oldbuf->st_rdev;
1176 newbuf->st_size = oldbuf->st_size;
1177 newbuf->st_atime = oldbuf->st_atime;
1178 newbuf->st_mtime = oldbuf->st_mtime;
1179 newbuf->st_ctime = oldbuf->st_ctime;
1180 newbuf->st_blksize = 0; /* not supported in old_stat */
1181 newbuf->st_blocks = 0; /* not supported in old_stat */
1185 printoldstat(struct tcb *tcp, long addr)
1187 struct __old_kernel_stat statbuf;
1188 struct stat newstatbuf;
1194 if (syserror(tcp) || !verbose(tcp)) {
1195 tprintf("%#lx", addr);
1199 # if defined(SPARC) || defined(SPARC64)
1200 if (current_personality == 1) {
1201 printstatsol(tcp, addr);
1206 if (umove(tcp, addr, &statbuf) < 0) {
1211 convertoldstat(&statbuf, &newstatbuf);
1212 realprintstat(tcp, &newstatbuf);
1217 sys_stat(struct tcb *tcp)
1219 if (entering(tcp)) {
1220 printpath(tcp, tcp->u_arg[0]);
1223 printstat(tcp, tcp->u_arg[1]);
1229 sys_stat64(struct tcb *tcp)
1232 if (entering(tcp)) {
1233 printpath(tcp, tcp->u_arg[0]);
1236 printstat64(tcp, tcp->u_arg[1]);
1240 return printargs(tcp);
1244 #ifndef AT_SYMLINK_NOFOLLOW
1245 # define AT_SYMLINK_NOFOLLOW 0x100
1247 #ifndef AT_REMOVEDIR
1248 # define AT_REMOVEDIR 0x200
1250 #ifndef AT_SYMLINK_FOLLOW
1251 # define AT_SYMLINK_FOLLOW 0x400
1253 #ifndef AT_NO_AUTOMOUNT
1254 # define AT_NO_AUTOMOUNT 0x800
1256 #ifndef AT_EMPTY_PATH
1257 # define AT_EMPTY_PATH 0x1000
1260 static const struct xlat at_flags[] = {
1261 { AT_SYMLINK_NOFOLLOW, "AT_SYMLINK_NOFOLLOW" },
1262 { AT_REMOVEDIR, "AT_REMOVEDIR" },
1263 { AT_SYMLINK_FOLLOW, "AT_SYMLINK_FOLLOW" },
1264 { AT_NO_AUTOMOUNT, "AT_NO_AUTOMOUNT" },
1265 { AT_EMPTY_PATH, "AT_EMPTY_PATH" },
1270 sys_newfstatat(struct tcb *tcp)
1272 if (entering(tcp)) {
1273 print_dirfd(tcp, tcp->u_arg[0]);
1274 printpath(tcp, tcp->u_arg[1]);
1278 if (current_personality == 0)
1279 printstat(tcp, tcp->u_arg[2]);
1281 printstat64(tcp, tcp->u_arg[2]);
1282 #elif defined HAVE_STAT64
1283 printstat64(tcp, tcp->u_arg[2]);
1285 printstat(tcp, tcp->u_arg[2]);
1288 printflags(at_flags, tcp->u_arg[3], "AT_???");
1293 #if defined(HAVE_STRUCT___OLD_KERNEL_STAT)
1295 sys_oldstat(struct tcb *tcp)
1297 if (entering(tcp)) {
1298 printpath(tcp, tcp->u_arg[0]);
1301 printoldstat(tcp, tcp->u_arg[1]);
1308 sys_fstat(struct tcb *tcp)
1310 if (entering(tcp)) {
1311 printfd(tcp, tcp->u_arg[0]);
1314 printstat(tcp, tcp->u_arg[1]);
1320 sys_fstat64(struct tcb *tcp)
1323 if (entering(tcp)) {
1324 printfd(tcp, tcp->u_arg[0]);
1327 printstat64(tcp, tcp->u_arg[1]);
1331 return printargs(tcp);
1335 #if defined(HAVE_STRUCT___OLD_KERNEL_STAT)
1337 sys_oldfstat(struct tcb *tcp)
1339 if (entering(tcp)) {
1340 printfd(tcp, tcp->u_arg[0]);
1343 printoldstat(tcp, tcp->u_arg[1]);
1350 sys_lstat(struct tcb *tcp)
1352 if (entering(tcp)) {
1353 printpath(tcp, tcp->u_arg[0]);
1356 printstat(tcp, tcp->u_arg[1]);
1362 sys_lstat64(struct tcb *tcp)
1365 if (entering(tcp)) {
1366 printpath(tcp, tcp->u_arg[0]);
1369 printstat64(tcp, tcp->u_arg[1]);
1373 return printargs(tcp);
1377 #if defined(HAVE_STRUCT___OLD_KERNEL_STAT)
1379 sys_oldlstat(struct tcb *tcp)
1381 if (entering(tcp)) {
1382 printpath(tcp, tcp->u_arg[0]);
1385 printoldstat(tcp, tcp->u_arg[1]);
1391 #if defined(SPARC) || defined(SPARC64)
1394 sys_xstat(struct tcb *tcp)
1396 if (entering(tcp)) {
1397 tprintf("%ld, ", tcp->u_arg[0]);
1398 printpath(tcp, tcp->u_arg[1]);
1402 if (tcp->u_arg[0] == _STAT64_VER)
1403 printstat64(tcp, tcp->u_arg[2]);
1406 printstat(tcp, tcp->u_arg[2]);
1412 sys_fxstat(struct tcb *tcp)
1415 tprintf("%ld, %ld, ", tcp->u_arg[0], tcp->u_arg[1]);
1418 if (tcp->u_arg[0] == _STAT64_VER)
1419 printstat64(tcp, tcp->u_arg[2]);
1422 printstat(tcp, tcp->u_arg[2]);
1428 sys_lxstat(struct tcb *tcp)
1430 if (entering(tcp)) {
1431 tprintf("%ld, ", tcp->u_arg[0]);
1432 printpath(tcp, tcp->u_arg[1]);
1436 if (tcp->u_arg[0] == _STAT64_VER)
1437 printstat64(tcp, tcp->u_arg[2]);
1440 printstat(tcp, tcp->u_arg[2]);
1446 sys_xmknod(struct tcb *tcp)
1448 int mode = tcp->u_arg[2];
1450 if (entering(tcp)) {
1451 tprintf("%ld, ", tcp->u_arg[0]);
1452 printpath(tcp, tcp->u_arg[1]);
1453 tprintf(", %s", sprintmode(mode));
1454 switch (mode & S_IFMT) {
1455 case S_IFCHR: case S_IFBLK:
1456 tprintf(", makedev(%lu, %lu)",
1457 (unsigned long) ((tcp->u_arg[3] >> 18) & 0x3fff),
1458 (unsigned long) (tcp->u_arg[3] & 0x3ffff));
1467 # ifdef HAVE_SYS_ACL_H
1469 # include <sys/acl.h>
1471 static const struct xlat aclcmds[] = {
1473 { SETACL, "SETACL" },
1476 { GETACL, "GETACL" },
1479 { GETACLCNT, "GETACLCNT" },
1482 { ACL_GET, "ACL_GET" },
1485 { ACL_SET, "ACL_SET" },
1488 { ACL_CNT, "ACL_CNT" },
1494 sys_acl(struct tcb *tcp)
1496 if (entering(tcp)) {
1497 printpath(tcp, tcp->u_arg[0]);
1499 printxval(aclcmds, tcp->u_arg[1], "???ACL???");
1500 tprintf(", %ld", tcp->u_arg[2]);
1502 * FIXME - dump out the list of aclent_t's pointed to
1503 * by "tcp->u_arg[3]" if it's not NULL.
1506 tprintf(", %#lx", tcp->u_arg[3]);
1514 sys_facl(struct tcb *tcp)
1516 if (entering(tcp)) {
1517 tprintf("%ld, ", tcp->u_arg[0]);
1518 printxval(aclcmds, tcp->u_arg[1], "???ACL???");
1519 tprintf(", %ld", tcp->u_arg[2]);
1521 * FIXME - dump out the list of aclent_t's pointed to
1522 * by "tcp->u_arg[3]" if it's not NULL.
1525 tprintf(", %#lx", tcp->u_arg[3]);
1532 static const struct xlat aclipc[] = {
1534 { IPC_SHM, "IPC_SHM" },
1537 { IPC_SEM, "IPC_SEM" },
1540 { IPC_MSG, "IPC_MSG" },
1546 sys_aclipc(struct tcb *tcp)
1548 if (entering(tcp)) {
1549 printxval(aclipc, tcp->u_arg[0], "???IPC???");
1550 tprintf(", %#lx, ", tcp->u_arg[1]);
1551 printxval(aclcmds, tcp->u_arg[2], "???ACL???");
1552 tprintf(", %ld", tcp->u_arg[3]);
1554 * FIXME - dump out the list of aclent_t's pointed to
1555 * by "tcp->u_arg[4]" if it's not NULL.
1558 tprintf(", %#lx", tcp->u_arg[4]);
1565 # endif /* HAVE_SYS_ACL_H */
1567 #endif /* SPARC[64] */
1569 static const struct xlat fsmagic[] = {
1570 { 0x73757245, "CODA_SUPER_MAGIC" },
1571 { 0x012ff7b7, "COH_SUPER_MAGIC" },
1572 { 0x1373, "DEVFS_SUPER_MAGIC" },
1573 { 0x1cd1, "DEVPTS_SUPER_MAGIC" },
1574 { 0x414A53, "EFS_SUPER_MAGIC" },
1575 { 0xef51, "EXT2_OLD_SUPER_MAGIC" },
1576 { 0xef53, "EXT2_SUPER_MAGIC" },
1577 { 0x137d, "EXT_SUPER_MAGIC" },
1578 { 0xf995e849, "HPFS_SUPER_MAGIC" },
1579 { 0x9660, "ISOFS_SUPER_MAGIC" },
1580 { 0x137f, "MINIX_SUPER_MAGIC" },
1581 { 0x138f, "MINIX_SUPER_MAGIC2" },
1582 { 0x2468, "MINIX2_SUPER_MAGIC" },
1583 { 0x2478, "MINIX2_SUPER_MAGIC2" },
1584 { 0x4d44, "MSDOS_SUPER_MAGIC" },
1585 { 0x564c, "NCP_SUPER_MAGIC" },
1586 { 0x6969, "NFS_SUPER_MAGIC" },
1587 { 0x9fa0, "PROC_SUPER_MAGIC" },
1588 { 0x002f, "QNX4_SUPER_MAGIC" },
1589 { 0x52654973, "REISERFS_SUPER_MAGIC" },
1590 { 0x02011994, "SHMFS_SUPER_MAGIC" },
1591 { 0x517b, "SMB_SUPER_MAGIC" },
1592 { 0x012ff7b6, "SYSV2_SUPER_MAGIC" },
1593 { 0x012ff7b5, "SYSV4_SUPER_MAGIC" },
1594 { 0x00011954, "UFS_MAGIC" },
1595 { 0x54190100, "UFS_CIGAM" },
1596 { 0x012ff7b4, "XENIX_SUPER_MAGIC" },
1597 { 0x012fd16d, "XIAFS_SUPER_MAGIC" },
1598 { 0x62656572, "SYSFS_MAGIC" },
1603 sprintfstype(int magic)
1605 static char buf[32];
1608 s = xlookup(fsmagic, magic);
1610 sprintf(buf, "\"%s\"", s);
1613 sprintf(buf, "%#x", magic);
1618 printstatfs(struct tcb *tcp, long addr)
1620 struct statfs statbuf;
1622 if (syserror(tcp) || !verbose(tcp)) {
1623 tprintf("%#lx", addr);
1626 if (umove(tcp, addr, &statbuf) < 0) {
1632 tprintf("{f_type=%s, f_fbsize=%u, f_blocks=%u, f_bfree=%u, ",
1633 sprintfstype(statbuf.f_type),
1634 statbuf.f_bsize, statbuf.f_blocks, statbuf.f_bfree);
1635 tprintf("f_bavail=%u, f_files=%u, f_ffree=%u, f_fsid={%d, %d}, f_namelen=%u",
1636 statbuf.f_bavail, statbuf.f_files, statbuf.f_ffree,
1637 statbuf.f_fsid.__val[0], statbuf.f_fsid.__val[1],
1640 tprintf("{f_type=%s, f_bsize=%lu, f_blocks=%lu, f_bfree=%lu, ",
1641 sprintfstype(statbuf.f_type),
1642 (unsigned long)statbuf.f_bsize,
1643 (unsigned long)statbuf.f_blocks,
1644 (unsigned long)statbuf.f_bfree);
1645 tprintf("f_bavail=%lu, f_files=%lu, f_ffree=%lu, f_fsid={%d, %d}",
1646 (unsigned long)statbuf.f_bavail,
1647 (unsigned long)statbuf.f_files,
1648 (unsigned long)statbuf.f_ffree,
1649 statbuf.f_fsid.__val[0], statbuf.f_fsid.__val[1]);
1650 tprintf(", f_namelen=%lu", (unsigned long)statbuf.f_namelen);
1652 #ifdef _STATFS_F_FRSIZE
1653 tprintf(", f_frsize=%lu", (unsigned long)statbuf.f_frsize);
1659 sys_statfs(struct tcb *tcp)
1661 if (entering(tcp)) {
1662 printpath(tcp, tcp->u_arg[0]);
1665 printstatfs(tcp, tcp->u_arg[1]);
1671 sys_fstatfs(struct tcb *tcp)
1673 if (entering(tcp)) {
1674 printfd(tcp, tcp->u_arg[0]);
1677 printstatfs(tcp, tcp->u_arg[1]);
1682 #if defined HAVE_STATFS64
1684 printstatfs64(struct tcb *tcp, long addr)
1686 struct statfs64 statbuf;
1688 if (syserror(tcp) || !verbose(tcp)) {
1689 tprintf("%#lx", addr);
1692 if (umove(tcp, addr, &statbuf) < 0) {
1696 tprintf("{f_type=%s, f_bsize=%llu, f_blocks=%llu, f_bfree=%llu, ",
1697 sprintfstype(statbuf.f_type),
1698 (unsigned long long)statbuf.f_bsize,
1699 (unsigned long long)statbuf.f_blocks,
1700 (unsigned long long)statbuf.f_bfree);
1701 tprintf("f_bavail=%llu, f_files=%llu, f_ffree=%llu, f_fsid={%d, %d}",
1702 (unsigned long long)statbuf.f_bavail,
1703 (unsigned long long)statbuf.f_files,
1704 (unsigned long long)statbuf.f_ffree,
1705 statbuf.f_fsid.__val[0], statbuf.f_fsid.__val[1]);
1706 tprintf(", f_namelen=%lu", (unsigned long)statbuf.f_namelen);
1707 #ifdef _STATFS_F_FRSIZE
1708 tprintf(", f_frsize=%llu", (unsigned long long)statbuf.f_frsize);
1710 #ifdef _STATFS_F_FLAGS
1711 tprintf(", f_flags=%llu", (unsigned long long)statbuf.f_flags);
1716 struct compat_statfs64 {
1728 uint32_t f_spare[4];
1730 #if defined(X86_64) || defined(IA64)
1731 __attribute__ ((packed, aligned(4)))
1736 printcompat_statfs64(struct tcb *tcp, long addr)
1738 struct compat_statfs64 statbuf;
1740 if (syserror(tcp) || !verbose(tcp)) {
1741 tprintf("%#lx", addr);
1744 if (umove(tcp, addr, &statbuf) < 0) {
1748 tprintf("{f_type=%s, f_bsize=%lu, f_blocks=%llu, f_bfree=%llu, ",
1749 sprintfstype(statbuf.f_type),
1750 (unsigned long)statbuf.f_bsize,
1751 (unsigned long long)statbuf.f_blocks,
1752 (unsigned long long)statbuf.f_bfree);
1753 tprintf("f_bavail=%llu, f_files=%llu, f_ffree=%llu, f_fsid={%d, %d}",
1754 (unsigned long long)statbuf.f_bavail,
1755 (unsigned long long)statbuf.f_files,
1756 (unsigned long long)statbuf.f_ffree,
1757 statbuf.f_fsid.__val[0], statbuf.f_fsid.__val[1]);
1758 tprintf(", f_namelen=%lu", (unsigned long)statbuf.f_namelen);
1759 tprintf(", f_frsize=%lu", (unsigned long)statbuf.f_frsize);
1760 tprintf(", f_flags=%lu}", (unsigned long)statbuf.f_frsize);
1764 sys_statfs64(struct tcb *tcp)
1766 if (entering(tcp)) {
1767 printpath(tcp, tcp->u_arg[0]);
1768 tprintf(", %lu, ", tcp->u_arg[1]);
1770 if (tcp->u_arg[1] == sizeof(struct statfs64))
1771 printstatfs64(tcp, tcp->u_arg[2]);
1772 else if (tcp->u_arg[1] == sizeof(struct compat_statfs64))
1773 printcompat_statfs64(tcp, tcp->u_arg[2]);
1781 sys_fstatfs64(struct tcb *tcp)
1783 if (entering(tcp)) {
1784 printfd(tcp, tcp->u_arg[0]);
1785 tprintf(", %lu, ", tcp->u_arg[1]);
1787 if (tcp->u_arg[1] == sizeof(struct statfs64))
1788 printstatfs64(tcp, tcp->u_arg[2]);
1789 else if (tcp->u_arg[1] == sizeof(struct compat_statfs64))
1790 printcompat_statfs64(tcp, tcp->u_arg[2]);
1800 osf_statfs(struct tcb *tcp)
1802 if (entering(tcp)) {
1803 printpath(tcp, tcp->u_arg[0]);
1806 printstatfs(tcp, tcp->u_arg[1]);
1807 tprintf(", %lu", tcp->u_arg[2]);
1813 osf_fstatfs(struct tcb *tcp)
1815 if (entering(tcp)) {
1816 tprintf("%lu, ", tcp->u_arg[0]);
1818 printstatfs(tcp, tcp->u_arg[1]);
1819 tprintf(", %lu", tcp->u_arg[2]);
1827 sys_chdir(struct tcb *tcp)
1829 if (entering(tcp)) {
1830 printpath(tcp, tcp->u_arg[0]);
1836 decode_mkdir(struct tcb *tcp, int offset)
1838 if (entering(tcp)) {
1839 printpath(tcp, tcp->u_arg[offset]);
1840 tprintf(", %#lo", tcp->u_arg[offset + 1]);
1846 sys_mkdir(struct tcb *tcp)
1848 return decode_mkdir(tcp, 0);
1852 sys_mkdirat(struct tcb *tcp)
1855 print_dirfd(tcp, tcp->u_arg[0]);
1856 return decode_mkdir(tcp, 1);
1860 sys_link(struct tcb *tcp)
1862 if (entering(tcp)) {
1863 printpath(tcp, tcp->u_arg[0]);
1865 printpath(tcp, tcp->u_arg[1]);
1871 sys_linkat(struct tcb *tcp)
1873 if (entering(tcp)) {
1874 print_dirfd(tcp, tcp->u_arg[0]);
1875 printpath(tcp, tcp->u_arg[1]);
1877 print_dirfd(tcp, tcp->u_arg[2]);
1878 printpath(tcp, tcp->u_arg[3]);
1880 printflags(at_flags, tcp->u_arg[4], "AT_???");
1886 sys_unlinkat(struct tcb *tcp)
1888 if (entering(tcp)) {
1889 print_dirfd(tcp, tcp->u_arg[0]);
1890 printpath(tcp, tcp->u_arg[1]);
1892 printflags(at_flags, tcp->u_arg[2], "AT_???");
1898 sys_symlinkat(struct tcb *tcp)
1900 if (entering(tcp)) {
1901 printpath(tcp, tcp->u_arg[0]);
1903 print_dirfd(tcp, tcp->u_arg[1]);
1904 printpath(tcp, tcp->u_arg[2]);
1910 decode_readlink(struct tcb *tcp, int offset)
1912 if (entering(tcp)) {
1913 printpath(tcp, tcp->u_arg[offset]);
1917 tprintf("%#lx", tcp->u_arg[offset + 1]);
1919 /* Used to use printpathn(), but readlink
1920 * neither includes NUL in the returned count,
1921 * nor actually writes it into memory.
1922 * printpathn() would decide on printing
1923 * "..." continuation based on garbage
1924 * past return buffer's end.
1926 printstr(tcp, tcp->u_arg[offset + 1], tcp->u_rval);
1927 tprintf(", %lu", tcp->u_arg[offset + 2]);
1933 sys_readlink(struct tcb *tcp)
1935 return decode_readlink(tcp, 0);
1939 sys_readlinkat(struct tcb *tcp)
1942 print_dirfd(tcp, tcp->u_arg[0]);
1943 return decode_readlink(tcp, 1);
1947 sys_renameat(struct tcb *tcp)
1949 if (entering(tcp)) {
1950 print_dirfd(tcp, tcp->u_arg[0]);
1951 printpath(tcp, tcp->u_arg[1]);
1953 print_dirfd(tcp, tcp->u_arg[2]);
1954 printpath(tcp, tcp->u_arg[3]);
1960 sys_chown(struct tcb *tcp)
1962 if (entering(tcp)) {
1963 printpath(tcp, tcp->u_arg[0]);
1964 printuid(", ", tcp->u_arg[1]);
1965 printuid(", ", tcp->u_arg[2]);
1971 sys_fchownat(struct tcb *tcp)
1973 if (entering(tcp)) {
1974 print_dirfd(tcp, tcp->u_arg[0]);
1975 printpath(tcp, tcp->u_arg[1]);
1976 printuid(", ", tcp->u_arg[2]);
1977 printuid(", ", tcp->u_arg[3]);
1979 printflags(at_flags, tcp->u_arg[4], "AT_???");
1985 sys_fchown(struct tcb *tcp)
1987 if (entering(tcp)) {
1988 printfd(tcp, tcp->u_arg[0]);
1989 printuid(", ", tcp->u_arg[1]);
1990 printuid(", ", tcp->u_arg[2]);
1996 decode_chmod(struct tcb *tcp, int offset)
1998 if (entering(tcp)) {
1999 printpath(tcp, tcp->u_arg[offset]);
2000 tprintf(", %#lo", tcp->u_arg[offset + 1]);
2006 sys_chmod(struct tcb *tcp)
2008 return decode_chmod(tcp, 0);
2012 sys_fchmodat(struct tcb *tcp)
2015 print_dirfd(tcp, tcp->u_arg[0]);
2016 return decode_chmod(tcp, 1);
2020 sys_fchmod(struct tcb *tcp)
2022 if (entering(tcp)) {
2023 printfd(tcp, tcp->u_arg[0]);
2024 tprintf(", %#lo", tcp->u_arg[1]);
2031 sys_osf_utimes(struct tcb *tcp)
2033 if (entering(tcp)) {
2034 printpath(tcp, tcp->u_arg[0]);
2036 printtv_bitness(tcp, tcp->u_arg[1], BITNESS_32, 0);
2043 decode_utimes(struct tcb *tcp, int offset, int special)
2045 if (entering(tcp)) {
2046 printpath(tcp, tcp->u_arg[offset]);
2048 if (tcp->u_arg[offset + 1] == 0)
2052 printtv_bitness(tcp, tcp->u_arg[offset + 1],
2053 BITNESS_CURRENT, special);
2055 printtv_bitness(tcp, tcp->u_arg[offset + 1]
2056 + sizeof(struct timeval),
2057 BITNESS_CURRENT, special);
2065 sys_utimes(struct tcb *tcp)
2067 return decode_utimes(tcp, 0, 0);
2071 sys_futimesat(struct tcb *tcp)
2074 print_dirfd(tcp, tcp->u_arg[0]);
2075 return decode_utimes(tcp, 1, 0);
2079 sys_utimensat(struct tcb *tcp)
2081 if (entering(tcp)) {
2082 print_dirfd(tcp, tcp->u_arg[0]);
2083 decode_utimes(tcp, 1, 1);
2085 printflags(at_flags, tcp->u_arg[3], "AT_???");
2091 sys_utime(struct tcb *tcp)
2096 long paranoia_for_huge_wordsize[4];
2100 if (entering(tcp)) {
2101 printpath(tcp, tcp->u_arg[0]);
2104 wordsize = current_wordsize;
2107 else if (!verbose(tcp))
2108 tprintf("%#lx", tcp->u_arg[1]);
2109 else if (umoven(tcp, tcp->u_arg[1], 2 * wordsize, (char *) &u) < 0)
2111 else if (wordsize == sizeof u.utl[0]) {
2112 tprintf("[%s,", sprinttime(u.utl[0]));
2113 tprintf(" %s]", sprinttime(u.utl[1]));
2115 else if (wordsize == sizeof u.uti[0]) {
2116 tprintf("[%s,", sprinttime(u.uti[0]));
2117 tprintf(" %s]", sprinttime(u.uti[1]));
2120 tprintf("<decode error: unsupported wordsize %d>",
2127 decode_mknod(struct tcb *tcp, int offset)
2129 int mode = tcp->u_arg[offset + 1];
2131 if (entering(tcp)) {
2132 printpath(tcp, tcp->u_arg[offset]);
2133 tprintf(", %s", sprintmode(mode));
2134 switch (mode & S_IFMT) {
2137 #if defined(SPARC) || defined(SPARC64)
2138 if (current_personality == 1)
2139 tprintf(", makedev(%lu, %lu)",
2140 (unsigned long) ((tcp->u_arg[offset + 2] >> 18) & 0x3fff),
2141 (unsigned long) (tcp->u_arg[offset + 2] & 0x3ffff));
2144 tprintf(", makedev(%lu, %lu)",
2145 (unsigned long) major(tcp->u_arg[offset + 2]),
2146 (unsigned long) minor(tcp->u_arg[offset + 2]));
2156 sys_mknod(struct tcb *tcp)
2158 return decode_mknod(tcp, 0);
2162 sys_mknodat(struct tcb *tcp)
2165 print_dirfd(tcp, tcp->u_arg[0]);
2166 return decode_mknod(tcp, 1);
2170 printdir(struct tcb *tcp, long addr)
2174 if (!verbose(tcp)) {
2175 tprintf("%#lx", addr);
2178 if (umove(tcp, addr, &d) < 0) {
2182 tprintf("{d_ino=%ld, ", (unsigned long) d.d_ino);
2184 printpathn(tcp, (long) ((struct dirent *) addr)->d_name, d.d_reclen);
2189 sys_readdir(struct tcb *tcp)
2191 if (entering(tcp)) {
2192 printfd(tcp, tcp->u_arg[0]);
2195 if (syserror(tcp) || tcp->u_rval == 0 || !verbose(tcp))
2196 tprintf("%#lx", tcp->u_arg[1]);
2198 printdir(tcp, tcp->u_arg[1]);
2199 /* Not much point in printing this out, it is always 1. */
2200 if (tcp->u_arg[2] != 1)
2201 tprintf(", %lu", tcp->u_arg[2]);
2206 static const struct xlat direnttypes[] = {
2207 { DT_UNKNOWN, "DT_UNKNOWN" },
2208 { DT_FIFO, "DT_FIFO" },
2209 { DT_CHR, "DT_CHR" },
2210 { DT_DIR, "DT_DIR" },
2211 { DT_BLK, "DT_BLK" },
2212 { DT_REG, "DT_REG" },
2213 { DT_LNK, "DT_LNK" },
2214 { DT_SOCK, "DT_SOCK" },
2215 { DT_WHT, "DT_WHT" },
2220 sys_getdents(struct tcb *tcp)
2222 int i, len, dents = 0;
2225 if (entering(tcp)) {
2226 printfd(tcp, tcp->u_arg[0]);
2230 if (syserror(tcp) || !verbose(tcp)) {
2231 tprintf("%#lx, %lu", tcp->u_arg[1], tcp->u_arg[2]);
2235 /* Beware of insanely large or negative values in tcp->u_rval */
2236 if (tcp->u_rval > 1024*1024)
2238 if (tcp->u_rval < 0)
2240 buf = len ? malloc(len) : NULL;
2242 die_out_of_memory();
2243 if (umoven(tcp, tcp->u_arg[1], len, buf) < 0) {
2244 tprintf("%#lx, %lu", tcp->u_arg[1], tcp->u_arg[2]);
2250 for (i = 0; i < len;) {
2251 struct kernel_dirent *d = (struct kernel_dirent *) &buf[i];
2253 tprintf("%s{d_ino=%lu, d_off=%lu, ",
2254 i ? " " : "", d->d_ino, d->d_off);
2255 tprintf("d_reclen=%u, d_name=\"%s\", d_type=",
2256 d->d_reclen, d->d_name);
2257 printxval(direnttypes, buf[i + d->d_reclen - 1], "DT_???");
2261 tprints("/* d_reclen == 0, problem here */");
2270 tprintf("/* %u entries */", dents);
2271 tprintf(", %lu", tcp->u_arg[2]);
2276 #if _LFS64_LARGEFILE
2278 sys_getdents64(struct tcb *tcp)
2280 int i, len, dents = 0;
2283 if (entering(tcp)) {
2284 printfd(tcp, tcp->u_arg[0]);
2288 if (syserror(tcp) || !verbose(tcp)) {
2289 tprintf("%#lx, %lu", tcp->u_arg[1], tcp->u_arg[2]);
2294 /* Beware of insanely large or negative tcp->u_rval */
2295 if (tcp->u_rval > 1024*1024)
2297 if (tcp->u_rval < 0)
2299 buf = len ? malloc(len) : NULL;
2301 die_out_of_memory();
2303 if (umoven(tcp, tcp->u_arg[1], len, buf) < 0) {
2304 tprintf("%#lx, %lu", tcp->u_arg[1], tcp->u_arg[2]);
2310 for (i = 0; i < len;) {
2311 struct dirent64 *d = (struct dirent64 *) &buf[i];
2313 tprintf("%s{d_ino=%" PRIu64 ", d_off=%" PRId64 ", ",
2318 printxval(direnttypes, d->d_type, "DT_???");
2320 tprintf("d_reclen=%u, d_name=\"%s\"}",
2321 d->d_reclen, d->d_name);
2324 tprints("/* d_reclen == 0, problem here */");
2333 tprintf("/* %u entries */", dents);
2334 tprintf(", %lu", tcp->u_arg[2]);
2341 sys_getcwd(struct tcb *tcp)
2345 tprintf("%#lx", tcp->u_arg[0]);
2347 printpathn(tcp, tcp->u_arg[0], tcp->u_rval - 1);
2348 tprintf(", %lu", tcp->u_arg[1]);
2353 #ifdef HAVE_SYS_ASYNCH_H
2356 sys_aioread(struct tcb *tcp)
2358 struct aio_result_t res;
2360 if (entering(tcp)) {
2361 tprintf("%lu, ", tcp->u_arg[0]);
2364 tprintf("%#lx", tcp->u_arg[1]);
2366 printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
2367 tprintf(", %lu, %lu, ", tcp->u_arg[2], tcp->u_arg[3]);
2368 printxval(whence, tcp->u_arg[4], "L_???");
2369 if (syserror(tcp) || tcp->u_arg[5] == 0
2370 || umove(tcp, tcp->u_arg[5], &res) < 0)
2371 tprintf(", %#lx", tcp->u_arg[5]);
2373 tprintf(", {aio_return %d aio_errno %d}",
2374 res.aio_return, res.aio_errno);
2380 sys_aiowrite(struct tcb *tcp)
2382 struct aio_result_t res;
2384 if (entering(tcp)) {
2385 tprintf("%lu, ", tcp->u_arg[0]);
2386 printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
2387 tprintf(", %lu, %lu, ", tcp->u_arg[2], tcp->u_arg[3]);
2388 printxval(whence, tcp->u_arg[4], "L_???");
2391 if (tcp->u_arg[5] == 0)
2393 else if (syserror(tcp)
2394 || umove(tcp, tcp->u_arg[5], &res) < 0)
2395 tprintf(", %#lx", tcp->u_arg[5]);
2397 tprintf(", {aio_return %d aio_errno %d}",
2398 res.aio_return, res.aio_errno);
2404 sys_aiowait(struct tcb *tcp)
2407 printtv(tcp, tcp->u_arg[0]);
2412 sys_aiocancel(struct tcb *tcp)
2414 struct aio_result_t res;
2417 if (tcp->u_arg[0] == 0)
2419 else if (syserror(tcp)
2420 || umove(tcp, tcp->u_arg[0], &res) < 0)
2421 tprintf("%#lx", tcp->u_arg[0]);
2423 tprintf("{aio_return %d aio_errno %d}",
2424 res.aio_return, res.aio_errno);
2429 #endif /* HAVE_SYS_ASYNCH_H */
2431 static const struct xlat xattrflags[] = {
2433 { XATTR_CREATE, "XATTR_CREATE" },
2434 { XATTR_REPLACE, "XATTR_REPLACE" },
2440 print_xattr_val(struct tcb *tcp, int failed,
2442 unsigned long insize,
2448 unsigned long capacity = 4 * size + 1;
2449 unsigned char *buf = (capacity < size) ? NULL : malloc(capacity);
2450 if (buf == NULL || /* probably a bogus size argument */
2451 umoven(tcp, arg, size, (char *) &buf[3 * size]) < 0) {
2455 unsigned char *out = buf;
2456 unsigned char *in = &buf[3 * size];
2458 for (i = 0; i < size; ++i) {
2462 #define tohex(n) "0123456789abcdef"[n]
2465 *out++ = tohex(in[i] / 16);
2466 *out++ = tohex(in[i] % 16);
2469 /* Don't print terminating NUL if there is one. */
2470 if (i > 0 && in[i - 1] == '\0')
2473 tprintf(", \"%s\", %ld", buf, insize);
2478 tprintf(", 0x%lx, %ld", arg, insize);
2482 sys_setxattr(struct tcb *tcp)
2484 if (entering(tcp)) {
2485 printpath(tcp, tcp->u_arg[0]);
2487 printstr(tcp, tcp->u_arg[1], -1);
2488 print_xattr_val(tcp, 0, tcp->u_arg[2], tcp->u_arg[3], tcp->u_arg[3]);
2490 printflags(xattrflags, tcp->u_arg[4], "XATTR_???");
2496 sys_fsetxattr(struct tcb *tcp)
2498 if (entering(tcp)) {
2499 printfd(tcp, tcp->u_arg[0]);
2501 printstr(tcp, tcp->u_arg[1], -1);
2502 print_xattr_val(tcp, 0, tcp->u_arg[2], tcp->u_arg[3], tcp->u_arg[3]);
2504 printflags(xattrflags, tcp->u_arg[4], "XATTR_???");
2510 sys_getxattr(struct tcb *tcp)
2512 if (entering(tcp)) {
2513 printpath(tcp, tcp->u_arg[0]);
2515 printstr(tcp, tcp->u_arg[1], -1);
2517 print_xattr_val(tcp, syserror(tcp), tcp->u_arg[2], tcp->u_arg[3],
2524 sys_fgetxattr(struct tcb *tcp)
2526 if (entering(tcp)) {
2527 printfd(tcp, tcp->u_arg[0]);
2529 printstr(tcp, tcp->u_arg[1], -1);
2531 print_xattr_val(tcp, syserror(tcp), tcp->u_arg[2], tcp->u_arg[3],
2538 print_xattr_list(struct tcb *tcp, unsigned long addr, unsigned long size)
2540 if (syserror(tcp)) {
2541 tprintf("%#lx", addr);
2547 (size < tcp->u_rval) ? size : tcp->u_rval;
2548 printstr(tcp, addr, len);
2551 tprintf(", %lu", size);
2555 sys_listxattr(struct tcb *tcp)
2557 if (entering(tcp)) {
2558 printpath(tcp, tcp->u_arg[0]);
2561 print_xattr_list(tcp, tcp->u_arg[1], tcp->u_arg[2]);
2567 sys_flistxattr(struct tcb *tcp)
2569 if (entering(tcp)) {
2570 printfd(tcp, tcp->u_arg[0]);
2573 print_xattr_list(tcp, tcp->u_arg[1], tcp->u_arg[2]);
2579 sys_removexattr(struct tcb *tcp)
2581 if (entering(tcp)) {
2582 printpath(tcp, tcp->u_arg[0]);
2584 printstr(tcp, tcp->u_arg[1], -1);
2590 sys_fremovexattr(struct tcb *tcp)
2592 if (entering(tcp)) {
2593 printfd(tcp, tcp->u_arg[0]);
2595 printstr(tcp, tcp->u_arg[1], -1);
2600 static const struct xlat advise[] = {
2601 { POSIX_FADV_NORMAL, "POSIX_FADV_NORMAL" },
2602 { POSIX_FADV_RANDOM, "POSIX_FADV_RANDOM" },
2603 { POSIX_FADV_SEQUENTIAL, "POSIX_FADV_SEQUENTIAL" },
2604 { POSIX_FADV_WILLNEED, "POSIX_FADV_WILLNEED" },
2605 { POSIX_FADV_DONTNEED, "POSIX_FADV_DONTNEED" },
2606 { POSIX_FADV_NOREUSE, "POSIX_FADV_NOREUSE" },
2611 sys_fadvise64(struct tcb *tcp)
2613 if (entering(tcp)) {
2615 printfd(tcp, tcp->u_arg[0]);
2616 argn = printllval(tcp, ", %lld", 1);
2617 tprintf(", %ld, ", tcp->u_arg[argn++]);
2618 printxval(advise, tcp->u_arg[argn], "POSIX_FADV_???");
2624 sys_fadvise64_64(struct tcb *tcp)
2626 if (entering(tcp)) {
2628 printfd(tcp, tcp->u_arg[0]);
2629 #if defined ARM || defined POWERPC
2630 argn = printllval(tcp, ", %lld, ", 2);
2632 argn = printllval(tcp, ", %lld, ", 1);
2634 argn = printllval(tcp, "%lld, ", argn);
2635 #if defined ARM || defined POWERPC
2636 printxval(advise, tcp->u_arg[1], "POSIX_FADV_???");
2638 printxval(advise, tcp->u_arg[argn], "POSIX_FADV_???");
2644 static const struct xlat inotify_modes[] = {
2645 { 0x00000001, "IN_ACCESS" },
2646 { 0x00000002, "IN_MODIFY" },
2647 { 0x00000004, "IN_ATTRIB" },
2648 { 0x00000008, "IN_CLOSE_WRITE"},
2649 { 0x00000010, "IN_CLOSE_NOWRITE"},
2650 { 0x00000020, "IN_OPEN" },
2651 { 0x00000040, "IN_MOVED_FROM" },
2652 { 0x00000080, "IN_MOVED_TO" },
2653 { 0x00000100, "IN_CREATE" },
2654 { 0x00000200, "IN_DELETE" },
2655 { 0x00000400, "IN_DELETE_SELF"},
2656 { 0x00000800, "IN_MOVE_SELF" },
2657 { 0x00002000, "IN_UNMOUNT" },
2658 { 0x00004000, "IN_Q_OVERFLOW" },
2659 { 0x00008000, "IN_IGNORED" },
2660 { 0x01000000, "IN_ONLYDIR" },
2661 { 0x02000000, "IN_DONT_FOLLOW"},
2662 { 0x20000000, "IN_MASK_ADD" },
2663 { 0x40000000, "IN_ISDIR" },
2664 { 0x80000000, "IN_ONESHOT" },
2668 static const struct xlat inotify_init_flags[] = {
2669 { 0x00000800, "IN_NONBLOCK" },
2670 { 0x00080000, "IN_CLOEXEC" },
2675 sys_inotify_add_watch(struct tcb *tcp)
2677 if (entering(tcp)) {
2678 printfd(tcp, tcp->u_arg[0]);
2680 printpath(tcp, tcp->u_arg[1]);
2682 printflags(inotify_modes, tcp->u_arg[2], "IN_???");
2688 sys_inotify_rm_watch(struct tcb *tcp)
2690 if (entering(tcp)) {
2691 printfd(tcp, tcp->u_arg[0]);
2692 tprintf(", %d", (int) tcp->u_arg[1]);
2698 sys_inotify_init1(struct tcb *tcp)
2701 printflags(inotify_init_flags, tcp->u_arg[0], "IN_???");
2706 sys_fallocate(struct tcb *tcp)
2708 if (entering(tcp)) {
2710 printfd(tcp, tcp->u_arg[0]); /* fd */
2711 tprintf(", %#lo, ", tcp->u_arg[1]); /* mode */
2712 argn = printllval(tcp, "%llu, ", 2); /* offset */
2713 printllval(tcp, "%llu", argn); /* len */
2718 #ifndef SWAP_FLAG_PREFER
2719 # define SWAP_FLAG_PREFER 0x8000
2721 #ifndef SWAP_FLAG_DISCARD
2722 # define SWAP_FLAG_DISCARD 0x10000
2724 static const struct xlat swap_flags[] = {
2725 { SWAP_FLAG_PREFER, "SWAP_FLAG_PREFER" },
2726 { SWAP_FLAG_DISCARD, "SWAP_FLAG_DISCARD" },
2731 sys_swapon(struct tcb *tcp)
2733 if (entering(tcp)) {
2734 int flags = tcp->u_arg[1];
2735 printpath(tcp, tcp->u_arg[0]);
2737 printflags(swap_flags, flags & ~SWAP_FLAG_PRIO_MASK,
2739 if (flags & SWAP_FLAG_PREFER)
2740 tprintf("|%d", flags & SWAP_FLAG_PRIO_MASK);
2751 realprintstat64(struct tcb *tcp, long addr)
2753 struct stat64 statbuf;
2759 if (syserror(tcp) || !verbose(tcp)) {
2760 tprintf("%#lx", addr);
2764 if (umove(tcp, addr, &statbuf) < 0) {
2770 tprintf("{st_dev=makedev(%lu, %lu), st_ino=%llu, st_mode=%s, ",
2771 (unsigned long) major(statbuf.st_dev),
2772 (unsigned long) minor(statbuf.st_dev),
2773 (unsigned long long) statbuf.st_ino,
2774 sprintmode(statbuf.st_mode));
2775 tprintf("st_nlink=%lu, st_uid=%lu, st_gid=%lu, ",
2776 (unsigned long) statbuf.st_nlink,
2777 (unsigned long) statbuf.st_uid,
2778 (unsigned long) statbuf.st_gid);
2779 tprintf("st_blksize=%lu, ",
2780 (unsigned long) statbuf.st_blksize);
2781 tprintf("st_blocks=%lu, ", (unsigned long) statbuf.st_blocks);
2784 tprintf("{st_mode=%s, ", sprintmode(statbuf.st_mode));
2785 switch (statbuf.st_mode & S_IFMT) {
2786 case S_IFCHR: case S_IFBLK:
2787 tprintf("st_rdev=makedev(%lu, %lu), ",
2788 (unsigned long) major(statbuf.st_rdev),
2789 (unsigned long) minor(statbuf.st_rdev));
2792 tprintf("st_size=%llu, ", (unsigned long long) statbuf.st_size);
2796 tprintf("st_atime=%s, ", sprinttime(statbuf.st_atime));
2797 tprintf("st_mtime=%s, ", sprinttime(statbuf.st_mtime));
2798 tprintf("st_ctime=%s", sprinttime(statbuf.st_ctime));
2806 sys_fstat64(struct tcb *tcp)
2808 if (entering(tcp)) {
2809 printfd(tcp, tcp->u_arg[0]);
2812 realprintstat64(tcp, tcp->u_arg[1]);
2818 sys_stat64(struct tcb *tcp)
2820 if (entering(tcp)) {
2821 printpath(tcp, tcp->u_arg[0]);
2824 realprintstat64(tcp, tcp->u_arg[1]);