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.
38 struct kernel_dirent {
41 unsigned short d_reclen;
45 # define kernel_dirent dirent
51 unsigned short st_dev;
53 unsigned short st_mode;
55 unsigned short st_uid;
56 unsigned short st_gid;
57 unsigned short st_rdev;
60 unsigned int __unused1;
62 unsigned int __unused2;
64 unsigned int __unused3;
67 unsigned int __unused4[2];
74 unsigned int st_nlink;
84 unsigned long __unused4[2];
87 # define stat kernel_stat
88 # include <asm/stat.h>
100 # define dev_t __kernel_dev_t
101 # define ino_t __kernel_ino_t
102 # define mode_t __kernel_mode_t
103 # define nlink_t __kernel_nlink_t
104 # define uid_t __kernel_uid_t
105 # define gid_t __kernel_gid_t
106 # define off_t __kernel_off_t
107 # define loff_t __kernel_loff_t
109 # include <asm/stat.h>
122 # define mode_t mode_t
123 # define nlink_t nlink_t
127 # define loff_t loff_t
129 # ifdef HPPA /* asm-parisc/stat.h defines stat64 */
132 # define stat libc_stat
133 # define stat64 libc_stat64
134 # include <sys/stat.h>
137 /* These might be macros. */
142 # define stat64 hpux_stat64
145 # include <sys/stat.h>
151 # include <sys/cred.h>
154 #ifdef HAVE_SYS_VFS_H
158 #ifdef HAVE_LINUX_XATTR_H
159 #include <linux/xattr.h>
161 #define XATTR_CREATE 1
162 #define XATTR_REPLACE 2
166 #include <sys/param.h>
167 #include <sys/mount.h>
168 #include <sys/stat.h>
171 #if _LFS64_LARGEFILE && (defined(LINUX) || defined(SVR4))
172 # ifdef HAVE_INTTYPES_H
173 # include <inttypes.h>
175 # define PRId64 "lld"
176 # define PRIu64 "llu"
180 #if HAVE_LONG_LONG_OFF_T
182 * Ugly hacks for systems that have typedef long long off_t
186 #define HAVE_STAT64 1 /* Ugly hack */
188 #define sys_stat64 sys_stat
189 #define sys_fstat64 sys_fstat
190 #define sys_lstat64 sys_lstat
191 #define sys_lseek64 sys_lseek
192 #define sys_truncate64 sys_truncate
193 #define sys_ftruncate64 sys_ftruncate
196 #ifdef MAJOR_IN_SYSMACROS
197 #include <sys/sysmacros.h>
200 #ifdef MAJOR_IN_MKDEV
201 #include <sys/mkdev.h>
204 #ifdef HAVE_SYS_ASYNCH_H
205 #include <sys/asynch.h>
212 const struct xlat open_access_modes[] = {
213 { O_RDONLY, "O_RDONLY" },
214 { O_WRONLY, "O_WRONLY" },
215 { O_RDWR, "O_RDWR" },
217 { O_ACCMODE, "O_ACCMODE" },
222 const struct xlat open_mode_flags[] = {
223 { O_CREAT, "O_CREAT" },
224 { O_EXCL, "O_EXCL" },
225 { O_NOCTTY, "O_NOCTTY" },
226 { O_TRUNC, "O_TRUNC" },
227 { O_APPEND, "O_APPEND" },
228 { O_NONBLOCK, "O_NONBLOCK" },
230 { O_SYNC, "O_SYNC" },
233 { O_ASYNC, "O_ASYNC" },
236 { O_DSYNC, "O_DSYNC" },
239 { O_RSYNC, "O_RSYNC" },
241 #if defined(O_NDELAY) && (O_NDELAY != O_NONBLOCK)
242 { O_NDELAY, "O_NDELAY" },
245 { O_PRIV, "O_PRIV" },
248 { O_DIRECT, "O_DIRECT" },
251 # if O_LARGEFILE == 0 /* biarch platforms in 64-bit mode */
254 # define O_LARGEFILE 0x40000
255 # elif defined X86_64 || defined S390X
256 # define O_LARGEFILE 0100000
260 { O_LARGEFILE, "O_LARGEFILE" },
264 { O_DIRECTORY, "O_DIRECTORY" },
267 { O_NOFOLLOW, "O_NOFOLLOW" },
270 { O_NOATIME, "O_NOATIME" },
273 { O_CLOEXEC, "O_CLOEXEC" },
277 { FNDELAY, "FNDELAY" },
280 { FAPPEND, "FAPPEND" },
286 { FDEFER, "FDEFER" },
289 { FASYNC, "FASYNC" },
292 { FSHLOCK, "FSHLOCK" },
295 { FEXLOCK, "FEXLOCK" },
298 { FCREAT, "FCREAT" },
301 { FTRUNC, "FTRUNC" },
313 { FNOCTTY, "FNOCTTY" },
316 { O_SHLOCK, "O_SHLOCK" },
319 { O_EXLOCK, "O_EXLOCK" },
327 # define AT_FDCWD -100
330 /* The fd is an "int", so when decoding x86 on x86_64, we need to force sign
331 * extension to get the right value. We do this by declaring fd as int here.
337 tprintf("AT_FDCWD, ");
344 * Pity stpcpy() is not standardized...
347 str_append(char *dst, const char *src)
349 while ((*dst = *src++) != '\0')
355 * low bits of the open(2) flags define access mode,
356 * other bits are real flags.
359 sprint_open_modes(mode_t flags)
361 static char outstr[1024];
365 const struct xlat *x;
367 p = str_append(outstr, "flags ");
368 str = xlookup(open_access_modes, flags & 3);
370 p = str_append(p, str);
377 for (x = open_mode_flags; x->str; x++) {
378 if ((flags & x->val) == x->val) {
381 p = str_append(p, x->str);
388 /* flags is still nonzero */
391 sprintf(p, "%#x", flags);
396 tprint_open_modes(mode_t flags)
398 tprintf("%s", sprint_open_modes(flags) + sizeof("flags"));
402 decode_open(struct tcb *tcp, int offset)
405 printpath(tcp, tcp->u_arg[offset]);
408 tprint_open_modes(tcp->u_arg[offset + 1]);
409 if (tcp->u_arg[offset + 1] & O_CREAT) {
411 tprintf(", %#lo", tcp->u_arg[offset + 2]);
418 sys_open(struct tcb *tcp)
420 return decode_open(tcp, 0);
425 sys_openat(struct tcb *tcp)
428 print_dirfd(tcp->u_arg[0]);
429 return decode_open(tcp, 1);
434 static const struct xlat openmodessol[] = {
438 { 0x80, "O_NONBLOCK" },
440 { 0x100, "O_CREAT" },
441 { 0x200, "O_TRUNC" },
443 { 0x800, "O_NOCTTY" },
446 { 0x8000, "O_RSYNC" },
448 { 0x1000, "O_PRIV" },
453 solaris_open(struct tcb *tcp)
456 printpath(tcp, tcp->u_arg[0]);
459 printflags(openmodessol, tcp->u_arg[1] + 1, "O_???");
460 if (tcp->u_arg[1] & 0x100) {
462 tprintf(", %#lo", tcp->u_arg[2]);
471 sys_creat(struct tcb *tcp)
474 printpath(tcp, tcp->u_arg[0]);
475 tprintf(", %#lo", tcp->u_arg[1]);
480 static const struct xlat access_flags[] = {
486 { EFF_ONLY_OK, "EFF_ONLY_OK" },
495 decode_access(struct tcb *tcp, int offset)
498 printpath(tcp, tcp->u_arg[offset]);
500 printflags(access_flags, tcp->u_arg[offset + 1], "?_OK");
506 sys_access(struct tcb *tcp)
508 return decode_access(tcp, 0);
513 sys_faccessat(struct tcb *tcp)
516 print_dirfd(tcp->u_arg[0]);
517 return decode_access(tcp, 1);
522 sys_umask(struct tcb *tcp)
525 tprintf("%#lo", tcp->u_arg[0]);
530 static const struct xlat whence[] = {
531 { SEEK_SET, "SEEK_SET" },
532 { SEEK_CUR, "SEEK_CUR" },
533 { SEEK_END, "SEEK_END" },
537 #ifndef HAVE_LONG_LONG_OFF_T
538 #if defined (LINUX_MIPSN32)
540 sys_lseek(struct tcb *tcp)
546 tprintf("%ld, ", tcp->u_arg[0]);
547 offset = tcp->ext_arg[1];
548 _whence = tcp->u_arg[2];
549 if (_whence == SEEK_SET)
550 tprintf("%llu, ", offset);
552 tprintf("%lld, ", offset);
553 printxval(whence, _whence, "SEEK_???");
555 return RVAL_UDECIMAL;
557 #else /* !LINUX_MIPSN32 */
559 sys_lseek(struct tcb *tcp)
565 tprintf("%ld, ", tcp->u_arg[0]);
566 offset = tcp->u_arg[1];
567 _whence = tcp->u_arg[2];
568 if (_whence == SEEK_SET)
569 tprintf("%lu, ", offset);
571 tprintf("%ld, ", offset);
572 printxval(whence, _whence, "SEEK_???");
574 return RVAL_UDECIMAL;
576 #endif /* LINUX_MIPSN32 */
581 sys_llseek(struct tcb *tcp)
585 * This one call takes explicitly two 32-bit arguments hi, lo,
586 * rather than one 64-bit argument for which LONG_LONG works
587 * appropriate for the native byte order.
589 if (tcp->u_arg[4] == SEEK_SET)
590 tprintf("%ld, %llu, ", tcp->u_arg[0],
591 (((long long int) tcp->u_arg[1]) << 32
592 | (unsigned long long) (unsigned) tcp->u_arg[2]));
594 tprintf("%ld, %lld, ", tcp->u_arg[0],
595 (((long long int) tcp->u_arg[1]) << 32
596 | (unsigned long long) (unsigned) tcp->u_arg[2]));
600 if (syserror(tcp) || umove(tcp, tcp->u_arg[3], &off) < 0)
601 tprintf("%#lx, ", tcp->u_arg[3]);
603 tprintf("[%llu], ", off);
604 printxval(whence, tcp->u_arg[4], "SEEK_???");
610 sys_readahead(struct tcb *tcp)
613 tprintf("%ld, %lld, %ld", tcp->u_arg[0],
614 # if defined LINUX_MIPSN32
615 tcp->ext_arg[1], tcp->u_arg[2]
616 # elif defined IA64 || defined X86_64 || defined ALPHA || defined LINUX_MIPSN64
617 (long long int) tcp->u_arg[1], tcp->u_arg[2]
619 LONG_LONG(tcp->u_arg[1], tcp->u_arg[2]), tcp->u_arg[3]
627 #if _LFS64_LARGEFILE || HAVE_LONG_LONG_OFF_T
629 sys_lseek64(struct tcb *tcp)
633 ALIGN64 (tcp, 1); /* FreeBSD aligns off_t args */
634 offset = LONG_LONG(tcp->u_arg [1], tcp->u_arg[2]);
635 if (tcp->u_arg[3] == SEEK_SET)
636 tprintf("%ld, %llu, ", tcp->u_arg[0], offset);
638 tprintf("%ld, %lld, ", tcp->u_arg[0], offset);
639 printxval(whence, tcp->u_arg[3], "SEEK_???");
641 return RVAL_LUDECIMAL;
645 #ifndef HAVE_LONG_LONG_OFF_T
647 sys_truncate(struct tcb *tcp)
650 printpath(tcp, tcp->u_arg[0]);
651 tprintf(", %lu", tcp->u_arg[1]);
657 #if _LFS64_LARGEFILE || HAVE_LONG_LONG_OFF_T
659 sys_truncate64(struct tcb *tcp)
663 printpath(tcp, tcp->u_arg[0]);
664 tprintf(", %llu", LONG_LONG(tcp->u_arg[1],tcp->u_arg[2]));
670 #ifndef HAVE_LONG_LONG_OFF_T
672 sys_ftruncate(struct tcb *tcp)
675 tprintf("%ld, %lu", tcp->u_arg[0], tcp->u_arg[1]);
681 #if _LFS64_LARGEFILE || HAVE_LONG_LONG_OFF_T
683 sys_ftruncate64(struct tcb *tcp)
687 tprintf("%ld, %llu", tcp->u_arg[0],
688 LONG_LONG(tcp->u_arg[1] ,tcp->u_arg[2]));
696 static const struct xlat modetypes[] = {
697 { S_IFREG, "S_IFREG" },
698 { S_IFSOCK, "S_IFSOCK" },
699 { S_IFIFO, "S_IFIFO" },
700 { S_IFLNK, "S_IFLNK" },
701 { S_IFDIR, "S_IFDIR" },
702 { S_IFBLK, "S_IFBLK" },
703 { S_IFCHR, "S_IFCHR" },
713 if ((mode & S_IFMT) == 0)
715 else if ((s = xlookup(modetypes, mode & S_IFMT)) == NULL) {
716 sprintf(buf, "%#o", mode);
719 sprintf(buf, "%s%s%s%s", s,
720 (mode & S_ISUID) ? "|S_ISUID" : "",
721 (mode & S_ISGID) ? "|S_ISGID" : "",
722 (mode & S_ISVTX) ? "|S_ISVTX" : "");
723 mode &= ~(S_IFMT|S_ISUID|S_ISGID|S_ISVTX);
725 sprintf(buf + strlen(buf), "|%#o", mode);
726 s = (*buf == '|') ? buf + 1 : buf;
740 if ((tmp = localtime(&t)))
741 snprintf(buf, sizeof buf, "%02d/%02d/%02d-%02d:%02d:%02d",
742 tmp->tm_year + 1900, tmp->tm_mon + 1, tmp->tm_mday,
743 tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
745 snprintf(buf, sizeof buf, "%lu", (unsigned long) t);
758 int st_pad1[3]; /* network id */
767 int st_pad3; /* st_size, off_t expansion */
768 timestruct_t st_atime;
769 timestruct_t st_mtime;
770 timestruct_t st_ctime;
774 int st_pad4[8]; /* expansion area */
778 printstatsol(struct tcb *tcp, long addr)
780 struct solstat statbuf;
782 if (umove(tcp, addr, &statbuf) < 0) {
787 tprintf("{st_dev=makedev(%lu, %lu), st_ino=%lu, st_mode=%s, ",
788 (unsigned long) ((statbuf.st_dev >> 18) & 0x3fff),
789 (unsigned long) (statbuf.st_dev & 0x3ffff),
790 (unsigned long) statbuf.st_ino,
791 sprintmode(statbuf.st_mode));
792 tprintf("st_nlink=%lu, st_uid=%lu, st_gid=%lu, ",
793 (unsigned long) statbuf.st_nlink,
794 (unsigned long) statbuf.st_uid,
795 (unsigned long) statbuf.st_gid);
796 tprintf("st_blksize=%lu, ", (unsigned long) statbuf.st_blksize);
797 tprintf("st_blocks=%lu, ", (unsigned long) statbuf.st_blocks);
800 tprintf("{st_mode=%s, ", sprintmode(statbuf.st_mode));
801 switch (statbuf.st_mode & S_IFMT) {
802 case S_IFCHR: case S_IFBLK:
803 tprintf("st_rdev=makedev(%lu, %lu), ",
804 (unsigned long) ((statbuf.st_rdev >> 18) & 0x3fff),
805 (unsigned long) (statbuf.st_rdev & 0x3ffff));
808 tprintf("st_size=%u, ", statbuf.st_size);
812 tprintf("st_atime=%s, ", sprinttime(statbuf.st_atime.tv_sec));
813 tprintf("st_mtime=%s, ", sprinttime(statbuf.st_mtime.tv_sec));
814 tprintf("st_ctime=%s}", sprinttime(statbuf.st_ctime.tv_sec));
820 #if defined (SPARC64)
822 printstat_sparc64(struct tcb *tcp, long addr)
824 struct stat_sparc64 statbuf;
826 if (umove(tcp, addr, &statbuf) < 0) {
832 tprintf("{st_dev=makedev(%lu, %lu), st_ino=%lu, st_mode=%s, ",
833 (unsigned long) major(statbuf.st_dev),
834 (unsigned long) minor(statbuf.st_dev),
835 (unsigned long) statbuf.st_ino,
836 sprintmode(statbuf.st_mode));
837 tprintf("st_nlink=%lu, st_uid=%lu, st_gid=%lu, ",
838 (unsigned long) statbuf.st_nlink,
839 (unsigned long) statbuf.st_uid,
840 (unsigned long) statbuf.st_gid);
841 tprintf("st_blksize=%lu, ",
842 (unsigned long) statbuf.st_blksize);
843 tprintf("st_blocks=%lu, ",
844 (unsigned long) statbuf.st_blocks);
847 tprintf("{st_mode=%s, ", sprintmode(statbuf.st_mode));
848 switch (statbuf.st_mode & S_IFMT) {
849 case S_IFCHR: case S_IFBLK:
850 tprintf("st_rdev=makedev(%lu, %lu), ",
851 (unsigned long) major(statbuf.st_rdev),
852 (unsigned long) minor(statbuf.st_rdev));
855 tprintf("st_size=%lu, ", statbuf.st_size);
859 tprintf("st_atime=%s, ", sprinttime(statbuf.st_atime));
860 tprintf("st_mtime=%s, ", sprinttime(statbuf.st_mtime));
861 tprintf("st_ctime=%s", sprinttime(statbuf.st_ctime));
868 #endif /* LINUXSPARC */
870 static const struct xlat fileflags[] = {
872 { UF_NODUMP, "UF_NODUMP" },
873 { UF_IMMUTABLE, "UF_IMMUTABLE" },
874 { UF_APPEND, "UF_APPEND" },
875 { UF_OPAQUE, "UF_OPAQUE" },
876 { UF_NOUNLINK, "UF_NOUNLINK" },
877 { SF_ARCHIVED, "SF_ARCHIVED" },
878 { SF_IMMUTABLE, "SF_IMMUTABLE" },
879 { SF_APPEND, "SF_APPEND" },
880 { SF_NOUNLINK, "SF_NOUNLINK" },
883 { _S_ISMLD, "_S_ISMLD" },
886 { _S_ISMOUNTED, "_S_ISMOUNTED" },
894 sys_chflags(struct tcb *tcp)
897 printpath(tcp, tcp->u_arg[0]);
899 printflags(fileflags, tcp->u_arg[1], "UF_???");
905 sys_fchflags(struct tcb *tcp)
908 tprintf("%ld, ", tcp->u_arg[0]);
909 printflags(fileflags, tcp->u_arg[1], "UF_???");
915 #ifndef HAVE_LONG_LONG_OFF_T
917 realprintstat(struct tcb *tcp, struct stat *statbuf)
920 tprintf("{st_dev=makedev(%lu, %lu), st_ino=%lu, st_mode=%s, ",
921 (unsigned long) major(statbuf->st_dev),
922 (unsigned long) minor(statbuf->st_dev),
923 (unsigned long) statbuf->st_ino,
924 sprintmode(statbuf->st_mode));
925 tprintf("st_nlink=%lu, st_uid=%lu, st_gid=%lu, ",
926 (unsigned long) statbuf->st_nlink,
927 (unsigned long) statbuf->st_uid,
928 (unsigned long) statbuf->st_gid);
929 #ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
930 tprintf("st_blksize=%lu, ", (unsigned long) statbuf->st_blksize);
932 #ifdef HAVE_STRUCT_STAT_ST_BLOCKS
933 tprintf("st_blocks=%lu, ", (unsigned long) statbuf->st_blocks);
937 tprintf("{st_mode=%s, ", sprintmode(statbuf->st_mode));
938 switch (statbuf->st_mode & S_IFMT) {
939 case S_IFCHR: case S_IFBLK:
940 #ifdef HAVE_STRUCT_STAT_ST_RDEV
941 tprintf("st_rdev=makedev(%lu, %lu), ",
942 (unsigned long) major(statbuf->st_rdev),
943 (unsigned long) minor(statbuf->st_rdev));
944 #else /* !HAVE_STRUCT_STAT_ST_RDEV */
945 tprintf("st_size=makedev(%lu, %lu), ",
946 (unsigned long) major(statbuf->st_size),
947 (unsigned long) minor(statbuf->st_size));
948 #endif /* !HAVE_STRUCT_STAT_ST_RDEV */
951 tprintf("st_size=%lu, ", statbuf->st_size);
955 tprintf("st_atime=%s, ", sprinttime(statbuf->st_atime));
956 tprintf("st_mtime=%s, ", sprinttime(statbuf->st_mtime));
957 tprintf("st_ctime=%s", sprinttime(statbuf->st_ctime));
958 #if HAVE_STRUCT_STAT_ST_FLAGS
959 tprintf(", st_flags=");
960 printflags(fileflags, statbuf->st_flags, "UF_???");
962 #if HAVE_STRUCT_STAT_ST_ACLCNT
963 tprintf(", st_aclcnt=%d", statbuf->st_aclcnt);
965 #if HAVE_STRUCT_STAT_ST_LEVEL
966 tprintf(", st_level=%ld", statbuf->st_level);
968 #if HAVE_STRUCT_STAT_ST_FSTYPE
969 tprintf(", st_fstype=%.*s",
970 (int) sizeof statbuf->st_fstype, statbuf->st_fstype);
972 #if HAVE_STRUCT_STAT_ST_GEN
973 tprintf(", st_gen=%u", statbuf->st_gen);
983 printstat(struct tcb *tcp, long addr)
991 if (syserror(tcp) || !verbose(tcp)) {
992 tprintf("%#lx", addr);
997 if (current_personality == 1) {
998 printstatsol(tcp, addr);
1002 else if (current_personality == 2) {
1003 printstat_sparc64(tcp, addr);
1007 #endif /* LINUXSPARC */
1009 if (umove(tcp, addr, &statbuf) < 0) {
1014 realprintstat(tcp, &statbuf);
1016 #endif /* !HAVE_LONG_LONG_OFF_T */
1018 #if !defined HAVE_STAT64 && defined LINUX && defined X86_64
1020 * Linux x86_64 has unified `struct stat' but its i386 biarch needs
1021 * `struct stat64'. Its <asm-i386/stat.h> definition expects 32-bit `long'.
1022 * <linux/include/asm-x86_64/ia32.h> is not in the public includes set.
1023 * __GNUC__ is needed for the required __attribute__ below.
1026 unsigned long long st_dev;
1027 unsigned char __pad0[4];
1028 unsigned int __st_ino;
1029 unsigned int st_mode;
1030 unsigned int st_nlink;
1031 unsigned int st_uid;
1032 unsigned int st_gid;
1033 unsigned long long st_rdev;
1034 unsigned char __pad3[4];
1036 unsigned int st_blksize;
1037 unsigned long long st_blocks;
1038 unsigned int st_atime;
1039 unsigned int st_atime_nsec;
1040 unsigned int st_mtime;
1041 unsigned int st_mtime_nsec;
1042 unsigned int st_ctime;
1043 unsigned int st_ctime_nsec;
1044 unsigned long long st_ino;
1045 } __attribute__((packed));
1046 # define HAVE_STAT64 1
1047 # define STAT64_SIZE 96
1052 printstat64(struct tcb *tcp, long addr)
1054 struct stat64 statbuf;
1057 (void) sizeof(char[sizeof statbuf == STAT64_SIZE ? 1 : -1]);
1064 if (syserror(tcp) || !verbose(tcp)) {
1065 tprintf("%#lx", addr);
1070 if (current_personality == 1) {
1071 printstatsol(tcp, addr);
1075 else if (current_personality == 2) {
1076 printstat_sparc64(tcp, addr);
1080 #endif /* LINUXSPARC */
1082 if (umove(tcp, addr, &statbuf) < 0) {
1088 #ifdef HAVE_LONG_LONG
1089 tprintf("{st_dev=makedev(%lu, %lu), st_ino=%llu, st_mode=%s, ",
1091 tprintf("{st_dev=makedev(%lu, %lu), st_ino=%lu, st_mode=%s, ",
1093 (unsigned long) major(statbuf.st_dev),
1094 (unsigned long) minor(statbuf.st_dev),
1095 #ifdef HAVE_LONG_LONG
1096 (unsigned long long) statbuf.st_ino,
1098 (unsigned long) statbuf.st_ino,
1100 sprintmode(statbuf.st_mode));
1101 tprintf("st_nlink=%lu, st_uid=%lu, st_gid=%lu, ",
1102 (unsigned long) statbuf.st_nlink,
1103 (unsigned long) statbuf.st_uid,
1104 (unsigned long) statbuf.st_gid);
1105 #ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
1106 tprintf("st_blksize=%lu, ",
1107 (unsigned long) statbuf.st_blksize);
1108 #endif /* HAVE_STRUCT_STAT_ST_BLKSIZE */
1109 #ifdef HAVE_STRUCT_STAT_ST_BLOCKS
1110 tprintf("st_blocks=%lu, ", (unsigned long) statbuf.st_blocks);
1111 #endif /* HAVE_STRUCT_STAT_ST_BLOCKS */
1114 tprintf("{st_mode=%s, ", sprintmode(statbuf.st_mode));
1115 switch (statbuf.st_mode & S_IFMT) {
1116 case S_IFCHR: case S_IFBLK:
1117 #ifdef HAVE_STRUCT_STAT_ST_RDEV
1118 tprintf("st_rdev=makedev(%lu, %lu), ",
1119 (unsigned long) major(statbuf.st_rdev),
1120 (unsigned long) minor(statbuf.st_rdev));
1121 #else /* !HAVE_STRUCT_STAT_ST_RDEV */
1122 tprintf("st_size=makedev(%lu, %lu), ",
1123 (unsigned long) major(statbuf.st_size),
1124 (unsigned long) minor(statbuf.st_size));
1125 #endif /* !HAVE_STRUCT_STAT_ST_RDEV */
1128 #ifdef HAVE_LONG_LONG
1129 tprintf("st_size=%llu, ", (unsigned long long) statbuf.st_size);
1131 tprintf("st_size=%lu, ", (unsigned long) statbuf.st_size);
1136 tprintf("st_atime=%s, ", sprinttime(statbuf.st_atime));
1137 tprintf("st_mtime=%s, ", sprinttime(statbuf.st_mtime));
1138 tprintf("st_ctime=%s", sprinttime(statbuf.st_ctime));
1139 #if HAVE_STRUCT_STAT_ST_FLAGS
1140 tprintf(", st_flags=");
1141 printflags(fileflags, statbuf.st_flags, "UF_???");
1143 #if HAVE_STRUCT_STAT_ST_ACLCNT
1144 tprintf(", st_aclcnt=%d", statbuf.st_aclcnt);
1146 #if HAVE_STRUCT_STAT_ST_LEVEL
1147 tprintf(", st_level=%ld", statbuf.st_level);
1149 #if HAVE_STRUCT_STAT_ST_FSTYPE
1150 tprintf(", st_fstype=%.*s",
1151 (int) sizeof statbuf.st_fstype, statbuf.st_fstype);
1153 #if HAVE_STRUCT_STAT_ST_GEN
1154 tprintf(", st_gen=%u", statbuf.st_gen);
1161 #endif /* HAVE_STAT64 */
1163 #if defined(LINUX) && defined(HAVE_STRUCT___OLD_KERNEL_STAT)
1165 convertoldstat(const struct __old_kernel_stat *oldbuf, struct stat *newbuf)
1167 newbuf->st_dev = oldbuf->st_dev;
1168 newbuf->st_ino = oldbuf->st_ino;
1169 newbuf->st_mode = oldbuf->st_mode;
1170 newbuf->st_nlink = oldbuf->st_nlink;
1171 newbuf->st_uid = oldbuf->st_uid;
1172 newbuf->st_gid = oldbuf->st_gid;
1173 newbuf->st_rdev = oldbuf->st_rdev;
1174 newbuf->st_size = oldbuf->st_size;
1175 newbuf->st_atime = oldbuf->st_atime;
1176 newbuf->st_mtime = oldbuf->st_mtime;
1177 newbuf->st_ctime = oldbuf->st_ctime;
1178 newbuf->st_blksize = 0; /* not supported in old_stat */
1179 newbuf->st_blocks = 0; /* not supported in old_stat */
1184 printoldstat(struct tcb *tcp, long addr)
1186 struct __old_kernel_stat statbuf;
1187 struct stat newstatbuf;
1193 if (syserror(tcp) || !verbose(tcp)) {
1194 tprintf("%#lx", addr);
1199 if (current_personality == 1) {
1200 printstatsol(tcp, addr);
1203 #endif /* LINUXSPARC */
1205 if (umove(tcp, addr, &statbuf) < 0) {
1210 convertoldstat(&statbuf, &newstatbuf);
1211 realprintstat(tcp, &newstatbuf);
1213 #endif /* LINUX && !IA64 && !HPPA && !X86_64 && !S390 && !S390X */
1215 #ifndef HAVE_LONG_LONG_OFF_T
1217 sys_stat(struct tcb *tcp)
1219 if (entering(tcp)) {
1220 printpath(tcp, tcp->u_arg[0]);
1223 printstat(tcp, tcp->u_arg[1]);
1230 sys_stat64(struct tcb *tcp)
1233 if (entering(tcp)) {
1234 printpath(tcp, tcp->u_arg[0]);
1237 printstat64(tcp, tcp->u_arg[1]);
1241 return printargs(tcp);
1246 static const struct xlat fstatatflags[] = {
1247 #ifndef AT_SYMLINK_NOFOLLOW
1248 # define AT_SYMLINK_NOFOLLOW 0x100
1250 { AT_SYMLINK_NOFOLLOW, "AT_SYMLINK_NOFOLLOW" },
1253 #define utimensatflags fstatatflags
1256 sys_newfstatat(struct tcb *tcp)
1258 if (entering(tcp)) {
1259 print_dirfd(tcp->u_arg[0]);
1260 printpath(tcp, tcp->u_arg[1]);
1263 #if defined HAVE_STAT64 && !(defined POWERPC && defined __powerpc64__)
1264 printstat64(tcp, tcp->u_arg[2]);
1266 printstat(tcp, tcp->u_arg[2]);
1269 printflags(fstatatflags, tcp->u_arg[3], "AT_???");
1275 #if defined(LINUX) && defined(HAVE_STRUCT___OLD_KERNEL_STAT)
1277 sys_oldstat(struct tcb *tcp)
1279 if (entering(tcp)) {
1280 printpath(tcp, tcp->u_arg[0]);
1283 printoldstat(tcp, tcp->u_arg[1]);
1287 #endif /* LINUX && HAVE_STRUCT___OLD_KERNEL_STAT */
1289 #ifndef HAVE_LONG_LONG_OFF_T
1291 sys_fstat(struct tcb *tcp)
1294 tprintf("%ld, ", tcp->u_arg[0]);
1296 printstat(tcp, tcp->u_arg[1]);
1303 sys_fstat64(struct tcb *tcp)
1307 tprintf("%ld, ", tcp->u_arg[0]);
1309 printstat64(tcp, tcp->u_arg[1]);
1313 return printargs(tcp);
1317 #if defined(LINUX) && defined(HAVE_STRUCT___OLD_KERNEL_STAT)
1319 sys_oldfstat(struct tcb *tcp)
1322 tprintf("%ld, ", tcp->u_arg[0]);
1324 printoldstat(tcp, tcp->u_arg[1]);
1328 #endif /* LINUX && HAVE_STRUCT___OLD_KERNEL_STAT */
1330 #ifndef HAVE_LONG_LONG_OFF_T
1332 sys_lstat(struct tcb *tcp)
1334 if (entering(tcp)) {
1335 printpath(tcp, tcp->u_arg[0]);
1338 printstat(tcp, tcp->u_arg[1]);
1345 sys_lstat64(struct tcb *tcp)
1348 if (entering(tcp)) {
1349 printpath(tcp, tcp->u_arg[0]);
1352 printstat64(tcp, tcp->u_arg[1]);
1356 return printargs(tcp);
1360 #if defined(LINUX) && defined(HAVE_STRUCT___OLD_KERNEL_STAT)
1362 sys_oldlstat(struct tcb *tcp)
1364 if (entering(tcp)) {
1365 printpath(tcp, tcp->u_arg[0]);
1368 printoldstat(tcp, tcp->u_arg[1]);
1372 #endif /* LINUX && HAVE_STRUCT___OLD_KERNEL_STAT */
1375 #if defined(SVR4) || defined(LINUXSPARC)
1378 sys_xstat(struct tcb *tcp)
1380 if (entering(tcp)) {
1381 tprintf("%ld, ", tcp->u_arg[0]);
1382 printpath(tcp, tcp->u_arg[1]);
1386 if (tcp->u_arg[0] == _STAT64_VER)
1387 printstat64 (tcp, tcp->u_arg[2]);
1390 printstat(tcp, tcp->u_arg[2]);
1396 sys_fxstat(struct tcb *tcp)
1399 tprintf("%ld, %ld, ", tcp->u_arg[0], 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_lxstat(struct tcb *tcp)
1414 if (entering(tcp)) {
1415 tprintf("%ld, ", tcp->u_arg[0]);
1416 printpath(tcp, tcp->u_arg[1]);
1420 if (tcp->u_arg[0] == _STAT64_VER)
1421 printstat64 (tcp, tcp->u_arg[2]);
1424 printstat(tcp, tcp->u_arg[2]);
1430 sys_xmknod(struct tcb *tcp)
1432 int mode = tcp->u_arg[2];
1434 if (entering(tcp)) {
1435 tprintf("%ld, ", tcp->u_arg[0]);
1436 printpath(tcp, tcp->u_arg[1]);
1437 tprintf(", %s", sprintmode(mode));
1438 switch (mode & S_IFMT) {
1439 case S_IFCHR: case S_IFBLK:
1441 tprintf(", makedev(%lu, %lu)",
1442 (unsigned long) ((tcp->u_arg[3] >> 18) & 0x3fff),
1443 (unsigned long) (tcp->u_arg[3] & 0x3ffff));
1445 tprintf(", makedev(%lu, %lu)",
1446 (unsigned long) major(tcp->u_arg[3]),
1447 (unsigned long) minor(tcp->u_arg[3]));
1457 #ifdef HAVE_SYS_ACL_H
1459 #include <sys/acl.h>
1461 static const struct xlat aclcmds[] = {
1463 { SETACL, "SETACL" },
1466 { GETACL, "GETACL" },
1469 { GETACLCNT, "GETACLCNT" },
1472 { ACL_GET, "ACL_GET" },
1475 { ACL_SET, "ACL_SET" },
1478 { ACL_CNT, "ACL_CNT" },
1484 sys_acl(struct tcb *tcp)
1486 if (entering(tcp)) {
1487 printpath(tcp, tcp->u_arg[0]);
1489 printxval(aclcmds, tcp->u_arg[1], "???ACL???");
1490 tprintf(", %ld", tcp->u_arg[2]);
1492 * FIXME - dump out the list of aclent_t's pointed to
1493 * by "tcp->u_arg[3]" if it's not NULL.
1496 tprintf(", %#lx", tcp->u_arg[3]);
1505 sys_facl(struct tcb *tcp)
1507 if (entering(tcp)) {
1508 tprintf("%ld, ", tcp->u_arg[0]);
1509 printxval(aclcmds, tcp->u_arg[1], "???ACL???");
1510 tprintf(", %ld", tcp->u_arg[2]);
1512 * FIXME - dump out the list of aclent_t's pointed to
1513 * by "tcp->u_arg[3]" if it's not NULL.
1516 tprintf(", %#lx", tcp->u_arg[3]);
1524 static const struct xlat aclipc[] = {
1526 { IPC_SHM, "IPC_SHM" },
1529 { IPC_SEM, "IPC_SEM" },
1532 { IPC_MSG, "IPC_MSG" },
1539 sys_aclipc(struct tcb *tcp)
1541 if (entering(tcp)) {
1542 printxval(aclipc, tcp->u_arg[0], "???IPC???");
1543 tprintf(", %#lx, ", tcp->u_arg[1]);
1544 printxval(aclcmds, tcp->u_arg[2], "???ACL???");
1545 tprintf(", %ld", tcp->u_arg[3]);
1547 * FIXME - dump out the list of aclent_t's pointed to
1548 * by "tcp->u_arg[4]" if it's not NULL.
1551 tprintf(", %#lx", tcp->u_arg[4]);
1558 #endif /* HAVE_SYS_ACL_H */
1560 #endif /* SVR4 || LINUXSPARC */
1564 static const struct xlat fsmagic[] = {
1565 { 0x73757245, "CODA_SUPER_MAGIC" },
1566 { 0x012ff7b7, "COH_SUPER_MAGIC" },
1567 { 0x1373, "DEVFS_SUPER_MAGIC" },
1568 { 0x1cd1, "DEVPTS_SUPER_MAGIC" },
1569 { 0x414A53, "EFS_SUPER_MAGIC" },
1570 { 0xef51, "EXT2_OLD_SUPER_MAGIC" },
1571 { 0xef53, "EXT2_SUPER_MAGIC" },
1572 { 0x137d, "EXT_SUPER_MAGIC" },
1573 { 0xf995e849, "HPFS_SUPER_MAGIC" },
1574 { 0x9660, "ISOFS_SUPER_MAGIC" },
1575 { 0x137f, "MINIX_SUPER_MAGIC" },
1576 { 0x138f, "MINIX_SUPER_MAGIC2" },
1577 { 0x2468, "MINIX2_SUPER_MAGIC" },
1578 { 0x2478, "MINIX2_SUPER_MAGIC2" },
1579 { 0x4d44, "MSDOS_SUPER_MAGIC" },
1580 { 0x564c, "NCP_SUPER_MAGIC" },
1581 { 0x6969, "NFS_SUPER_MAGIC" },
1582 { 0x9fa0, "PROC_SUPER_MAGIC" },
1583 { 0x002f, "QNX4_SUPER_MAGIC" },
1584 { 0x52654973, "REISERFS_SUPER_MAGIC" },
1585 { 0x02011994, "SHMFS_SUPER_MAGIC" },
1586 { 0x517b, "SMB_SUPER_MAGIC" },
1587 { 0x012ff7b6, "SYSV2_SUPER_MAGIC" },
1588 { 0x012ff7b5, "SYSV4_SUPER_MAGIC" },
1589 { 0x00011954, "UFS_MAGIC" },
1590 { 0x54190100, "UFS_CIGAM" },
1591 { 0x012ff7b4, "XENIX_SUPER_MAGIC" },
1592 { 0x012fd16d, "XIAFS_SUPER_MAGIC" },
1593 { 0x62656572, "SYSFS_MAGIC" },
1602 sprintfstype(int magic)
1604 static char buf[32];
1608 s = xlookup(fsmagic, magic);
1610 sprintf(buf, "\"%s\"", s);
1614 sprintf(buf, "%#x", magic);
1619 printstatfs(struct tcb *tcp, long addr)
1621 struct statfs statbuf;
1623 if (syserror(tcp) || !verbose(tcp)) {
1624 tprintf("%#lx", addr);
1627 if (umove(tcp, addr, &statbuf) < 0) {
1633 tprintf("{f_type=%s, f_fbsize=%u, f_blocks=%u, f_bfree=%u, ",
1634 sprintfstype(statbuf.f_type),
1635 statbuf.f_bsize, statbuf.f_blocks, statbuf.f_bfree);
1636 tprintf("f_bavail=%u, f_files=%u, f_ffree=%u, f_fsid={%d, %d}, f_namelen=%u",
1637 statbuf.f_bavail,statbuf.f_files, statbuf.f_ffree,
1638 statbuf.f_fsid.__val[0], statbuf.f_fsid.__val[1],
1641 tprintf("{f_type=%s, f_bsize=%lu, f_blocks=%lu, f_bfree=%lu, ",
1642 sprintfstype(statbuf.f_type),
1643 (unsigned long)statbuf.f_bsize,
1644 (unsigned long)statbuf.f_blocks,
1645 (unsigned long)statbuf.f_bfree);
1646 tprintf("f_bavail=%lu, f_files=%lu, f_ffree=%lu, f_fsid={%d, %d}",
1647 (unsigned long)statbuf.f_bavail,
1648 (unsigned long)statbuf.f_files,
1649 (unsigned long)statbuf.f_ffree,
1650 statbuf.f_fsid.__val[0], statbuf.f_fsid.__val[1]);
1652 tprintf(", f_namelen=%lu", (unsigned long)statbuf.f_namelen);
1655 #ifdef _STATFS_F_FRSIZE
1656 tprintf(", f_frsize=%lu", (unsigned long)statbuf.f_frsize);
1662 sys_statfs(struct tcb *tcp)
1664 if (entering(tcp)) {
1665 printpath(tcp, tcp->u_arg[0]);
1668 printstatfs(tcp, tcp->u_arg[1]);
1674 sys_fstatfs(struct tcb *tcp)
1676 if (entering(tcp)) {
1677 tprintf("%lu, ", tcp->u_arg[0]);
1679 printstatfs(tcp, tcp->u_arg[1]);
1686 printstatfs64(struct tcb *tcp, long addr)
1688 struct statfs64 statbuf;
1690 if (syserror(tcp) || !verbose(tcp)) {
1691 tprintf("%#lx", addr);
1694 if (umove(tcp, addr, &statbuf) < 0) {
1698 tprintf("{f_type=%s, f_bsize=%llu, f_blocks=%llu, f_bfree=%llu, ",
1699 sprintfstype(statbuf.f_type),
1700 (unsigned long long)statbuf.f_bsize,
1701 (unsigned long long)statbuf.f_blocks,
1702 (unsigned long long)statbuf.f_bfree);
1703 tprintf("f_bavail=%llu, f_files=%llu, f_ffree=%llu, f_fsid={%d, %d}",
1704 (unsigned long long)statbuf.f_bavail,
1705 (unsigned long long)statbuf.f_files,
1706 (unsigned long long)statbuf.f_ffree,
1707 statbuf.f_fsid.__val[0], statbuf.f_fsid.__val[1]);
1708 tprintf(", f_namelen=%lu", (unsigned long)statbuf.f_namelen);
1709 #ifdef _STATFS_F_FRSIZE
1710 tprintf(", f_frsize=%llu", (unsigned long long)statbuf.f_frsize);
1716 sys_statfs64(struct tcb *tcp)
1718 if (entering(tcp)) {
1719 printpath(tcp, tcp->u_arg[0]);
1720 tprintf(", %lu, ", tcp->u_arg[1]);
1722 if (tcp->u_arg[1] == sizeof (struct statfs64))
1723 printstatfs64(tcp, tcp->u_arg[2]);
1731 sys_fstatfs64(struct tcb *tcp)
1733 if (entering(tcp)) {
1734 tprintf("%lu, %lu, ", tcp->u_arg[0], tcp->u_arg[1]);
1736 if (tcp->u_arg[1] == sizeof (struct statfs64))
1737 printstatfs64(tcp, tcp->u_arg[2]);
1745 #if defined(LINUX) && defined(__alpha)
1748 osf_statfs(struct tcb *tcp)
1750 if (entering(tcp)) {
1751 printpath(tcp, tcp->u_arg[0]);
1754 printstatfs(tcp, tcp->u_arg[1]);
1755 tprintf(", %lu", tcp->u_arg[2]);
1761 osf_fstatfs(struct tcb *tcp)
1763 if (entering(tcp)) {
1764 tprintf("%lu, ", tcp->u_arg[0]);
1766 printstatfs(tcp, tcp->u_arg[1]);
1767 tprintf(", %lu", tcp->u_arg[2]);
1771 #endif /* LINUX && __alpha */
1777 sys_ustat(struct tcb *tcp)
1779 struct ustat statbuf;
1781 if (entering(tcp)) {
1782 tprintf("makedev(%lu, %lu), ",
1783 (long) major(tcp->u_arg[0]),
1784 (long) minor(tcp->u_arg[0]));
1787 if (syserror(tcp) || !verbose(tcp))
1788 tprintf("%#lx", tcp->u_arg[1]);
1789 else if (umove(tcp, tcp->u_arg[1], &statbuf) < 0)
1792 tprintf("{f_tfree=%lu, f_tinode=%lu, ",
1793 statbuf.f_tfree, statbuf.f_tinode);
1794 tprintf("f_fname=\"%.*s\", ",
1795 (int) sizeof(statbuf.f_fname),
1797 tprintf("f_fpack=\"%.*s\"}",
1798 (int) sizeof(statbuf.f_fpack),
1807 sys_pivotroot(struct tcb *tcp)
1809 if (entering(tcp)) {
1810 printpath(tcp, tcp->u_arg[0]);
1812 printpath(tcp, tcp->u_arg[1]);
1820 sys_chdir(struct tcb *tcp)
1822 if (entering(tcp)) {
1823 printpath(tcp, tcp->u_arg[0]);
1829 decode_mkdir(struct tcb *tcp, int offset)
1831 if (entering(tcp)) {
1832 printpath(tcp, tcp->u_arg[offset]);
1833 tprintf(", %#lo", tcp->u_arg[offset + 1]);
1839 sys_mkdir(struct tcb *tcp)
1841 return decode_mkdir(tcp, 0);
1846 sys_mkdirat(struct tcb *tcp)
1849 print_dirfd(tcp->u_arg[0]);
1850 return decode_mkdir(tcp, 1);
1855 sys_rmdir(struct tcb *tcp)
1857 if (entering(tcp)) {
1858 printpath(tcp, tcp->u_arg[0]);
1864 sys_fchdir(struct tcb *tcp)
1866 if (entering(tcp)) {
1867 tprintf("%ld", tcp->u_arg[0]);
1873 sys_chroot(struct tcb *tcp)
1875 if (entering(tcp)) {
1876 printpath(tcp, tcp->u_arg[0]);
1881 #if defined(SUNOS4) || defined(SVR4)
1883 sys_fchroot(struct tcb *tcp)
1885 if (entering(tcp)) {
1886 tprintf("%ld", tcp->u_arg[0]);
1890 #endif /* SUNOS4 || SVR4 */
1893 sys_link(struct tcb *tcp)
1895 if (entering(tcp)) {
1896 printpath(tcp, tcp->u_arg[0]);
1898 printpath(tcp, tcp->u_arg[1]);
1905 sys_linkat(struct tcb *tcp)
1907 if (entering(tcp)) {
1908 print_dirfd(tcp->u_arg[0]);
1909 printpath(tcp, tcp->u_arg[1]);
1911 print_dirfd(tcp->u_arg[2]);
1912 printpath(tcp, tcp->u_arg[3]);
1913 tprintf(", %ld", tcp->u_arg[4]);
1920 sys_unlink(struct tcb *tcp)
1922 if (entering(tcp)) {
1923 printpath(tcp, tcp->u_arg[0]);
1929 static const struct xlat unlinkatflags[] = {
1930 #ifndef AT_REMOVEDIR
1931 # define AT_REMOVEDIR 0x200
1933 { AT_REMOVEDIR, "AT_REMOVEDIR" },
1938 sys_unlinkat(struct tcb *tcp)
1940 if (entering(tcp)) {
1941 print_dirfd(tcp->u_arg[0]);
1942 printpath(tcp, tcp->u_arg[1]);
1944 printflags(unlinkatflags, tcp->u_arg[2], "AT_???");
1951 sys_symlink(struct tcb *tcp)
1953 if (entering(tcp)) {
1954 printpath(tcp, tcp->u_arg[0]);
1956 printpath(tcp, tcp->u_arg[1]);
1963 sys_symlinkat(struct tcb *tcp)
1965 if (entering(tcp)) {
1966 printpath(tcp, tcp->u_arg[0]);
1968 print_dirfd(tcp->u_arg[1]);
1969 printpath(tcp, tcp->u_arg[2]);
1976 decode_readlink(struct tcb *tcp, int offset)
1978 if (entering(tcp)) {
1979 printpath(tcp, tcp->u_arg[offset]);
1983 tprintf("%#lx", tcp->u_arg[offset + 1]);
1985 printpathn(tcp, tcp->u_arg[offset + 1], tcp->u_rval);
1986 tprintf(", %lu", tcp->u_arg[offset + 2]);
1992 sys_readlink(struct tcb *tcp)
1994 return decode_readlink(tcp, 0);
1999 sys_readlinkat(struct tcb *tcp)
2002 print_dirfd(tcp->u_arg[0]);
2003 return decode_readlink(tcp, 1);
2008 sys_rename(struct tcb *tcp)
2010 if (entering(tcp)) {
2011 printpath(tcp, tcp->u_arg[0]);
2013 printpath(tcp, tcp->u_arg[1]);
2020 sys_renameat(struct tcb *tcp)
2022 if (entering(tcp)) {
2023 print_dirfd(tcp->u_arg[0]);
2024 printpath(tcp, tcp->u_arg[1]);
2026 print_dirfd(tcp->u_arg[2]);
2027 printpath(tcp, tcp->u_arg[3]);
2034 sys_chown(struct tcb *tcp)
2036 if (entering(tcp)) {
2037 printpath(tcp, tcp->u_arg[0]);
2038 printuid(", ", tcp->u_arg[1]);
2039 printuid(", ", tcp->u_arg[2]);
2046 sys_fchownat(struct tcb *tcp)
2048 if (entering(tcp)) {
2049 print_dirfd(tcp->u_arg[0]);
2050 printpath(tcp, tcp->u_arg[1]);
2051 printuid(", ", tcp->u_arg[2]);
2052 printuid(", ", tcp->u_arg[3]);
2054 printflags(fstatatflags, tcp->u_arg[4], "AT_???");
2061 sys_fchown(struct tcb *tcp)
2063 if (entering(tcp)) {
2064 tprintf("%ld", tcp->u_arg[0]);
2065 printuid(", ", tcp->u_arg[1]);
2066 printuid(", ", tcp->u_arg[2]);
2072 decode_chmod(struct tcb *tcp, int offset)
2074 if (entering(tcp)) {
2075 printpath(tcp, tcp->u_arg[offset]);
2076 tprintf(", %#lo", tcp->u_arg[offset + 1]);
2082 sys_chmod(struct tcb *tcp)
2084 return decode_chmod(tcp, 0);
2089 sys_fchmodat(struct tcb *tcp)
2092 print_dirfd(tcp->u_arg[0]);
2093 return decode_chmod(tcp, 1);
2098 sys_fchmod(struct tcb *tcp)
2100 if (entering(tcp)) {
2101 tprintf("%ld, %#lo", tcp->u_arg[0], tcp->u_arg[1]);
2108 sys_osf_utimes(struct tcb *tcp)
2110 if (entering(tcp)) {
2111 printpath(tcp, tcp->u_arg[0]);
2113 printtv_bitness(tcp, tcp->u_arg[1], BITNESS_32, 0);
2120 decode_utimes(struct tcb *tcp, int offset, int special)
2122 if (entering(tcp)) {
2123 printpath(tcp, tcp->u_arg[offset]);
2125 if (tcp->u_arg[offset + 1] == 0)
2129 printtv_bitness(tcp, tcp->u_arg[offset + 1],
2130 BITNESS_CURRENT, special);
2132 printtv_bitness(tcp, tcp->u_arg[offset + 1]
2133 + sizeof (struct timeval),
2134 BITNESS_CURRENT, special);
2142 sys_utimes(struct tcb *tcp)
2144 return decode_utimes(tcp, 0, 0);
2149 sys_futimesat(struct tcb *tcp)
2152 print_dirfd(tcp->u_arg[0]);
2153 return decode_utimes(tcp, 1, 0);
2157 sys_utimensat(struct tcb *tcp)
2159 if (entering(tcp)) {
2160 print_dirfd(tcp->u_arg[0]);
2161 decode_utimes(tcp, 1, 1);
2163 printflags(utimensatflags, tcp->u_arg[3], "AT_???");
2170 sys_utime(struct tcb *tcp)
2177 if (entering(tcp)) {
2178 printpath(tcp, tcp->u_arg[0]);
2182 else if (!verbose(tcp))
2183 tprintf("%#lx", tcp->u_arg[1]);
2184 else if (umoven(tcp, tcp->u_arg[1],
2185 2 * personality_wordsize[current_personality],
2188 else if (personality_wordsize[current_personality]
2189 == sizeof u.utl[0]) {
2190 tprintf("[%s,", sprinttime(u.utl[0]));
2191 tprintf(" %s]", sprinttime(u.utl[1]));
2193 else if (personality_wordsize[current_personality]
2194 == sizeof u.uti[0]) {
2195 tprintf("[%s,", sprinttime(u.uti[0]));
2196 tprintf(" %s]", sprinttime(u.uti[1]));
2205 decode_mknod(struct tcb *tcp, int offset)
2207 int mode = tcp->u_arg[offset + 1];
2209 if (entering(tcp)) {
2210 printpath(tcp, tcp->u_arg[offset]);
2211 tprintf(", %s", sprintmode(mode));
2212 switch (mode & S_IFMT) {
2213 case S_IFCHR: case S_IFBLK:
2215 if (current_personality == 1)
2216 tprintf(", makedev(%lu, %lu)",
2217 (unsigned long) ((tcp->u_arg[offset + 2] >> 18) & 0x3fff),
2218 (unsigned long) (tcp->u_arg[offset + 2] & 0x3ffff));
2221 tprintf(", makedev(%lu, %lu)",
2222 (unsigned long) major(tcp->u_arg[offset + 2]),
2223 (unsigned long) minor(tcp->u_arg[offset + 2]));
2233 sys_mknod(struct tcb *tcp)
2235 return decode_mknod(tcp, 0);
2240 sys_mknodat(struct tcb *tcp)
2243 print_dirfd(tcp->u_arg[0]);
2244 return decode_mknod(tcp, 1);
2250 sys_mkfifo(struct tcb *tcp)
2252 if (entering(tcp)) {
2253 printpath(tcp, tcp->u_arg[0]);
2254 tprintf(", %#lo", tcp->u_arg[1]);
2258 #endif /* FREEBSD */
2261 sys_fsync(struct tcb *tcp)
2263 if (entering(tcp)) {
2264 tprintf("%ld", tcp->u_arg[0]);
2272 printdir(struct tcb *tcp, long addr)
2276 if (!verbose(tcp)) {
2277 tprintf("%#lx", addr);
2280 if (umove(tcp, addr, &d) < 0) {
2284 tprintf("{d_ino=%ld, ", (unsigned long) d.d_ino);
2286 printpathn(tcp, (long) ((struct dirent *) addr)->d_name, d.d_reclen);
2291 sys_readdir(struct tcb *tcp)
2293 if (entering(tcp)) {
2294 tprintf("%lu, ", tcp->u_arg[0]);
2296 if (syserror(tcp) || tcp->u_rval == 0 || !verbose(tcp))
2297 tprintf("%#lx", tcp->u_arg[1]);
2299 printdir(tcp, tcp->u_arg[1]);
2300 /* Not much point in printing this out, it is always 1. */
2301 if (tcp->u_arg[2] != 1)
2302 tprintf(", %lu", tcp->u_arg[2]);
2309 #if defined FREEBSD || defined LINUX
2310 static const struct xlat direnttypes[] = {
2311 { DT_UNKNOWN, "DT_UNKNOWN" },
2312 { DT_FIFO, "DT_FIFO" },
2313 { DT_CHR, "DT_CHR" },
2314 { DT_DIR, "DT_DIR" },
2315 { DT_BLK, "DT_BLK" },
2316 { DT_REG, "DT_REG" },
2317 { DT_LNK, "DT_LNK" },
2318 { DT_SOCK, "DT_SOCK" },
2319 { DT_WHT, "DT_WHT" },
2326 sys_getdents(struct tcb *tcp)
2328 int i, len, dents = 0;
2331 if (entering(tcp)) {
2332 tprintf("%lu, ", tcp->u_arg[0]);
2335 if (syserror(tcp) || !verbose(tcp)) {
2336 tprintf("%#lx, %lu", tcp->u_arg[1], tcp->u_arg[2]);
2340 if ((buf = malloc(len)) == NULL) {
2341 tprintf("%#lx, %lu", tcp->u_arg[1], tcp->u_arg[2]);
2342 fprintf(stderr, "out of memory\n");
2345 if (umoven(tcp, tcp->u_arg[1], len, buf) < 0) {
2346 tprintf("%#lx, %lu", tcp->u_arg[1], tcp->u_arg[2]);
2352 for (i = 0; i < len;) {
2353 struct kernel_dirent *d = (struct kernel_dirent *) &buf[i];
2356 tprintf("%s{d_ino=%lu, d_off=%lu, ",
2357 i ? " " : "", d->d_ino, d->d_off);
2358 tprintf("d_reclen=%u, d_name=\"%s\"}",
2359 d->d_reclen, d->d_name);
2364 tprintf("%s{d_ino=%lu, d_off=%lu, ",
2366 (unsigned long) d->d_ino,
2367 (unsigned long) d->d_off);
2368 tprintf("d_reclen=%u, d_name=\"%s\"}",
2369 d->d_reclen, d->d_name);
2374 tprintf("%s{d_off=%lu, d_fileno=%lu, d_reclen=%u, ",
2375 i ? " " : "", d->d_off, d->d_fileno,
2377 tprintf("d_namlen=%u, d_name=\"%.*s\"}",
2378 d->d_namlen, d->d_namlen, d->d_name);
2383 tprintf("%s{d_fileno=%u, d_reclen=%u, d_type=",
2384 i ? " " : "", d->d_fileno, d->d_reclen);
2385 printxval(direnttypes, d->d_type, "DT_???");
2386 tprintf(", d_namlen=%u, d_name=\"%.*s\"}",
2387 d->d_namlen, d->d_namlen, d->d_name);
2389 #endif /* FREEBSD */
2391 tprintf("/* d_reclen == 0, problem here */");
2400 tprintf("/* %u entries */", dents);
2401 tprintf(", %lu", tcp->u_arg[2]);
2407 #if _LFS64_LARGEFILE
2409 sys_getdents64(struct tcb *tcp)
2411 int i, len, dents = 0;
2414 if (entering(tcp)) {
2415 tprintf("%lu, ", tcp->u_arg[0]);
2418 if (syserror(tcp) || !verbose(tcp)) {
2419 tprintf("%#lx, %lu", tcp->u_arg[1], tcp->u_arg[2]);
2423 if ((buf = malloc(len)) == NULL) {
2424 tprintf("%#lx, %lu", tcp->u_arg[1], tcp->u_arg[2]);
2425 fprintf(stderr, "out of memory\n");
2428 if (umoven(tcp, tcp->u_arg[1], len, buf) < 0) {
2429 tprintf("%#lx, %lu", tcp->u_arg[1], tcp->u_arg[2]);
2435 for (i = 0; i < len;) {
2436 struct dirent64 *d = (struct dirent64 *) &buf[i];
2437 #if defined(LINUX) || defined(SVR4)
2439 tprintf("%s{d_ino=%" PRIu64 ", d_off=%" PRId64 ", ",
2445 printxval(direnttypes, d->d_type, "DT_???");
2448 tprintf("d_reclen=%u, d_name=\"%s\"}",
2449 d->d_reclen, d->d_name);
2451 #endif /* LINUX || SVR4 */
2454 tprintf("%s{d_off=%lu, d_fileno=%lu, d_reclen=%u, ",
2455 i ? " " : "", d->d_off, d->d_fileno,
2457 tprintf("d_namlen=%u, d_name=\"%.*s\"}",
2458 d->d_namlen, d->d_namlen, d->d_name);
2462 tprintf("/* d_reclen == 0, problem here */");
2471 tprintf("/* %u entries */", dents);
2472 tprintf(", %lu", tcp->u_arg[2]);
2480 sys_getdirentries(struct tcb *tcp)
2482 int i, len, dents = 0;
2486 if (entering(tcp)) {
2487 tprintf("%lu, ", tcp->u_arg[0]);
2490 if (syserror(tcp) || !verbose(tcp)) {
2491 tprintf("%#lx, %lu, %#lx", tcp->u_arg[1], tcp->u_arg[2], tcp->u_arg[3]);
2495 if ((buf = malloc(len)) == NULL) {
2496 tprintf("%#lx, %lu, %#lx", tcp->u_arg[1], tcp->u_arg[2], tcp->u_arg[3]);
2497 fprintf(stderr, "out of memory\n");
2500 if (umoven(tcp, tcp->u_arg[1], len, buf) < 0) {
2501 tprintf("%#lx, %lu, %#lx", tcp->u_arg[1], tcp->u_arg[2], tcp->u_arg[3]);
2507 for (i = 0; i < len;) {
2508 struct kernel_dirent *d = (struct kernel_dirent *) &buf[i];
2510 tprintf("%s{d_fileno=%u, d_reclen=%u, d_type=",
2511 i ? " " : "", d->d_fileno, d->d_reclen);
2512 printxval(direnttypes, d->d_type, "DT_???");
2513 tprintf(", d_namlen=%u, d_name=\"%.*s\"}",
2514 d->d_namlen, d->d_namlen, d->d_name);
2517 tprintf("/* d_reclen == 0, problem here */");
2526 tprintf("/* %u entries */", dents);
2528 tprintf(", %lu", tcp->u_arg[2]);
2529 if (umove(tcp, tcp->u_arg[3], &basep) < 0)
2530 tprintf(", %#lx", tcp->u_arg[3]);
2532 tprintf(", [%lu]", basep);
2539 sys_getcwd(struct tcb *tcp)
2543 tprintf("%#lx", tcp->u_arg[0]);
2545 printpathn(tcp, tcp->u_arg[0], tcp->u_rval - 1);
2546 tprintf(", %lu", tcp->u_arg[1]);
2554 sys___getcwd(struct tcb *tcp)
2558 tprintf("%#lx", tcp->u_arg[0]);
2560 printpathn(tcp, tcp->u_arg[0], tcp->u_arg[1]);
2561 tprintf(", %lu", tcp->u_arg[1]);
2567 #ifdef HAVE_SYS_ASYNCH_H
2570 sys_aioread(struct tcb *tcp)
2572 struct aio_result_t res;
2574 if (entering(tcp)) {
2575 tprintf("%lu, ", tcp->u_arg[0]);
2578 tprintf("%#lx", tcp->u_arg[1]);
2580 printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
2581 tprintf(", %lu, %lu, ", tcp->u_arg[2], tcp->u_arg[3]);
2582 printxval(whence, tcp->u_arg[4], "L_???");
2583 if (syserror(tcp) || tcp->u_arg[5] == 0
2584 || umove(tcp, tcp->u_arg[5], &res) < 0)
2585 tprintf(", %#lx", tcp->u_arg[5]);
2587 tprintf(", {aio_return %d aio_errno %d}",
2588 res.aio_return, res.aio_errno);
2594 sys_aiowrite(struct tcb *tcp)
2596 struct aio_result_t res;
2598 if (entering(tcp)) {
2599 tprintf("%lu, ", tcp->u_arg[0]);
2600 printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
2601 tprintf(", %lu, %lu, ", tcp->u_arg[2], tcp->u_arg[3]);
2602 printxval(whence, tcp->u_arg[4], "L_???");
2605 if (tcp->u_arg[5] == 0)
2607 else if (syserror(tcp)
2608 || umove(tcp, tcp->u_arg[5], &res) < 0)
2609 tprintf(", %#lx", tcp->u_arg[5]);
2611 tprintf(", {aio_return %d aio_errno %d}",
2612 res.aio_return, res.aio_errno);
2618 sys_aiowait(struct tcb *tcp)
2621 printtv(tcp, tcp->u_arg[0]);
2626 sys_aiocancel(struct tcb *tcp)
2628 struct aio_result_t res;
2631 if (tcp->u_arg[0] == 0)
2633 else if (syserror(tcp)
2634 || umove(tcp, tcp->u_arg[0], &res) < 0)
2635 tprintf("%#lx", tcp->u_arg[0]);
2637 tprintf("{aio_return %d aio_errno %d}",
2638 res.aio_return, res.aio_errno);
2643 #endif /* HAVE_SYS_ASYNCH_H */
2645 static const struct xlat xattrflags[] = {
2647 { XATTR_CREATE, "XATTR_CREATE" },
2648 { XATTR_REPLACE, "XATTR_REPLACE" },
2654 print_xattr_val(struct tcb *tcp, int failed,
2656 unsigned long insize,
2660 unsigned long capacity = 4 * size + 1;
2661 unsigned char *buf = (capacity < size) ? NULL : malloc(capacity);
2662 if (buf == NULL || /* probably a bogus size argument */
2663 umoven(tcp, arg, size, (char *) &buf[3 * size]) < 0) {
2667 unsigned char *out = buf;
2668 unsigned char *in = &buf[3 * size];
2670 for (i = 0; i < size; ++i) {
2674 #define tohex(n) "0123456789abcdef"[n]
2677 *out++ = tohex(in[i] / 16);
2678 *out++ = tohex(in[i] % 16);
2681 /* Don't print terminating NUL if there is one. */
2682 if (i > 0 && in[i - 1] == '\0')
2685 tprintf(", \"%s\", %ld", buf, insize);
2690 tprintf(", 0x%lx, %ld", arg, insize);
2694 sys_setxattr(struct tcb *tcp)
2696 if (entering(tcp)) {
2697 printpath(tcp, tcp->u_arg[0]);
2699 printstr(tcp, tcp->u_arg[1], -1);
2700 print_xattr_val(tcp, 0, tcp->u_arg[2], tcp->u_arg[3], tcp->u_arg[3]);
2702 printflags(xattrflags, tcp->u_arg[4], "XATTR_???");
2708 sys_fsetxattr(struct tcb *tcp)
2710 if (entering(tcp)) {
2711 tprintf("%ld, ", tcp->u_arg[0]);
2712 printstr(tcp, tcp->u_arg[1], -1);
2713 print_xattr_val(tcp, 0, tcp->u_arg[2], tcp->u_arg[3], tcp->u_arg[3]);
2715 printflags(xattrflags, tcp->u_arg[4], "XATTR_???");
2721 sys_getxattr(struct tcb *tcp)
2723 if (entering(tcp)) {
2724 printpath(tcp, tcp->u_arg[0]);
2726 printstr(tcp, tcp->u_arg[1], -1);
2728 print_xattr_val(tcp, syserror(tcp), tcp->u_arg[2], tcp->u_arg[3],
2735 sys_fgetxattr(struct tcb *tcp)
2737 if (entering(tcp)) {
2738 tprintf("%ld, ", tcp->u_arg[0]);
2739 printstr(tcp, tcp->u_arg[1], -1);
2741 print_xattr_val(tcp, syserror(tcp), tcp->u_arg[2], tcp->u_arg[3],
2748 sys_listxattr(struct tcb *tcp)
2750 if (entering(tcp)) {
2751 printpath(tcp, tcp->u_arg[0]);
2753 /* XXX Print value in format */
2754 tprintf(", %p, %lu", (void *) tcp->u_arg[1], tcp->u_arg[2]);
2760 sys_flistxattr(struct tcb *tcp)
2762 if (entering(tcp)) {
2763 tprintf("%ld", tcp->u_arg[0]);
2765 /* XXX Print value in format */
2766 tprintf(", %p, %lu", (void *) tcp->u_arg[1], tcp->u_arg[2]);
2772 sys_removexattr(struct tcb *tcp)
2774 if (entering(tcp)) {
2775 printpath(tcp, tcp->u_arg[0]);
2777 printstr(tcp, tcp->u_arg[1], -1);
2783 sys_fremovexattr(struct tcb *tcp)
2785 if (entering(tcp)) {
2786 tprintf("%ld, ", tcp->u_arg[0]);
2787 printstr(tcp, tcp->u_arg[1], -1);
2793 static const struct xlat advise[] = {
2794 { POSIX_FADV_NORMAL, "POSIX_FADV_NORMAL" },
2795 { POSIX_FADV_RANDOM, "POSIX_FADV_RANDOM" },
2796 { POSIX_FADV_SEQUENTIAL, "POSIX_FADV_SEQUENTIAL" },
2797 { POSIX_FADV_WILLNEED, "POSIX_FADV_WILLNEED" },
2798 { POSIX_FADV_DONTNEED, "POSIX_FADV_DONTNEED" },
2799 { POSIX_FADV_NOREUSE, "POSIX_FADV_NOREUSE" },
2806 sys_fadvise64(struct tcb *tcp)
2808 if (entering(tcp)) {
2809 tprintf("%ld, %lld, %ld, ",
2811 # if defined IA64 || defined X86_64 || defined ALPHA
2812 (long long int) tcp->u_arg[1], tcp->u_arg[2]);
2813 printxval(advise, tcp->u_arg[3], "POSIX_FADV_???");
2815 LONG_LONG(tcp->u_arg[1], tcp->u_arg[2]), tcp->u_arg[3]);
2816 printxval(advise, tcp->u_arg[4], "POSIX_FADV_???");
2825 sys_fadvise64_64(struct tcb *tcp)
2827 if (entering(tcp)) {
2828 tprintf("%ld, %lld, %lld, ",
2830 #if defined LINUX_MIPSN32
2831 tcp->ext_arg[1], tcp->ext_arg[2]);
2832 printxval(advise, tcp->u_arg[3], "POSIX_FADV_???");
2833 #elif defined IA64 || defined X86_64 || defined ALPHA || defined LINUX_MIPSN64
2834 (long long int) tcp->u_arg[1], (long long int) tcp->u_arg[2]);
2835 printxval(advise, tcp->u_arg[3], "POSIX_FADV_???");
2837 LONG_LONG(tcp->u_arg[2], tcp->u_arg[3]),
2838 LONG_LONG(tcp->u_arg[4], tcp->u_arg[5]));
2839 printxval(advise, tcp->u_arg[1], "POSIX_FADV_???");
2841 LONG_LONG(tcp->u_arg[1], tcp->u_arg[2]),
2842 LONG_LONG(tcp->u_arg[3], tcp->u_arg[4]));
2843 printxval(advise, tcp->u_arg[5], "POSIX_FADV_???");
2850 static const struct xlat inotify_modes[] = {
2851 { 0x00000001, "IN_ACCESS" },
2852 { 0x00000002, "IN_MODIFY" },
2853 { 0x00000004, "IN_ATTRIB" },
2854 { 0x00000008, "IN_CLOSE_WRITE" },
2855 { 0x00000010, "IN_CLOSE_NOWRITE" },
2856 { 0x00000020, "IN_OPEN" },
2857 { 0x00000040, "IN_MOVED_FROM" },
2858 { 0x00000080, "IN_MOVED_TO" },
2859 { 0x00000100, "IN_CREATE" },
2860 { 0x00000200, "IN_DELETE" },
2861 { 0x00000400, "IN_DELETE_SELF" },
2862 { 0x00000800, "IN_MOVE_SELF" },
2863 { 0x00002000, "IN_UNMOUNT" },
2864 { 0x00004000, "IN_Q_OVERFLOW" },
2865 { 0x00008000, "IN_IGNORED" },
2866 { 0x01000000, "IN_ONLYDIR" },
2867 { 0x02000000, "IN_DONT_FOLLOW" },
2868 { 0x20000000, "IN_MASK_ADD" },
2869 { 0x40000000, "IN_ISDIR" },
2870 { 0x80000000, "IN_ONESHOT" }
2874 sys_inotify_add_watch(struct tcb *tcp)
2876 if (entering(tcp)) {
2877 tprintf("%ld, ", tcp->u_arg[0]);
2878 printpath(tcp, tcp->u_arg[1]);
2880 printflags(inotify_modes, tcp->u_arg[2], "IN_???");
2886 sys_inotify_rm_watch(struct tcb *tcp)
2888 if (entering(tcp)) {
2889 tprintf("%ld, %ld", tcp->u_arg[0], tcp->u_arg[1]);
2895 sys_fallocate(struct tcb *tcp)
2897 if (entering(tcp)) {
2898 tprintf("%ld, ", tcp->u_arg[0]); /* fd */
2899 tprintf("%#lo, ", tcp->u_arg[1]); /* mode */
2900 tprintf("%llu, ", LONG_LONG(tcp->u_arg[2],
2901 tcp->u_arg[3])); /* offset */
2902 tprintf("%llu", LONG_LONG(tcp->u_arg[4],
2903 tcp->u_arg[5])); /* len */