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 defined LINUX && defined X86_64
1083 if (current_personality == 0) {
1084 printstat(tcp, addr);
1089 if (umove(tcp, addr, &statbuf) < 0) {
1095 #ifdef HAVE_LONG_LONG
1096 tprintf("{st_dev=makedev(%lu, %lu), st_ino=%llu, st_mode=%s, ",
1098 tprintf("{st_dev=makedev(%lu, %lu), st_ino=%lu, st_mode=%s, ",
1100 (unsigned long) major(statbuf.st_dev),
1101 (unsigned long) minor(statbuf.st_dev),
1102 #ifdef HAVE_LONG_LONG
1103 (unsigned long long) statbuf.st_ino,
1105 (unsigned long) statbuf.st_ino,
1107 sprintmode(statbuf.st_mode));
1108 tprintf("st_nlink=%lu, st_uid=%lu, st_gid=%lu, ",
1109 (unsigned long) statbuf.st_nlink,
1110 (unsigned long) statbuf.st_uid,
1111 (unsigned long) statbuf.st_gid);
1112 #ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
1113 tprintf("st_blksize=%lu, ",
1114 (unsigned long) statbuf.st_blksize);
1115 #endif /* HAVE_STRUCT_STAT_ST_BLKSIZE */
1116 #ifdef HAVE_STRUCT_STAT_ST_BLOCKS
1117 tprintf("st_blocks=%lu, ", (unsigned long) statbuf.st_blocks);
1118 #endif /* HAVE_STRUCT_STAT_ST_BLOCKS */
1121 tprintf("{st_mode=%s, ", sprintmode(statbuf.st_mode));
1122 switch (statbuf.st_mode & S_IFMT) {
1123 case S_IFCHR: case S_IFBLK:
1124 #ifdef HAVE_STRUCT_STAT_ST_RDEV
1125 tprintf("st_rdev=makedev(%lu, %lu), ",
1126 (unsigned long) major(statbuf.st_rdev),
1127 (unsigned long) minor(statbuf.st_rdev));
1128 #else /* !HAVE_STRUCT_STAT_ST_RDEV */
1129 tprintf("st_size=makedev(%lu, %lu), ",
1130 (unsigned long) major(statbuf.st_size),
1131 (unsigned long) minor(statbuf.st_size));
1132 #endif /* !HAVE_STRUCT_STAT_ST_RDEV */
1135 #ifdef HAVE_LONG_LONG
1136 tprintf("st_size=%llu, ", (unsigned long long) statbuf.st_size);
1138 tprintf("st_size=%lu, ", (unsigned long) statbuf.st_size);
1143 tprintf("st_atime=%s, ", sprinttime(statbuf.st_atime));
1144 tprintf("st_mtime=%s, ", sprinttime(statbuf.st_mtime));
1145 tprintf("st_ctime=%s", sprinttime(statbuf.st_ctime));
1146 #if HAVE_STRUCT_STAT_ST_FLAGS
1147 tprintf(", st_flags=");
1148 printflags(fileflags, statbuf.st_flags, "UF_???");
1150 #if HAVE_STRUCT_STAT_ST_ACLCNT
1151 tprintf(", st_aclcnt=%d", statbuf.st_aclcnt);
1153 #if HAVE_STRUCT_STAT_ST_LEVEL
1154 tprintf(", st_level=%ld", statbuf.st_level);
1156 #if HAVE_STRUCT_STAT_ST_FSTYPE
1157 tprintf(", st_fstype=%.*s",
1158 (int) sizeof statbuf.st_fstype, statbuf.st_fstype);
1160 #if HAVE_STRUCT_STAT_ST_GEN
1161 tprintf(", st_gen=%u", statbuf.st_gen);
1168 #endif /* HAVE_STAT64 */
1170 #if defined(LINUX) && defined(HAVE_STRUCT___OLD_KERNEL_STAT)
1172 convertoldstat(const struct __old_kernel_stat *oldbuf, struct stat *newbuf)
1174 newbuf->st_dev = oldbuf->st_dev;
1175 newbuf->st_ino = oldbuf->st_ino;
1176 newbuf->st_mode = oldbuf->st_mode;
1177 newbuf->st_nlink = oldbuf->st_nlink;
1178 newbuf->st_uid = oldbuf->st_uid;
1179 newbuf->st_gid = oldbuf->st_gid;
1180 newbuf->st_rdev = oldbuf->st_rdev;
1181 newbuf->st_size = oldbuf->st_size;
1182 newbuf->st_atime = oldbuf->st_atime;
1183 newbuf->st_mtime = oldbuf->st_mtime;
1184 newbuf->st_ctime = oldbuf->st_ctime;
1185 newbuf->st_blksize = 0; /* not supported in old_stat */
1186 newbuf->st_blocks = 0; /* not supported in old_stat */
1191 printoldstat(struct tcb *tcp, long addr)
1193 struct __old_kernel_stat statbuf;
1194 struct stat newstatbuf;
1200 if (syserror(tcp) || !verbose(tcp)) {
1201 tprintf("%#lx", addr);
1206 if (current_personality == 1) {
1207 printstatsol(tcp, addr);
1210 #endif /* LINUXSPARC */
1212 if (umove(tcp, addr, &statbuf) < 0) {
1217 convertoldstat(&statbuf, &newstatbuf);
1218 realprintstat(tcp, &newstatbuf);
1220 #endif /* LINUX && !IA64 && !HPPA && !X86_64 && !S390 && !S390X */
1222 #ifndef HAVE_LONG_LONG_OFF_T
1224 sys_stat(struct tcb *tcp)
1226 if (entering(tcp)) {
1227 printpath(tcp, tcp->u_arg[0]);
1230 printstat(tcp, tcp->u_arg[1]);
1237 sys_stat64(struct tcb *tcp)
1240 if (entering(tcp)) {
1241 printpath(tcp, tcp->u_arg[0]);
1244 printstat64(tcp, tcp->u_arg[1]);
1248 return printargs(tcp);
1253 static const struct xlat fstatatflags[] = {
1254 #ifndef AT_SYMLINK_NOFOLLOW
1255 # define AT_SYMLINK_NOFOLLOW 0x100
1257 { AT_SYMLINK_NOFOLLOW, "AT_SYMLINK_NOFOLLOW" },
1260 #define utimensatflags fstatatflags
1263 sys_newfstatat(struct tcb *tcp)
1265 if (entering(tcp)) {
1266 print_dirfd(tcp->u_arg[0]);
1267 printpath(tcp, tcp->u_arg[1]);
1270 #if defined HAVE_STAT64 && !(defined POWERPC && defined __powerpc64__)
1271 printstat64(tcp, tcp->u_arg[2]);
1273 printstat(tcp, tcp->u_arg[2]);
1276 printflags(fstatatflags, tcp->u_arg[3], "AT_???");
1282 #if defined(LINUX) && defined(HAVE_STRUCT___OLD_KERNEL_STAT)
1284 sys_oldstat(struct tcb *tcp)
1286 if (entering(tcp)) {
1287 printpath(tcp, tcp->u_arg[0]);
1290 printoldstat(tcp, tcp->u_arg[1]);
1294 #endif /* LINUX && HAVE_STRUCT___OLD_KERNEL_STAT */
1296 #ifndef HAVE_LONG_LONG_OFF_T
1298 sys_fstat(struct tcb *tcp)
1301 tprintf("%ld, ", tcp->u_arg[0]);
1303 printstat(tcp, tcp->u_arg[1]);
1310 sys_fstat64(struct tcb *tcp)
1314 tprintf("%ld, ", tcp->u_arg[0]);
1316 printstat64(tcp, tcp->u_arg[1]);
1320 return printargs(tcp);
1324 #if defined(LINUX) && defined(HAVE_STRUCT___OLD_KERNEL_STAT)
1326 sys_oldfstat(struct tcb *tcp)
1329 tprintf("%ld, ", tcp->u_arg[0]);
1331 printoldstat(tcp, tcp->u_arg[1]);
1335 #endif /* LINUX && HAVE_STRUCT___OLD_KERNEL_STAT */
1337 #ifndef HAVE_LONG_LONG_OFF_T
1339 sys_lstat(struct tcb *tcp)
1341 if (entering(tcp)) {
1342 printpath(tcp, tcp->u_arg[0]);
1345 printstat(tcp, tcp->u_arg[1]);
1352 sys_lstat64(struct tcb *tcp)
1355 if (entering(tcp)) {
1356 printpath(tcp, tcp->u_arg[0]);
1359 printstat64(tcp, tcp->u_arg[1]);
1363 return printargs(tcp);
1367 #if defined(LINUX) && defined(HAVE_STRUCT___OLD_KERNEL_STAT)
1369 sys_oldlstat(struct tcb *tcp)
1371 if (entering(tcp)) {
1372 printpath(tcp, tcp->u_arg[0]);
1375 printoldstat(tcp, tcp->u_arg[1]);
1379 #endif /* LINUX && HAVE_STRUCT___OLD_KERNEL_STAT */
1382 #if defined(SVR4) || defined(LINUXSPARC)
1385 sys_xstat(struct tcb *tcp)
1387 if (entering(tcp)) {
1388 tprintf("%ld, ", tcp->u_arg[0]);
1389 printpath(tcp, tcp->u_arg[1]);
1393 if (tcp->u_arg[0] == _STAT64_VER)
1394 printstat64 (tcp, tcp->u_arg[2]);
1397 printstat(tcp, tcp->u_arg[2]);
1403 sys_fxstat(struct tcb *tcp)
1406 tprintf("%ld, %ld, ", tcp->u_arg[0], tcp->u_arg[1]);
1409 if (tcp->u_arg[0] == _STAT64_VER)
1410 printstat64 (tcp, tcp->u_arg[2]);
1413 printstat(tcp, tcp->u_arg[2]);
1419 sys_lxstat(struct tcb *tcp)
1421 if (entering(tcp)) {
1422 tprintf("%ld, ", tcp->u_arg[0]);
1423 printpath(tcp, tcp->u_arg[1]);
1427 if (tcp->u_arg[0] == _STAT64_VER)
1428 printstat64 (tcp, tcp->u_arg[2]);
1431 printstat(tcp, tcp->u_arg[2]);
1437 sys_xmknod(struct tcb *tcp)
1439 int mode = tcp->u_arg[2];
1441 if (entering(tcp)) {
1442 tprintf("%ld, ", tcp->u_arg[0]);
1443 printpath(tcp, tcp->u_arg[1]);
1444 tprintf(", %s", sprintmode(mode));
1445 switch (mode & S_IFMT) {
1446 case S_IFCHR: case S_IFBLK:
1448 tprintf(", makedev(%lu, %lu)",
1449 (unsigned long) ((tcp->u_arg[3] >> 18) & 0x3fff),
1450 (unsigned long) (tcp->u_arg[3] & 0x3ffff));
1452 tprintf(", makedev(%lu, %lu)",
1453 (unsigned long) major(tcp->u_arg[3]),
1454 (unsigned long) minor(tcp->u_arg[3]));
1464 #ifdef HAVE_SYS_ACL_H
1466 #include <sys/acl.h>
1468 static const struct xlat aclcmds[] = {
1470 { SETACL, "SETACL" },
1473 { GETACL, "GETACL" },
1476 { GETACLCNT, "GETACLCNT" },
1479 { ACL_GET, "ACL_GET" },
1482 { ACL_SET, "ACL_SET" },
1485 { ACL_CNT, "ACL_CNT" },
1491 sys_acl(struct tcb *tcp)
1493 if (entering(tcp)) {
1494 printpath(tcp, tcp->u_arg[0]);
1496 printxval(aclcmds, tcp->u_arg[1], "???ACL???");
1497 tprintf(", %ld", tcp->u_arg[2]);
1499 * FIXME - dump out the list of aclent_t's pointed to
1500 * by "tcp->u_arg[3]" if it's not NULL.
1503 tprintf(", %#lx", tcp->u_arg[3]);
1512 sys_facl(struct tcb *tcp)
1514 if (entering(tcp)) {
1515 tprintf("%ld, ", tcp->u_arg[0]);
1516 printxval(aclcmds, tcp->u_arg[1], "???ACL???");
1517 tprintf(", %ld", tcp->u_arg[2]);
1519 * FIXME - dump out the list of aclent_t's pointed to
1520 * by "tcp->u_arg[3]" if it's not NULL.
1523 tprintf(", %#lx", tcp->u_arg[3]);
1531 static const struct xlat aclipc[] = {
1533 { IPC_SHM, "IPC_SHM" },
1536 { IPC_SEM, "IPC_SEM" },
1539 { 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 /* SVR4 || LINUXSPARC */
1571 static const struct xlat fsmagic[] = {
1572 { 0x73757245, "CODA_SUPER_MAGIC" },
1573 { 0x012ff7b7, "COH_SUPER_MAGIC" },
1574 { 0x1373, "DEVFS_SUPER_MAGIC" },
1575 { 0x1cd1, "DEVPTS_SUPER_MAGIC" },
1576 { 0x414A53, "EFS_SUPER_MAGIC" },
1577 { 0xef51, "EXT2_OLD_SUPER_MAGIC" },
1578 { 0xef53, "EXT2_SUPER_MAGIC" },
1579 { 0x137d, "EXT_SUPER_MAGIC" },
1580 { 0xf995e849, "HPFS_SUPER_MAGIC" },
1581 { 0x9660, "ISOFS_SUPER_MAGIC" },
1582 { 0x137f, "MINIX_SUPER_MAGIC" },
1583 { 0x138f, "MINIX_SUPER_MAGIC2" },
1584 { 0x2468, "MINIX2_SUPER_MAGIC" },
1585 { 0x2478, "MINIX2_SUPER_MAGIC2" },
1586 { 0x4d44, "MSDOS_SUPER_MAGIC" },
1587 { 0x564c, "NCP_SUPER_MAGIC" },
1588 { 0x6969, "NFS_SUPER_MAGIC" },
1589 { 0x9fa0, "PROC_SUPER_MAGIC" },
1590 { 0x002f, "QNX4_SUPER_MAGIC" },
1591 { 0x52654973, "REISERFS_SUPER_MAGIC" },
1592 { 0x02011994, "SHMFS_SUPER_MAGIC" },
1593 { 0x517b, "SMB_SUPER_MAGIC" },
1594 { 0x012ff7b6, "SYSV2_SUPER_MAGIC" },
1595 { 0x012ff7b5, "SYSV4_SUPER_MAGIC" },
1596 { 0x00011954, "UFS_MAGIC" },
1597 { 0x54190100, "UFS_CIGAM" },
1598 { 0x012ff7b4, "XENIX_SUPER_MAGIC" },
1599 { 0x012fd16d, "XIAFS_SUPER_MAGIC" },
1600 { 0x62656572, "SYSFS_MAGIC" },
1609 sprintfstype(int magic)
1611 static char buf[32];
1615 s = xlookup(fsmagic, magic);
1617 sprintf(buf, "\"%s\"", s);
1621 sprintf(buf, "%#x", magic);
1626 printstatfs(struct tcb *tcp, long addr)
1628 struct statfs statbuf;
1630 if (syserror(tcp) || !verbose(tcp)) {
1631 tprintf("%#lx", addr);
1634 if (umove(tcp, addr, &statbuf) < 0) {
1640 tprintf("{f_type=%s, f_fbsize=%u, f_blocks=%u, f_bfree=%u, ",
1641 sprintfstype(statbuf.f_type),
1642 statbuf.f_bsize, statbuf.f_blocks, statbuf.f_bfree);
1643 tprintf("f_bavail=%u, f_files=%u, f_ffree=%u, f_fsid={%d, %d}, f_namelen=%u",
1644 statbuf.f_bavail,statbuf.f_files, statbuf.f_ffree,
1645 statbuf.f_fsid.__val[0], statbuf.f_fsid.__val[1],
1648 tprintf("{f_type=%s, f_bsize=%lu, f_blocks=%lu, f_bfree=%lu, ",
1649 sprintfstype(statbuf.f_type),
1650 (unsigned long)statbuf.f_bsize,
1651 (unsigned long)statbuf.f_blocks,
1652 (unsigned long)statbuf.f_bfree);
1653 tprintf("f_bavail=%lu, f_files=%lu, f_ffree=%lu, f_fsid={%d, %d}",
1654 (unsigned long)statbuf.f_bavail,
1655 (unsigned long)statbuf.f_files,
1656 (unsigned long)statbuf.f_ffree,
1657 statbuf.f_fsid.__val[0], statbuf.f_fsid.__val[1]);
1659 tprintf(", f_namelen=%lu", (unsigned long)statbuf.f_namelen);
1662 #ifdef _STATFS_F_FRSIZE
1663 tprintf(", f_frsize=%lu", (unsigned long)statbuf.f_frsize);
1669 sys_statfs(struct tcb *tcp)
1671 if (entering(tcp)) {
1672 printpath(tcp, tcp->u_arg[0]);
1675 printstatfs(tcp, tcp->u_arg[1]);
1681 sys_fstatfs(struct tcb *tcp)
1683 if (entering(tcp)) {
1684 tprintf("%lu, ", tcp->u_arg[0]);
1686 printstatfs(tcp, tcp->u_arg[1]);
1693 printstatfs64(struct tcb *tcp, long addr)
1695 struct statfs64 statbuf;
1697 if (syserror(tcp) || !verbose(tcp)) {
1698 tprintf("%#lx", addr);
1701 if (umove(tcp, addr, &statbuf) < 0) {
1705 tprintf("{f_type=%s, f_bsize=%llu, f_blocks=%llu, f_bfree=%llu, ",
1706 sprintfstype(statbuf.f_type),
1707 (unsigned long long)statbuf.f_bsize,
1708 (unsigned long long)statbuf.f_blocks,
1709 (unsigned long long)statbuf.f_bfree);
1710 tprintf("f_bavail=%llu, f_files=%llu, f_ffree=%llu, f_fsid={%d, %d}",
1711 (unsigned long long)statbuf.f_bavail,
1712 (unsigned long long)statbuf.f_files,
1713 (unsigned long long)statbuf.f_ffree,
1714 statbuf.f_fsid.__val[0], statbuf.f_fsid.__val[1]);
1715 tprintf(", f_namelen=%lu", (unsigned long)statbuf.f_namelen);
1716 #ifdef _STATFS_F_FRSIZE
1717 tprintf(", f_frsize=%llu", (unsigned long long)statbuf.f_frsize);
1723 sys_statfs64(struct tcb *tcp)
1725 if (entering(tcp)) {
1726 printpath(tcp, tcp->u_arg[0]);
1727 tprintf(", %lu, ", tcp->u_arg[1]);
1729 if (tcp->u_arg[1] == sizeof (struct statfs64))
1730 printstatfs64(tcp, tcp->u_arg[2]);
1738 sys_fstatfs64(struct tcb *tcp)
1740 if (entering(tcp)) {
1741 tprintf("%lu, %lu, ", tcp->u_arg[0], tcp->u_arg[1]);
1743 if (tcp->u_arg[1] == sizeof (struct statfs64))
1744 printstatfs64(tcp, tcp->u_arg[2]);
1752 #if defined(LINUX) && defined(__alpha)
1755 osf_statfs(struct tcb *tcp)
1757 if (entering(tcp)) {
1758 printpath(tcp, tcp->u_arg[0]);
1761 printstatfs(tcp, tcp->u_arg[1]);
1762 tprintf(", %lu", tcp->u_arg[2]);
1768 osf_fstatfs(struct tcb *tcp)
1770 if (entering(tcp)) {
1771 tprintf("%lu, ", tcp->u_arg[0]);
1773 printstatfs(tcp, tcp->u_arg[1]);
1774 tprintf(", %lu", tcp->u_arg[2]);
1778 #endif /* LINUX && __alpha */
1784 sys_ustat(struct tcb *tcp)
1786 struct ustat statbuf;
1788 if (entering(tcp)) {
1789 tprintf("makedev(%lu, %lu), ",
1790 (long) major(tcp->u_arg[0]),
1791 (long) minor(tcp->u_arg[0]));
1794 if (syserror(tcp) || !verbose(tcp))
1795 tprintf("%#lx", tcp->u_arg[1]);
1796 else if (umove(tcp, tcp->u_arg[1], &statbuf) < 0)
1799 tprintf("{f_tfree=%lu, f_tinode=%lu, ",
1800 statbuf.f_tfree, statbuf.f_tinode);
1801 tprintf("f_fname=\"%.*s\", ",
1802 (int) sizeof(statbuf.f_fname),
1804 tprintf("f_fpack=\"%.*s\"}",
1805 (int) sizeof(statbuf.f_fpack),
1814 sys_pivotroot(struct tcb *tcp)
1816 if (entering(tcp)) {
1817 printpath(tcp, tcp->u_arg[0]);
1819 printpath(tcp, tcp->u_arg[1]);
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);
1853 sys_mkdirat(struct tcb *tcp)
1856 print_dirfd(tcp->u_arg[0]);
1857 return decode_mkdir(tcp, 1);
1862 sys_rmdir(struct tcb *tcp)
1864 if (entering(tcp)) {
1865 printpath(tcp, tcp->u_arg[0]);
1871 sys_fchdir(struct tcb *tcp)
1873 if (entering(tcp)) {
1874 tprintf("%ld", tcp->u_arg[0]);
1880 sys_chroot(struct tcb *tcp)
1882 if (entering(tcp)) {
1883 printpath(tcp, tcp->u_arg[0]);
1888 #if defined(SUNOS4) || defined(SVR4)
1890 sys_fchroot(struct tcb *tcp)
1892 if (entering(tcp)) {
1893 tprintf("%ld", tcp->u_arg[0]);
1897 #endif /* SUNOS4 || SVR4 */
1900 sys_link(struct tcb *tcp)
1902 if (entering(tcp)) {
1903 printpath(tcp, tcp->u_arg[0]);
1905 printpath(tcp, tcp->u_arg[1]);
1912 sys_linkat(struct tcb *tcp)
1914 if (entering(tcp)) {
1915 print_dirfd(tcp->u_arg[0]);
1916 printpath(tcp, tcp->u_arg[1]);
1918 print_dirfd(tcp->u_arg[2]);
1919 printpath(tcp, tcp->u_arg[3]);
1920 tprintf(", %ld", tcp->u_arg[4]);
1927 sys_unlink(struct tcb *tcp)
1929 if (entering(tcp)) {
1930 printpath(tcp, tcp->u_arg[0]);
1936 static const struct xlat unlinkatflags[] = {
1937 #ifndef AT_REMOVEDIR
1938 # define AT_REMOVEDIR 0x200
1940 { AT_REMOVEDIR, "AT_REMOVEDIR" },
1945 sys_unlinkat(struct tcb *tcp)
1947 if (entering(tcp)) {
1948 print_dirfd(tcp->u_arg[0]);
1949 printpath(tcp, tcp->u_arg[1]);
1951 printflags(unlinkatflags, tcp->u_arg[2], "AT_???");
1958 sys_symlink(struct tcb *tcp)
1960 if (entering(tcp)) {
1961 printpath(tcp, tcp->u_arg[0]);
1963 printpath(tcp, tcp->u_arg[1]);
1970 sys_symlinkat(struct tcb *tcp)
1972 if (entering(tcp)) {
1973 printpath(tcp, tcp->u_arg[0]);
1975 print_dirfd(tcp->u_arg[1]);
1976 printpath(tcp, tcp->u_arg[2]);
1983 decode_readlink(struct tcb *tcp, int offset)
1985 if (entering(tcp)) {
1986 printpath(tcp, tcp->u_arg[offset]);
1990 tprintf("%#lx", tcp->u_arg[offset + 1]);
1992 printpathn(tcp, tcp->u_arg[offset + 1], tcp->u_rval);
1993 tprintf(", %lu", tcp->u_arg[offset + 2]);
1999 sys_readlink(struct tcb *tcp)
2001 return decode_readlink(tcp, 0);
2006 sys_readlinkat(struct tcb *tcp)
2009 print_dirfd(tcp->u_arg[0]);
2010 return decode_readlink(tcp, 1);
2015 sys_rename(struct tcb *tcp)
2017 if (entering(tcp)) {
2018 printpath(tcp, tcp->u_arg[0]);
2020 printpath(tcp, tcp->u_arg[1]);
2027 sys_renameat(struct tcb *tcp)
2029 if (entering(tcp)) {
2030 print_dirfd(tcp->u_arg[0]);
2031 printpath(tcp, tcp->u_arg[1]);
2033 print_dirfd(tcp->u_arg[2]);
2034 printpath(tcp, tcp->u_arg[3]);
2041 sys_chown(struct tcb *tcp)
2043 if (entering(tcp)) {
2044 printpath(tcp, tcp->u_arg[0]);
2045 printuid(", ", tcp->u_arg[1]);
2046 printuid(", ", tcp->u_arg[2]);
2053 sys_fchownat(struct tcb *tcp)
2055 if (entering(tcp)) {
2056 print_dirfd(tcp->u_arg[0]);
2057 printpath(tcp, tcp->u_arg[1]);
2058 printuid(", ", tcp->u_arg[2]);
2059 printuid(", ", tcp->u_arg[3]);
2061 printflags(fstatatflags, tcp->u_arg[4], "AT_???");
2068 sys_fchown(struct tcb *tcp)
2070 if (entering(tcp)) {
2071 tprintf("%ld", tcp->u_arg[0]);
2072 printuid(", ", tcp->u_arg[1]);
2073 printuid(", ", tcp->u_arg[2]);
2079 decode_chmod(struct tcb *tcp, int offset)
2081 if (entering(tcp)) {
2082 printpath(tcp, tcp->u_arg[offset]);
2083 tprintf(", %#lo", tcp->u_arg[offset + 1]);
2089 sys_chmod(struct tcb *tcp)
2091 return decode_chmod(tcp, 0);
2096 sys_fchmodat(struct tcb *tcp)
2099 print_dirfd(tcp->u_arg[0]);
2100 return decode_chmod(tcp, 1);
2105 sys_fchmod(struct tcb *tcp)
2107 if (entering(tcp)) {
2108 tprintf("%ld, %#lo", tcp->u_arg[0], tcp->u_arg[1]);
2115 sys_osf_utimes(struct tcb *tcp)
2117 if (entering(tcp)) {
2118 printpath(tcp, tcp->u_arg[0]);
2120 printtv_bitness(tcp, tcp->u_arg[1], BITNESS_32, 0);
2127 decode_utimes(struct tcb *tcp, int offset, int special)
2129 if (entering(tcp)) {
2130 printpath(tcp, tcp->u_arg[offset]);
2132 if (tcp->u_arg[offset + 1] == 0)
2136 printtv_bitness(tcp, tcp->u_arg[offset + 1],
2137 BITNESS_CURRENT, special);
2139 printtv_bitness(tcp, tcp->u_arg[offset + 1]
2140 + sizeof (struct timeval),
2141 BITNESS_CURRENT, special);
2149 sys_utimes(struct tcb *tcp)
2151 return decode_utimes(tcp, 0, 0);
2156 sys_futimesat(struct tcb *tcp)
2159 print_dirfd(tcp->u_arg[0]);
2160 return decode_utimes(tcp, 1, 0);
2164 sys_utimensat(struct tcb *tcp)
2166 if (entering(tcp)) {
2167 print_dirfd(tcp->u_arg[0]);
2168 decode_utimes(tcp, 1, 1);
2170 printflags(utimensatflags, tcp->u_arg[3], "AT_???");
2177 sys_utime(struct tcb *tcp)
2184 if (entering(tcp)) {
2185 printpath(tcp, tcp->u_arg[0]);
2189 else if (!verbose(tcp))
2190 tprintf("%#lx", tcp->u_arg[1]);
2191 else if (umoven(tcp, tcp->u_arg[1],
2192 2 * personality_wordsize[current_personality],
2195 else if (personality_wordsize[current_personality]
2196 == sizeof u.utl[0]) {
2197 tprintf("[%s,", sprinttime(u.utl[0]));
2198 tprintf(" %s]", sprinttime(u.utl[1]));
2200 else if (personality_wordsize[current_personality]
2201 == sizeof u.uti[0]) {
2202 tprintf("[%s,", sprinttime(u.uti[0]));
2203 tprintf(" %s]", sprinttime(u.uti[1]));
2212 decode_mknod(struct tcb *tcp, int offset)
2214 int mode = tcp->u_arg[offset + 1];
2216 if (entering(tcp)) {
2217 printpath(tcp, tcp->u_arg[offset]);
2218 tprintf(", %s", sprintmode(mode));
2219 switch (mode & S_IFMT) {
2220 case S_IFCHR: case S_IFBLK:
2222 if (current_personality == 1)
2223 tprintf(", makedev(%lu, %lu)",
2224 (unsigned long) ((tcp->u_arg[offset + 2] >> 18) & 0x3fff),
2225 (unsigned long) (tcp->u_arg[offset + 2] & 0x3ffff));
2228 tprintf(", makedev(%lu, %lu)",
2229 (unsigned long) major(tcp->u_arg[offset + 2]),
2230 (unsigned long) minor(tcp->u_arg[offset + 2]));
2240 sys_mknod(struct tcb *tcp)
2242 return decode_mknod(tcp, 0);
2247 sys_mknodat(struct tcb *tcp)
2250 print_dirfd(tcp->u_arg[0]);
2251 return decode_mknod(tcp, 1);
2257 sys_mkfifo(struct tcb *tcp)
2259 if (entering(tcp)) {
2260 printpath(tcp, tcp->u_arg[0]);
2261 tprintf(", %#lo", tcp->u_arg[1]);
2265 #endif /* FREEBSD */
2268 sys_fsync(struct tcb *tcp)
2270 if (entering(tcp)) {
2271 tprintf("%ld", tcp->u_arg[0]);
2279 printdir(struct tcb *tcp, long addr)
2283 if (!verbose(tcp)) {
2284 tprintf("%#lx", addr);
2287 if (umove(tcp, addr, &d) < 0) {
2291 tprintf("{d_ino=%ld, ", (unsigned long) d.d_ino);
2293 printpathn(tcp, (long) ((struct dirent *) addr)->d_name, d.d_reclen);
2298 sys_readdir(struct tcb *tcp)
2300 if (entering(tcp)) {
2301 tprintf("%lu, ", tcp->u_arg[0]);
2303 if (syserror(tcp) || tcp->u_rval == 0 || !verbose(tcp))
2304 tprintf("%#lx", tcp->u_arg[1]);
2306 printdir(tcp, tcp->u_arg[1]);
2307 /* Not much point in printing this out, it is always 1. */
2308 if (tcp->u_arg[2] != 1)
2309 tprintf(", %lu", tcp->u_arg[2]);
2316 #if defined FREEBSD || defined LINUX
2317 static const struct xlat direnttypes[] = {
2318 { DT_UNKNOWN, "DT_UNKNOWN" },
2319 { DT_FIFO, "DT_FIFO" },
2320 { DT_CHR, "DT_CHR" },
2321 { DT_DIR, "DT_DIR" },
2322 { DT_BLK, "DT_BLK" },
2323 { DT_REG, "DT_REG" },
2324 { DT_LNK, "DT_LNK" },
2325 { DT_SOCK, "DT_SOCK" },
2326 { DT_WHT, "DT_WHT" },
2333 sys_getdents(struct tcb *tcp)
2335 int i, len, dents = 0;
2338 if (entering(tcp)) {
2339 tprintf("%lu, ", tcp->u_arg[0]);
2342 if (syserror(tcp) || !verbose(tcp)) {
2343 tprintf("%#lx, %lu", tcp->u_arg[1], tcp->u_arg[2]);
2347 buf = len ? malloc(len) : NULL;
2349 tprintf("%#lx, %lu", tcp->u_arg[1], tcp->u_arg[2]);
2350 fprintf(stderr, "out of memory\n");
2353 if (umoven(tcp, tcp->u_arg[1], len, buf) < 0) {
2354 tprintf("%#lx, %lu", tcp->u_arg[1], tcp->u_arg[2]);
2360 for (i = 0; i < len;) {
2361 struct kernel_dirent *d = (struct kernel_dirent *) &buf[i];
2364 tprintf("%s{d_ino=%lu, d_off=%lu, ",
2365 i ? " " : "", d->d_ino, d->d_off);
2366 tprintf("d_reclen=%u, d_name=\"%s\"}",
2367 d->d_reclen, d->d_name);
2372 tprintf("%s{d_ino=%lu, d_off=%lu, ",
2374 (unsigned long) d->d_ino,
2375 (unsigned long) d->d_off);
2376 tprintf("d_reclen=%u, d_name=\"%s\"}",
2377 d->d_reclen, d->d_name);
2382 tprintf("%s{d_off=%lu, d_fileno=%lu, d_reclen=%u, ",
2383 i ? " " : "", d->d_off, d->d_fileno,
2385 tprintf("d_namlen=%u, d_name=\"%.*s\"}",
2386 d->d_namlen, d->d_namlen, d->d_name);
2391 tprintf("%s{d_fileno=%u, d_reclen=%u, d_type=",
2392 i ? " " : "", d->d_fileno, d->d_reclen);
2393 printxval(direnttypes, d->d_type, "DT_???");
2394 tprintf(", d_namlen=%u, d_name=\"%.*s\"}",
2395 d->d_namlen, d->d_namlen, d->d_name);
2397 #endif /* FREEBSD */
2399 tprintf("/* d_reclen == 0, problem here */");
2408 tprintf("/* %u entries */", dents);
2409 tprintf(", %lu", tcp->u_arg[2]);
2415 #if _LFS64_LARGEFILE
2417 sys_getdents64(struct tcb *tcp)
2419 int i, len, dents = 0;
2422 if (entering(tcp)) {
2423 tprintf("%lu, ", tcp->u_arg[0]);
2426 if (syserror(tcp) || !verbose(tcp)) {
2427 tprintf("%#lx, %lu", tcp->u_arg[1], tcp->u_arg[2]);
2431 buf = len ? malloc(len) : NULL;
2433 tprintf("%#lx, %lu", tcp->u_arg[1], tcp->u_arg[2]);
2434 fprintf(stderr, "out of memory\n");
2437 if (umoven(tcp, tcp->u_arg[1], len, buf) < 0) {
2438 tprintf("%#lx, %lu", tcp->u_arg[1], tcp->u_arg[2]);
2444 for (i = 0; i < len;) {
2445 struct dirent64 *d = (struct dirent64 *) &buf[i];
2446 #if defined(LINUX) || defined(SVR4)
2448 tprintf("%s{d_ino=%" PRIu64 ", d_off=%" PRId64 ", ",
2454 printxval(direnttypes, d->d_type, "DT_???");
2457 tprintf("d_reclen=%u, d_name=\"%s\"}",
2458 d->d_reclen, d->d_name);
2460 #endif /* LINUX || SVR4 */
2463 tprintf("%s{d_off=%lu, d_fileno=%lu, d_reclen=%u, ",
2464 i ? " " : "", d->d_off, d->d_fileno,
2466 tprintf("d_namlen=%u, d_name=\"%.*s\"}",
2467 d->d_namlen, d->d_namlen, d->d_name);
2471 tprintf("/* d_reclen == 0, problem here */");
2480 tprintf("/* %u entries */", dents);
2481 tprintf(", %lu", tcp->u_arg[2]);
2489 sys_getdirentries(struct tcb *tcp)
2491 int i, len, dents = 0;
2495 if (entering(tcp)) {
2496 tprintf("%lu, ", tcp->u_arg[0]);
2499 if (syserror(tcp) || !verbose(tcp)) {
2500 tprintf("%#lx, %lu, %#lx", tcp->u_arg[1], tcp->u_arg[2], tcp->u_arg[3]);
2504 if ((buf = malloc(len)) == NULL) {
2505 tprintf("%#lx, %lu, %#lx", tcp->u_arg[1], tcp->u_arg[2], tcp->u_arg[3]);
2506 fprintf(stderr, "out of memory\n");
2509 if (umoven(tcp, tcp->u_arg[1], len, buf) < 0) {
2510 tprintf("%#lx, %lu, %#lx", tcp->u_arg[1], tcp->u_arg[2], tcp->u_arg[3]);
2516 for (i = 0; i < len;) {
2517 struct kernel_dirent *d = (struct kernel_dirent *) &buf[i];
2519 tprintf("%s{d_fileno=%u, d_reclen=%u, d_type=",
2520 i ? " " : "", d->d_fileno, d->d_reclen);
2521 printxval(direnttypes, d->d_type, "DT_???");
2522 tprintf(", d_namlen=%u, d_name=\"%.*s\"}",
2523 d->d_namlen, d->d_namlen, d->d_name);
2526 tprintf("/* d_reclen == 0, problem here */");
2535 tprintf("/* %u entries */", dents);
2537 tprintf(", %lu", tcp->u_arg[2]);
2538 if (umove(tcp, tcp->u_arg[3], &basep) < 0)
2539 tprintf(", %#lx", tcp->u_arg[3]);
2541 tprintf(", [%lu]", basep);
2548 sys_getcwd(struct tcb *tcp)
2552 tprintf("%#lx", tcp->u_arg[0]);
2554 printpathn(tcp, tcp->u_arg[0], tcp->u_rval - 1);
2555 tprintf(", %lu", tcp->u_arg[1]);
2563 sys___getcwd(struct tcb *tcp)
2567 tprintf("%#lx", tcp->u_arg[0]);
2569 printpathn(tcp, tcp->u_arg[0], tcp->u_arg[1]);
2570 tprintf(", %lu", tcp->u_arg[1]);
2576 #ifdef HAVE_SYS_ASYNCH_H
2579 sys_aioread(struct tcb *tcp)
2581 struct aio_result_t res;
2583 if (entering(tcp)) {
2584 tprintf("%lu, ", tcp->u_arg[0]);
2587 tprintf("%#lx", tcp->u_arg[1]);
2589 printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
2590 tprintf(", %lu, %lu, ", tcp->u_arg[2], tcp->u_arg[3]);
2591 printxval(whence, tcp->u_arg[4], "L_???");
2592 if (syserror(tcp) || tcp->u_arg[5] == 0
2593 || umove(tcp, tcp->u_arg[5], &res) < 0)
2594 tprintf(", %#lx", tcp->u_arg[5]);
2596 tprintf(", {aio_return %d aio_errno %d}",
2597 res.aio_return, res.aio_errno);
2603 sys_aiowrite(struct tcb *tcp)
2605 struct aio_result_t res;
2607 if (entering(tcp)) {
2608 tprintf("%lu, ", tcp->u_arg[0]);
2609 printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
2610 tprintf(", %lu, %lu, ", tcp->u_arg[2], tcp->u_arg[3]);
2611 printxval(whence, tcp->u_arg[4], "L_???");
2614 if (tcp->u_arg[5] == 0)
2616 else if (syserror(tcp)
2617 || umove(tcp, tcp->u_arg[5], &res) < 0)
2618 tprintf(", %#lx", tcp->u_arg[5]);
2620 tprintf(", {aio_return %d aio_errno %d}",
2621 res.aio_return, res.aio_errno);
2627 sys_aiowait(struct tcb *tcp)
2630 printtv(tcp, tcp->u_arg[0]);
2635 sys_aiocancel(struct tcb *tcp)
2637 struct aio_result_t res;
2640 if (tcp->u_arg[0] == 0)
2642 else if (syserror(tcp)
2643 || umove(tcp, tcp->u_arg[0], &res) < 0)
2644 tprintf("%#lx", tcp->u_arg[0]);
2646 tprintf("{aio_return %d aio_errno %d}",
2647 res.aio_return, res.aio_errno);
2652 #endif /* HAVE_SYS_ASYNCH_H */
2654 static const struct xlat xattrflags[] = {
2656 { XATTR_CREATE, "XATTR_CREATE" },
2657 { XATTR_REPLACE, "XATTR_REPLACE" },
2663 print_xattr_val(struct tcb *tcp, int failed,
2665 unsigned long insize,
2669 unsigned long capacity = 4 * size + 1;
2670 unsigned char *buf = (capacity < size) ? NULL : malloc(capacity);
2671 if (buf == NULL || /* probably a bogus size argument */
2672 umoven(tcp, arg, size, (char *) &buf[3 * size]) < 0) {
2676 unsigned char *out = buf;
2677 unsigned char *in = &buf[3 * size];
2679 for (i = 0; i < size; ++i) {
2683 #define tohex(n) "0123456789abcdef"[n]
2686 *out++ = tohex(in[i] / 16);
2687 *out++ = tohex(in[i] % 16);
2690 /* Don't print terminating NUL if there is one. */
2691 if (i > 0 && in[i - 1] == '\0')
2694 tprintf(", \"%s\", %ld", buf, insize);
2699 tprintf(", 0x%lx, %ld", arg, insize);
2703 sys_setxattr(struct tcb *tcp)
2705 if (entering(tcp)) {
2706 printpath(tcp, tcp->u_arg[0]);
2708 printstr(tcp, tcp->u_arg[1], -1);
2709 print_xattr_val(tcp, 0, tcp->u_arg[2], tcp->u_arg[3], tcp->u_arg[3]);
2711 printflags(xattrflags, tcp->u_arg[4], "XATTR_???");
2717 sys_fsetxattr(struct tcb *tcp)
2719 if (entering(tcp)) {
2720 tprintf("%ld, ", tcp->u_arg[0]);
2721 printstr(tcp, tcp->u_arg[1], -1);
2722 print_xattr_val(tcp, 0, tcp->u_arg[2], tcp->u_arg[3], tcp->u_arg[3]);
2724 printflags(xattrflags, tcp->u_arg[4], "XATTR_???");
2730 sys_getxattr(struct tcb *tcp)
2732 if (entering(tcp)) {
2733 printpath(tcp, tcp->u_arg[0]);
2735 printstr(tcp, tcp->u_arg[1], -1);
2737 print_xattr_val(tcp, syserror(tcp), tcp->u_arg[2], tcp->u_arg[3],
2744 sys_fgetxattr(struct tcb *tcp)
2746 if (entering(tcp)) {
2747 tprintf("%ld, ", tcp->u_arg[0]);
2748 printstr(tcp, tcp->u_arg[1], -1);
2750 print_xattr_val(tcp, syserror(tcp), tcp->u_arg[2], tcp->u_arg[3],
2757 sys_listxattr(struct tcb *tcp)
2759 if (entering(tcp)) {
2760 printpath(tcp, tcp->u_arg[0]);
2762 /* XXX Print value in format */
2763 tprintf(", %p, %lu", (void *) tcp->u_arg[1], tcp->u_arg[2]);
2769 sys_flistxattr(struct tcb *tcp)
2771 if (entering(tcp)) {
2772 tprintf("%ld", tcp->u_arg[0]);
2774 /* XXX Print value in format */
2775 tprintf(", %p, %lu", (void *) tcp->u_arg[1], tcp->u_arg[2]);
2781 sys_removexattr(struct tcb *tcp)
2783 if (entering(tcp)) {
2784 printpath(tcp, tcp->u_arg[0]);
2786 printstr(tcp, tcp->u_arg[1], -1);
2792 sys_fremovexattr(struct tcb *tcp)
2794 if (entering(tcp)) {
2795 tprintf("%ld, ", tcp->u_arg[0]);
2796 printstr(tcp, tcp->u_arg[1], -1);
2802 static const struct xlat advise[] = {
2803 { POSIX_FADV_NORMAL, "POSIX_FADV_NORMAL" },
2804 { POSIX_FADV_RANDOM, "POSIX_FADV_RANDOM" },
2805 { POSIX_FADV_SEQUENTIAL, "POSIX_FADV_SEQUENTIAL" },
2806 { POSIX_FADV_WILLNEED, "POSIX_FADV_WILLNEED" },
2807 { POSIX_FADV_DONTNEED, "POSIX_FADV_DONTNEED" },
2808 { POSIX_FADV_NOREUSE, "POSIX_FADV_NOREUSE" },
2815 sys_fadvise64(struct tcb *tcp)
2817 if (entering(tcp)) {
2818 tprintf("%ld, %lld, %ld, ",
2820 # if defined IA64 || defined X86_64 || defined ALPHA
2821 (long long int) tcp->u_arg[1], tcp->u_arg[2]);
2822 printxval(advise, tcp->u_arg[3], "POSIX_FADV_???");
2824 LONG_LONG(tcp->u_arg[1], tcp->u_arg[2]), tcp->u_arg[3]);
2825 printxval(advise, tcp->u_arg[4], "POSIX_FADV_???");
2834 sys_fadvise64_64(struct tcb *tcp)
2836 if (entering(tcp)) {
2837 tprintf("%ld, %lld, %lld, ",
2839 #if defined LINUX_MIPSN32
2840 tcp->ext_arg[1], tcp->ext_arg[2]);
2841 printxval(advise, tcp->u_arg[3], "POSIX_FADV_???");
2842 #elif defined IA64 || defined X86_64 || defined ALPHA || defined LINUX_MIPSN64
2843 (long long int) tcp->u_arg[1], (long long int) tcp->u_arg[2]);
2844 printxval(advise, tcp->u_arg[3], "POSIX_FADV_???");
2846 LONG_LONG(tcp->u_arg[2], tcp->u_arg[3]),
2847 LONG_LONG(tcp->u_arg[4], tcp->u_arg[5]));
2848 printxval(advise, tcp->u_arg[1], "POSIX_FADV_???");
2850 LONG_LONG(tcp->u_arg[1], tcp->u_arg[2]),
2851 LONG_LONG(tcp->u_arg[3], tcp->u_arg[4]));
2852 printxval(advise, tcp->u_arg[5], "POSIX_FADV_???");
2859 static const struct xlat inotify_modes[] = {
2860 { 0x00000001, "IN_ACCESS" },
2861 { 0x00000002, "IN_MODIFY" },
2862 { 0x00000004, "IN_ATTRIB" },
2863 { 0x00000008, "IN_CLOSE_WRITE" },
2864 { 0x00000010, "IN_CLOSE_NOWRITE" },
2865 { 0x00000020, "IN_OPEN" },
2866 { 0x00000040, "IN_MOVED_FROM" },
2867 { 0x00000080, "IN_MOVED_TO" },
2868 { 0x00000100, "IN_CREATE" },
2869 { 0x00000200, "IN_DELETE" },
2870 { 0x00000400, "IN_DELETE_SELF" },
2871 { 0x00000800, "IN_MOVE_SELF" },
2872 { 0x00002000, "IN_UNMOUNT" },
2873 { 0x00004000, "IN_Q_OVERFLOW" },
2874 { 0x00008000, "IN_IGNORED" },
2875 { 0x01000000, "IN_ONLYDIR" },
2876 { 0x02000000, "IN_DONT_FOLLOW" },
2877 { 0x20000000, "IN_MASK_ADD" },
2878 { 0x40000000, "IN_ISDIR" },
2879 { 0x80000000, "IN_ONESHOT" }
2883 sys_inotify_add_watch(struct tcb *tcp)
2885 if (entering(tcp)) {
2886 tprintf("%ld, ", tcp->u_arg[0]);
2887 printpath(tcp, tcp->u_arg[1]);
2889 printflags(inotify_modes, tcp->u_arg[2], "IN_???");
2895 sys_inotify_rm_watch(struct tcb *tcp)
2897 if (entering(tcp)) {
2898 tprintf("%ld, %ld", tcp->u_arg[0], tcp->u_arg[1]);
2904 sys_fallocate(struct tcb *tcp)
2906 if (entering(tcp)) {
2907 tprintf("%ld, ", tcp->u_arg[0]); /* fd */
2908 tprintf("%#lo, ", tcp->u_arg[1]); /* mode */
2909 tprintf("%llu, ", LONG_LONG(tcp->u_arg[2],
2910 tcp->u_arg[3])); /* offset */
2911 tprintf("%llu", LONG_LONG(tcp->u_arg[4],
2912 tcp->u_arg[5])); /* len */