3 * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
4 * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
5 * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
6 * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. The name of the author may not be used to endorse or promote products
18 * derived from this software without specific prior written permission.
20 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
21 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
22 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
23 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
24 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38 #define dirent kernel_dirent
39 #define dirent64 kernel_dirent64
40 #include <linux/types.h>
41 #include <linux/dirent.h>
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];
69 # define stat kernel_stat
70 # include <asm/stat.h>
82 # define dev_t __kernel_dev_t
83 # define ino_t __kernel_ino_t
84 # define mode_t __kernel_mode_t
85 # define nlink_t __kernel_nlink_t
86 # define uid_t __kernel_uid_t
87 # define gid_t __kernel_gid_t
88 # define off_t __kernel_off_t
89 # define loff_t __kernel_loff_t
91 # include <asm/stat.h>
104 # define mode_t mode_t
105 # define nlink_t nlink_t
109 # define loff_t loff_t
111 # ifdef HPPA /* asm-parisc/stat.h defines stat64 */
114 # define stat libc_stat
115 # define stat64 libc_stat64
116 # include <sys/stat.h>
119 /* These might be macros. */
124 # define stat64 hpux_stat64
127 # include <sys/stat.h>
133 # include <sys/cred.h>
136 #ifdef HAVE_SYS_VFS_H
140 #ifdef HAVE_LINUX_XATTR_H
141 #include <linux/xattr.h>
143 #define XATTR_CREATE 1
144 #define XATTR_REPLACE 2
148 #include <sys/param.h>
149 #include <sys/mount.h>
150 #include <sys/stat.h>
153 #if HAVE_LONG_LONG_OFF_T
155 * Ugly hacks for systems that have typedef long long off_t
159 #define HAVE_STAT64 1 /* Ugly hack */
161 #define sys_stat64 sys_stat
162 #define sys_fstat64 sys_fstat
163 #define sys_lstat64 sys_lstat
164 #define sys_lseek64 sys_lseek
165 #define sys_truncate64 sys_truncate
166 #define sys_ftruncate64 sys_ftruncate
169 #ifdef MAJOR_IN_SYSMACROS
170 #include <sys/sysmacros.h>
173 #ifdef MAJOR_IN_MKDEV
174 #include <sys/mkdev.h>
177 #ifdef HAVE_SYS_ASYNCH_H
178 #include <sys/asynch.h>
186 * This is a really dirty trick but it should always work. Traditional
187 * Unix says r/w/rw are 0/1/2, so we make them true flags 1/2/3 by
188 * adding 1. Just remember to add 1 to any arg decoded with openmodes.
190 struct xlat openmodes[] = {
191 { O_RDWR+1, "O_RDWR" },
192 { O_RDONLY+1, "O_RDONLY" },
193 { O_WRONLY+1, "O_WRONLY" },
194 { O_NONBLOCK, "O_NONBLOCK" },
195 { O_APPEND, "O_APPEND" },
196 { O_CREAT, "O_CREAT" },
197 { O_TRUNC, "O_TRUNC" },
198 { O_EXCL, "O_EXCL" },
199 { O_NOCTTY, "O_NOCTTY" },
201 { O_SYNC, "O_SYNC" },
204 { O_ASYNC, "O_ASYNC" },
207 { O_DSYNC, "O_DSYNC" },
210 { O_RSYNC, "O_RSYNC" },
213 { O_NDELAY, "O_NDELAY" },
216 { O_PRIV, "O_PRIV" },
219 { O_DIRECT, "O_DIRECT" },
222 { O_LARGEFILE, "O_LARGEFILE" },
225 { O_DIRECTORY, "O_DIRECTORY" },
228 { O_NOFOLLOW, "O_NOFOLLOW" },
232 { FNDELAY, "FNDELAY" },
235 { FAPPEND, "FAPPEND" },
241 { FDEFER, "FDEFER" },
244 { FASYNC, "FASYNC" },
247 { FSHLOCK, "FSHLOCK" },
250 { FEXLOCK, "FEXLOCK" },
253 { FCREAT, "FCREAT" },
256 { FTRUNC, "FTRUNC" },
268 { FNOCTTY, "FNOCTTY" },
271 { O_SHLOCK, "O_SHLOCK" },
274 { O_EXLOCK, "O_EXLOCK" },
284 printpath(tcp, tcp->u_arg[0]);
287 printflags(openmodes, tcp->u_arg[1] + 1);
288 if (tcp->u_arg[1] & O_CREAT) {
290 tprintf(", %#lo", tcp->u_arg[2]);
297 struct xlat openmodessol[] = {
301 { 0x80, "O_NONBLOCK" },
303 { 0x100, "O_CREAT" },
304 { 0x200, "O_TRUNC" },
306 { 0x800, "O_NOCTTY" },
309 { 0x8000, "O_RSYNC" },
311 { 0x1000, "O_PRIV" },
320 printpath(tcp, tcp->u_arg[0]);
323 printflags(openmodessol, tcp->u_arg[1] + 1);
324 if (tcp->u_arg[1] & 0x100) {
326 tprintf(", %#lo", tcp->u_arg[2]);
339 printpath(tcp, tcp->u_arg[0]);
340 tprintf(", %#lo", tcp->u_arg[1]);
345 static struct xlat access_flags[] = {
351 { EFF_ONLY_OK, "EFF_ONLY_OK" },
364 printpath(tcp, tcp->u_arg[0]);
366 printflags(access_flags, tcp->u_arg[1]);
376 tprintf("%#lo", tcp->u_arg[0]);
381 static struct xlat whence[] = {
382 { SEEK_SET, "SEEK_SET" },
383 { SEEK_CUR, "SEEK_CUR" },
384 { SEEK_END, "SEEK_END" },
388 #ifndef HAVE_LONG_LONG_OFF_T
397 tprintf("%ld, ", tcp->u_arg[0]);
398 offset = tcp->u_arg[1];
399 _whence = tcp->u_arg[2];
400 if (_whence == SEEK_SET)
401 tprintf("%lu, ", offset);
403 tprintf("%ld, ", offset);
404 printxval(whence, _whence, "SEEK_???");
406 return RVAL_UDECIMAL;
416 if (tcp->u_arg[4] == SEEK_SET)
417 tprintf("%ld, %llu, ", tcp->u_arg[0],
418 (((long long int) tcp->u_arg[1]) << 32
419 | (unsigned long long) (unsigned) tcp->u_arg[2]));
421 tprintf("%ld, %lld, ", tcp->u_arg[0],
422 (((long long int) tcp->u_arg[1]) << 32
423 | (unsigned long long) (unsigned) tcp->u_arg[2]));
427 if (syserror(tcp) || umove(tcp, tcp->u_arg[3], &off) < 0)
428 tprintf("%#lx, ", tcp->u_arg[3]);
430 tprintf("[%llu], ", off);
431 printxval(whence, tcp->u_arg[4], "SEEK_???");
441 tprintf("%ld, %lld, %ld", tcp->u_arg[0],
442 # if defined IA64 || defined X86_64 || defined ALPHA
443 (long long int) tcp->u_arg[1], tcp->u_arg[2]
445 (((long long int) tcp->u_arg[1]) << 32
446 | ((unsigned long *) tcp->u_arg)[2]),
455 #if _LFS64_LARGEFILE || HAVE_LONG_LONG_OFF_T
462 ALIGN64 (tcp, 1); /* FreeBSD aligns off_t args */
463 offset = LONG_LONG(tcp->u_arg [1], tcp->u_arg[2]);
464 if (tcp->u_arg[3] == SEEK_SET)
465 tprintf("%ld, %llu, ", tcp->u_arg[0], offset);
467 tprintf("%ld, %lld, ", tcp->u_arg[0], offset);
468 printxval(whence, tcp->u_arg[3], "SEEK_???");
470 return RVAL_LUDECIMAL;
474 #ifndef HAVE_LONG_LONG_OFF_T
480 printpath(tcp, tcp->u_arg[0]);
481 tprintf(", %lu", tcp->u_arg[1]);
487 #if _LFS64_LARGEFILE || HAVE_LONG_LONG_OFF_T
494 printpath(tcp, tcp->u_arg[0]);
495 tprintf(", %llu", LONG_LONG(tcp->u_arg[1],tcp->u_arg[2]));
501 #ifndef HAVE_LONG_LONG_OFF_T
507 tprintf("%ld, %lu", tcp->u_arg[0], tcp->u_arg[1]);
513 #if _LFS64_LARGEFILE || HAVE_LONG_LONG_OFF_T
520 tprintf("%ld, %llu", tcp->u_arg[0],
521 LONG_LONG(tcp->u_arg[1] ,tcp->u_arg[2]));
529 static struct xlat modetypes[] = {
530 { S_IFREG, "S_IFREG" },
531 { S_IFSOCK, "S_IFSOCK" },
532 { S_IFIFO, "S_IFIFO" },
533 { S_IFLNK, "S_IFLNK" },
534 { S_IFDIR, "S_IFDIR" },
535 { S_IFBLK, "S_IFBLK" },
536 { S_IFCHR, "S_IFCHR" },
547 if ((mode & S_IFMT) == 0)
549 else if ((s = xlookup(modetypes, mode & S_IFMT)) == NULL) {
550 sprintf(buf, "%#o", mode);
553 sprintf(buf, "%s%s%s%s", s,
554 (mode & S_ISUID) ? "|S_ISUID" : "",
555 (mode & S_ISGID) ? "|S_ISGID" : "",
556 (mode & S_ISVTX) ? "|S_ISVTX" : "");
557 mode &= ~(S_IFMT|S_ISUID|S_ISGID|S_ISVTX);
559 sprintf(buf + strlen(buf), "|%#o", mode);
560 s = (*buf == '|') ? buf + 1 : buf;
576 sprintf(buf, "%02d/%02d/%02d-%02d:%02d:%02d",
577 tmp->tm_year + 1900, tmp->tm_mon + 1, tmp->tm_mday,
578 tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
590 int st_pad1[3]; /* network id */
599 int st_pad3; /* st_size, off_t expansion */
600 timestruct_t st_atime;
601 timestruct_t st_mtime;
602 timestruct_t st_ctime;
606 int st_pad4[8]; /* expansion area */
610 printstatsol(tcp, addr)
614 struct solstat statbuf;
620 if (syserror(tcp) || !verbose(tcp)) {
621 tprintf("%#lx", addr);
624 if (umove(tcp, addr, &statbuf) < 0) {
629 tprintf("{st_dev=makedev(%lu, %lu), st_ino=%lu, st_mode=%s, ",
630 (unsigned long) ((statbuf.st_dev >> 18) & 0x3fff),
631 (unsigned long) (statbuf.st_dev & 0x3ffff),
632 (unsigned long) statbuf.st_ino,
633 sprintmode(statbuf.st_mode));
634 tprintf("st_nlink=%lu, st_uid=%lu, st_gid=%lu, ",
635 (unsigned long) statbuf.st_nlink,
636 (unsigned long) statbuf.st_uid,
637 (unsigned long) statbuf.st_gid);
638 tprintf("st_blksize=%lu, ", (unsigned long) statbuf.st_blksize);
639 tprintf("st_blocks=%lu, ", (unsigned long) statbuf.st_blocks);
642 tprintf("{st_mode=%s, ", sprintmode(statbuf.st_mode));
643 switch (statbuf.st_mode & S_IFMT) {
644 case S_IFCHR: case S_IFBLK:
645 tprintf("st_rdev=makedev(%lu, %lu), ",
646 (unsigned long) ((statbuf.st_rdev >> 18) & 0x3fff),
647 (unsigned long) (statbuf.st_rdev & 0x3ffff));
650 tprintf("st_size=%u, ", statbuf.st_size);
654 tprintf("st_atime=%s, ", sprinttime(statbuf.st_atime));
655 tprintf("st_mtime=%s, ", sprinttime(statbuf.st_mtime));
656 tprintf("st_ctime=%s}", sprinttime(statbuf.st_ctime));
661 #endif /* LINUXSPARC */
663 struct xlat fileflags[] = {
665 { UF_NODUMP, "UF_NODUMP" },
666 { UF_IMMUTABLE, "UF_IMMUTABLE" },
667 { UF_APPEND, "UF_APPEND" },
668 { UF_OPAQUE, "UF_OPAQUE" },
669 { UF_NOUNLINK, "UF_NOUNLINK" },
670 { SF_ARCHIVED, "SF_ARCHIVED" },
671 { SF_IMMUTABLE, "SF_IMMUTABLE" },
672 { SF_APPEND, "SF_APPEND" },
673 { SF_NOUNLINK, "SF_NOUNLINK" },
676 { _S_ISMLD, "_S_ISMLD" },
679 { _S_ISMOUNTED, "_S_ISMOUNTED" },
691 printpath(tcp, tcp->u_arg[0]);
694 printflags(fileflags, tcp->u_arg[1]);
706 tprintf("%ld, ", tcp->u_arg[0]);
708 printflags(fileflags, tcp->u_arg[1]);
716 #ifndef HAVE_LONG_LONG_OFF_T
718 realprintstat(tcp, statbuf)
720 struct stat *statbuf;
723 tprintf("{st_dev=makedev(%lu, %lu), st_ino=%lu, st_mode=%s, ",
724 (unsigned long) major(statbuf->st_dev),
725 (unsigned long) minor(statbuf->st_dev),
726 (unsigned long) statbuf->st_ino,
727 sprintmode(statbuf->st_mode));
728 tprintf("st_nlink=%lu, st_uid=%lu, st_gid=%lu, ",
729 (unsigned long) statbuf->st_nlink,
730 (unsigned long) statbuf->st_uid,
731 (unsigned long) statbuf->st_gid);
732 #ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
733 tprintf("st_blksize=%lu, ", (unsigned long) statbuf->st_blksize);
734 #endif /* HAVE_STRUCT_STAT_ST_BLKSIZE */
735 #ifdef HAVE_STRUCT_STAT_ST_BLOCKS
736 tprintf("st_blocks=%lu, ", (unsigned long) statbuf->st_blocks);
737 #endif /* HAVE_STRUCT_STAT_ST_BLOCKS */
740 tprintf("{st_mode=%s, ", sprintmode(statbuf->st_mode));
741 switch (statbuf->st_mode & S_IFMT) {
742 case S_IFCHR: case S_IFBLK:
743 #ifdef HAVE_STRUCT_STAT_ST_RDEV
744 tprintf("st_rdev=makedev(%lu, %lu), ",
745 (unsigned long) major(statbuf->st_rdev),
746 (unsigned long) minor(statbuf->st_rdev));
747 #else /* !HAVE_STRUCT_STAT_ST_RDEV */
748 tprintf("st_size=makedev(%lu, %lu), ",
749 (unsigned long) major(statbuf->st_size),
750 (unsigned long) minor(statbuf->st_size));
751 #endif /* !HAVE_STRUCT_STAT_ST_RDEV */
754 tprintf("st_size=%lu, ", statbuf->st_size);
758 tprintf("st_atime=%s, ", sprinttime(statbuf->st_atime));
759 tprintf("st_mtime=%s, ", sprinttime(statbuf->st_mtime));
760 tprintf("st_ctime=%s", sprinttime(statbuf->st_ctime));
761 #if HAVE_STRUCT_STAT_ST_FLAGS
762 tprintf(", st_flags=");
763 if (statbuf->st_flags) {
764 printflags(fileflags, statbuf->st_flags);
768 #if HAVE_STRUCT_STAT_ST_ACLCNT
769 tprintf(", st_aclcnt=%d", statbuf->st_aclcnt);
771 #if HAVE_STRUCT_STAT_ST_LEVEL
772 tprintf(", st_level=%ld", statbuf->st_level);
774 #if HAVE_STRUCT_STAT_ST_FSTYPE
775 tprintf(", st_fstype=%.*s",
776 (int) sizeof statbuf->st_fstype, statbuf->st_fstype);
778 #if HAVE_STRUCT_STAT_ST_GEN
779 tprintf(", st_gen=%u", statbuf->st_gen);
796 if (current_personality == 1) {
797 printstatsol(tcp, addr);
800 #endif /* LINUXSPARC */
806 if (syserror(tcp) || !verbose(tcp)) {
807 tprintf("%#lx", addr);
810 if (umove(tcp, addr, &statbuf) < 0) {
815 realprintstat(tcp, &statbuf);
817 #endif /* !HAVE_LONG_LONG_OFF_T */
821 printstat64(tcp, addr)
825 struct stat64 statbuf;
828 if (current_personality == 1) {
829 printstatsol(tcp, addr);
832 #endif /* LINUXSPARC */
838 if (syserror(tcp) || !verbose(tcp)) {
839 tprintf("%#lx", addr);
842 if (umove(tcp, addr, &statbuf) < 0) {
848 #ifdef HAVE_LONG_LONG
849 tprintf("{st_dev=makedev(%lu, %lu), st_ino=%llu, st_mode=%s, ",
851 tprintf("{st_dev=makedev(%lu, %lu), st_ino=%lu, st_mode=%s, ",
853 (unsigned long) major(statbuf.st_dev),
854 (unsigned long) minor(statbuf.st_dev),
855 #ifdef HAVE_LONG_LONG
856 (unsigned long long) statbuf.st_ino,
858 (unsigned long) statbuf.st_ino,
860 sprintmode(statbuf.st_mode));
861 tprintf("st_nlink=%lu, st_uid=%lu, st_gid=%lu, ",
862 (unsigned long) statbuf.st_nlink,
863 (unsigned long) statbuf.st_uid,
864 (unsigned long) statbuf.st_gid);
865 #ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
866 tprintf("st_blksize=%lu, ",
867 (unsigned long) statbuf.st_blksize);
868 #endif /* HAVE_STRUCT_STAT_ST_BLKSIZE */
869 #ifdef HAVE_STRUCT_STAT_ST_BLOCKS
870 tprintf("st_blocks=%lu, ", (unsigned long) statbuf.st_blocks);
871 #endif /* HAVE_STRUCT_STAT_ST_BLOCKS */
874 tprintf("{st_mode=%s, ", sprintmode(statbuf.st_mode));
875 switch (statbuf.st_mode & S_IFMT) {
876 case S_IFCHR: case S_IFBLK:
877 #ifdef HAVE_STRUCT_STAT_ST_RDEV
878 tprintf("st_rdev=makedev(%lu, %lu), ",
879 (unsigned long) major(statbuf.st_rdev),
880 (unsigned long) minor(statbuf.st_rdev));
881 #else /* !HAVE_STRUCT_STAT_ST_RDEV */
882 tprintf("st_size=makedev(%lu, %lu), ",
883 (unsigned long) major(statbuf.st_size),
884 (unsigned long) minor(statbuf.st_size));
885 #endif /* !HAVE_STRUCT_STAT_ST_RDEV */
888 tprintf("st_size=%llu, ", statbuf.st_size);
892 tprintf("st_atime=%s, ", sprinttime(statbuf.st_atime));
893 tprintf("st_mtime=%s, ", sprinttime(statbuf.st_mtime));
894 tprintf("st_ctime=%s", sprinttime(statbuf.st_ctime));
895 #if HAVE_STRUCT_STAT_ST_FLAGS
896 tprintf(", st_flags=");
897 if (statbuf.st_flags) {
898 printflags(fileflags, statbuf.st_flags);
902 #if HAVE_STRUCT_STAT_ST_ACLCNT
903 tprintf(", st_aclcnt=%d", statbuf.st_aclcnt);
905 #if HAVE_STRUCT_STAT_ST_LEVEL
906 tprintf(", st_level=%ld", statbuf.st_level);
908 #if HAVE_STRUCT_STAT_ST_FSTYPE
909 tprintf(", st_fstype=%.*s",
910 (int) sizeof statbuf.st_fstype, statbuf.st_fstype);
912 #if HAVE_STRUCT_STAT_ST_GEN
913 tprintf(", st_gen=%u", statbuf.st_gen);
920 #endif /* HAVE_STAT64 */
922 #if defined(LINUX) && defined(HAVE_STRUCT___OLD_KERNEL_STAT)
924 convertoldstat(oldbuf, newbuf)
925 const struct __old_kernel_stat *oldbuf;
928 newbuf->st_dev=oldbuf->st_dev;
929 newbuf->st_ino=oldbuf->st_ino;
930 newbuf->st_mode=oldbuf->st_mode;
931 newbuf->st_nlink=oldbuf->st_nlink;
932 newbuf->st_uid=oldbuf->st_uid;
933 newbuf->st_gid=oldbuf->st_gid;
934 newbuf->st_rdev=oldbuf->st_rdev;
935 newbuf->st_size=oldbuf->st_size;
936 newbuf->st_atime=oldbuf->st_atime;
937 newbuf->st_mtime=oldbuf->st_mtime;
938 newbuf->st_ctime=oldbuf->st_ctime;
939 newbuf->st_blksize=0; /* not supported in old_stat */
940 newbuf->st_blocks=0; /* not supported in old_stat */
945 printoldstat(tcp, addr)
949 struct __old_kernel_stat statbuf;
950 struct stat newstatbuf;
953 if (current_personality == 1) {
954 printstatsol(tcp, addr);
957 #endif /* LINUXSPARC */
963 if (syserror(tcp) || !verbose(tcp)) {
964 tprintf("%#lx", addr);
967 if (umove(tcp, addr, &statbuf) < 0) {
972 convertoldstat(&statbuf, &newstatbuf);
973 realprintstat(tcp, &newstatbuf);
975 #endif /* LINUX && !IA64 && !HPPA && !X86_64 && !S390 && !S390X */
977 #ifndef HAVE_LONG_LONG_OFF_T
983 printpath(tcp, tcp->u_arg[0]);
986 printstat(tcp, tcp->u_arg[1]);
998 printpath(tcp, tcp->u_arg[0]);
1001 printstat64(tcp, tcp->u_arg[1]);
1005 return printargs(tcp);
1009 #if defined(LINUX) && defined(HAVE_STRUCT___OLD_KERNEL_STAT)
1014 if (entering(tcp)) {
1015 printpath(tcp, tcp->u_arg[0]);
1018 printoldstat(tcp, tcp->u_arg[1]);
1022 #endif /* LINUX && HAVE_STRUCT___OLD_KERNEL_STAT */
1024 #ifndef HAVE_LONG_LONG_OFF_T
1030 tprintf("%ld, ", tcp->u_arg[0]);
1032 printstat(tcp, tcp->u_arg[1]);
1044 tprintf("%ld, ", tcp->u_arg[0]);
1046 printstat64(tcp, tcp->u_arg[1]);
1050 return printargs(tcp);
1054 #if defined(LINUX) && defined(HAVE_STRUCT___OLD_KERNEL_STAT)
1060 tprintf("%ld, ", tcp->u_arg[0]);
1062 printoldstat(tcp, tcp->u_arg[1]);
1066 #endif /* LINUX && HAVE_STRUCT___OLD_KERNEL_STAT */
1068 #ifndef HAVE_LONG_LONG_OFF_T
1073 if (entering(tcp)) {
1074 printpath(tcp, tcp->u_arg[0]);
1077 printstat(tcp, tcp->u_arg[1]);
1088 if (entering(tcp)) {
1089 printpath(tcp, tcp->u_arg[0]);
1092 printstat64(tcp, tcp->u_arg[1]);
1096 return printargs(tcp);
1100 #if defined(LINUX) && defined(HAVE_STRUCT___OLD_KERNEL_STAT)
1105 if (entering(tcp)) {
1106 printpath(tcp, tcp->u_arg[0]);
1109 printoldstat(tcp, tcp->u_arg[1]);
1113 #endif /* LINUX && HAVE_STRUCT___OLD_KERNEL_STAT */
1116 #if defined(SVR4) || defined(LINUXSPARC)
1122 if (entering(tcp)) {
1123 tprintf("%ld, ", tcp->u_arg[0]);
1124 printpath(tcp, tcp->u_arg[1]);
1128 if (tcp->u_arg[0] == _STAT64_VER)
1129 printstat64 (tcp, tcp->u_arg[2]);
1132 printstat(tcp, tcp->u_arg[2]);
1142 tprintf("%ld, %ld, ", tcp->u_arg[0], tcp->u_arg[1]);
1145 if (tcp->u_arg[0] == _STAT64_VER)
1146 printstat64 (tcp, tcp->u_arg[2]);
1149 printstat(tcp, tcp->u_arg[2]);
1158 if (entering(tcp)) {
1159 tprintf("%ld, ", tcp->u_arg[0]);
1160 printpath(tcp, tcp->u_arg[1]);
1164 if (tcp->u_arg[0] == _STAT64_VER)
1165 printstat64 (tcp, tcp->u_arg[2]);
1168 printstat(tcp, tcp->u_arg[2]);
1177 int mode = tcp->u_arg[2];
1179 if (entering(tcp)) {
1180 tprintf("%ld, ", tcp->u_arg[0]);
1181 printpath(tcp, tcp->u_arg[1]);
1182 tprintf(", %s", sprintmode(mode));
1183 switch (mode & S_IFMT) {
1184 case S_IFCHR: case S_IFBLK:
1186 tprintf(", makedev(%lu, %lu)",
1187 (unsigned long) ((tcp->u_arg[3] >> 18) & 0x3fff),
1188 (unsigned long) (tcp->u_arg[3] & 0x3ffff));
1190 tprintf(", makedev(%lu, %lu)",
1191 (unsigned long) major(tcp->u_arg[3]),
1192 (unsigned long) minor(tcp->u_arg[3]));
1202 #ifdef HAVE_SYS_ACL_H
1204 #include <sys/acl.h>
1206 struct xlat aclcmds[] = {
1208 { SETACL, "SETACL" },
1211 { GETACL, "GETACL" },
1214 { GETACLCNT, "GETACLCNT" },
1217 { ACL_GET, "ACL_GET" },
1220 { ACL_SET, "ACL_SET" },
1223 { ACL_CNT, "ACL_CNT" },
1232 if (entering(tcp)) {
1233 printpath(tcp, tcp->u_arg[0]);
1235 printxval(aclcmds, tcp->u_arg[1], "???ACL???");
1236 tprintf(", %ld", tcp->u_arg[2]);
1238 * FIXME - dump out the list of aclent_t's pointed to
1239 * by "tcp->u_arg[3]" if it's not NULL.
1242 tprintf(", %#lx", tcp->u_arg[3]);
1254 if (entering(tcp)) {
1255 tprintf("%ld, ", tcp->u_arg[0]);
1256 printxval(aclcmds, tcp->u_arg[1], "???ACL???");
1257 tprintf(", %ld", tcp->u_arg[2]);
1259 * FIXME - dump out the list of aclent_t's pointed to
1260 * by "tcp->u_arg[3]" if it's not NULL.
1263 tprintf(", %#lx", tcp->u_arg[3]);
1271 struct xlat aclipc[] = {
1273 { IPC_SHM, "IPC_SHM" },
1276 { IPC_SEM, "IPC_SEM" },
1279 { IPC_MSG, "IPC_MSG" },
1289 if (entering(tcp)) {
1290 printxval(aclipc, tcp->u_arg[0], "???IPC???");
1291 tprintf(", %#lx, ", tcp->u_arg[1]);
1292 printxval(aclcmds, tcp->u_arg[2], "???ACL???");
1293 tprintf(", %ld", tcp->u_arg[3]);
1295 * FIXME - dump out the list of aclent_t's pointed to
1296 * by "tcp->u_arg[4]" if it's not NULL.
1299 tprintf(", %#lx", tcp->u_arg[4]);
1308 #endif /* HAVE_SYS_ACL_H */
1310 #endif /* SVR4 || LINUXSPARC */
1314 static struct xlat fsmagic[] = {
1315 { 0x73757245, "CODA_SUPER_MAGIC" },
1316 { 0x012ff7b7, "COH_SUPER_MAGIC" },
1317 { 0x1373, "DEVFS_SUPER_MAGIC" },
1318 { 0x1cd1, "DEVPTS_SUPER_MAGIC" },
1319 { 0x414A53, "EFS_SUPER_MAGIC" },
1320 { 0xef51, "EXT2_OLD_SUPER_MAGIC" },
1321 { 0xef53, "EXT2_SUPER_MAGIC" },
1322 { 0x137d, "EXT_SUPER_MAGIC" },
1323 { 0xf995e849, "HPFS_SUPER_MAGIC" },
1324 { 0x9660, "ISOFS_SUPER_MAGIC" },
1325 { 0x137f, "MINIX_SUPER_MAGIC" },
1326 { 0x138f, "MINIX_SUPER_MAGIC2" },
1327 { 0x2468, "MINIX2_SUPER_MAGIC" },
1328 { 0x2478, "MINIX2_SUPER_MAGIC2" },
1329 { 0x4d44, "MSDOS_SUPER_MAGIC" },
1330 { 0x564c, "NCP_SUPER_MAGIC" },
1331 { 0x6969, "NFS_SUPER_MAGIC" },
1332 { 0x9fa0, "PROC_SUPER_MAGIC" },
1333 { 0x002f, "QNX4_SUPER_MAGIC" },
1334 { 0x52654973, "REISERFS_SUPER_MAGIC" },
1335 { 0x02011994, "SHMFS_SUPER_MAGIC" },
1336 { 0x517b, "SMB_SUPER_MAGIC" },
1337 { 0x012ff7b6, "SYSV2_SUPER_MAGIC" },
1338 { 0x012ff7b5, "SYSV4_SUPER_MAGIC" },
1339 { 0x00011954, "UFS_MAGIC" },
1340 { 0x54190100, "UFS_CIGAM" },
1341 { 0x012ff7b4, "XENIX_SUPER_MAGIC" },
1342 { 0x012fd16d, "XIAFS_SUPER_MAGIC" },
1343 { 0x62656572, "SYSFS_MAGIC" },
1355 static char buf[32];
1359 s = xlookup(fsmagic, magic);
1361 sprintf(buf, "\"%s\"", s);
1365 sprintf(buf, "%#x", magic);
1370 printstatfs(tcp, addr)
1374 struct statfs statbuf;
1376 if (syserror(tcp) || !verbose(tcp)) {
1377 tprintf("%#lx", addr);
1380 if (umove(tcp, addr, &statbuf) < 0) {
1386 tprintf("{f_type=%s, f_fbsize=%u, f_blocks=%u, f_bfree=%u, ",
1387 sprintfstype(statbuf.f_type),
1388 statbuf.f_bsize, statbuf.f_blocks, statbuf.f_bfree);
1389 tprintf("f_bavail=%u, f_files=%u, f_ffree=%u, f_fsid={%d, %d}, f_namelen=%u",
1390 statbuf.f_bavail,statbuf.f_files, statbuf.f_ffree,
1391 statbuf.f_fsid.__val[0], statbuf.f_fsid.__val[1],
1394 tprintf("{f_type=%s, f_bsize=%lu, f_blocks=%lu, f_bfree=%lu, ",
1395 sprintfstype(statbuf.f_type),
1396 (unsigned long)statbuf.f_bsize,
1397 (unsigned long)statbuf.f_blocks,
1398 (unsigned long)statbuf.f_bfree);
1399 tprintf("f_bavail=%lu, f_files=%lu, f_ffree=%lu, f_fsid={%d, %d}",
1400 (unsigned long)statbuf.f_bavail,
1401 (unsigned long)statbuf.f_files,
1402 (unsigned long)statbuf.f_ffree,
1403 statbuf.f_fsid.__val[0], statbuf.f_fsid.__val[1]);
1405 tprintf(", f_namelen=%lu", (unsigned long)statbuf.f_namelen);
1408 #ifdef _STATFS_F_FRSIZE
1409 tprintf(", f_frsize=%lu", (unsigned long)statbuf.f_frsize);
1418 if (entering(tcp)) {
1419 printpath(tcp, tcp->u_arg[0]);
1422 printstatfs(tcp, tcp->u_arg[1]);
1431 if (entering(tcp)) {
1432 tprintf("%lu, ", tcp->u_arg[0]);
1434 printstatfs(tcp, tcp->u_arg[1]);
1441 printstatfs64(tcp, addr)
1445 struct statfs64 statbuf;
1447 if (syserror(tcp) || !verbose(tcp)) {
1448 tprintf("%#lx", addr);
1451 if (umove(tcp, addr, &statbuf) < 0) {
1457 tprintf("{f_type=%s, f_fbsize=%u, f_blocks=%u, f_bfree=%u, ",
1458 sprintfstype(statbuf.f_type),
1459 statbuf.f_bsize, statbuf.f_blocks, statbuf.f_bfree);
1460 tprintf("f_bavail=%u, f_files=%u, f_ffree=%u, f_fsid={%d, %d}, f_namelen=%u",
1461 statbuf.f_bavail,statbuf.f_files, statbuf.f_ffree,
1462 statbuf.f_fsid.__val[0], statbuf.f_fsid.__val[1],
1465 tprintf("{f_type=%s, f_bsize=%lu, f_blocks=%lu, f_bfree=%lu, ",
1466 sprintfstype(statbuf.f_type),
1467 (unsigned long)statbuf.f_bsize,
1468 (unsigned long)statbuf.f_blocks,
1469 (unsigned long)statbuf.f_bfree);
1470 tprintf("f_bavail=%lu, f_files=%lu, f_ffree=%lu, f_fsid={%d, %d}",
1471 (unsigned long)statbuf.f_bavail,
1472 (unsigned long)statbuf.f_files,
1473 (unsigned long)statbuf.f_ffree,
1474 statbuf.f_fsid.__val[0], statbuf.f_fsid.__val[1]);
1475 tprintf(", f_namelen=%lu", (unsigned long)statbuf.f_namelen);
1477 #ifdef _STATFS_F_FRSIZE
1478 tprintf(", f_frsize=%lu", (unsigned long)statbuf.f_frsize);
1487 if (entering(tcp)) {
1488 printpath(tcp, tcp->u_arg[0]);
1489 tprintf(", %lu, ", tcp->u_arg[1]);
1491 if (tcp->u_arg[1] == sizeof (struct statfs64))
1492 printstatfs64(tcp, tcp->u_arg[2]);
1503 if (entering(tcp)) {
1504 tprintf("%lu, %lu, ", tcp->u_arg[0], tcp->u_arg[1]);
1506 if (tcp->u_arg[1] == sizeof (struct statfs64))
1507 printstatfs64(tcp, tcp->u_arg[2]);
1515 #if defined(LINUX) && defined(__alpha)
1521 if (entering(tcp)) {
1522 printpath(tcp, tcp->u_arg[0]);
1525 printstatfs(tcp, tcp->u_arg[1]);
1526 tprintf(", %lu", tcp->u_arg[2]);
1535 if (entering(tcp)) {
1536 tprintf("%lu, ", tcp->u_arg[0]);
1538 printstatfs(tcp, tcp->u_arg[1]);
1539 tprintf(", %lu", tcp->u_arg[2]);
1543 #endif /* LINUX && __alpha */
1553 struct ustat statbuf;
1555 if (entering(tcp)) {
1556 tprintf("makedev(%lu, %lu), ",
1557 (long) major(tcp->u_arg[0]),
1558 (long) minor(tcp->u_arg[0]));
1561 if (syserror(tcp) || !verbose(tcp))
1562 tprintf("%#lx", tcp->u_arg[1]);
1563 else if (umove(tcp, tcp->u_arg[1], &statbuf) < 0)
1566 tprintf("{f_tfree=%lu, f_tinode=%lu, ",
1567 statbuf.f_tfree, statbuf.f_tinode);
1568 tprintf("f_fname=\"%.*s\", ",
1569 (int) sizeof(statbuf.f_fname),
1571 tprintf("f_fpack=\"%.*s\"}",
1572 (int) sizeof(statbuf.f_fpack),
1585 if (entering(tcp)) {
1586 printpath(tcp, tcp->u_arg[0]);
1588 printpath(tcp, tcp->u_arg[1]);
1599 if (entering(tcp)) {
1600 printpath(tcp, tcp->u_arg[0]);
1609 if (entering(tcp)) {
1610 printpath(tcp, tcp->u_arg[0]);
1611 tprintf(", %#lo", tcp->u_arg[1]);
1620 if (entering(tcp)) {
1621 printpath(tcp, tcp->u_arg[0]);
1630 if (entering(tcp)) {
1631 tprintf("%ld", tcp->u_arg[0]);
1640 if (entering(tcp)) {
1641 printpath(tcp, tcp->u_arg[0]);
1650 if (entering(tcp)) {
1651 tprintf("%ld", tcp->u_arg[0]);
1660 if (entering(tcp)) {
1661 printpath(tcp, tcp->u_arg[0]);
1663 printpath(tcp, tcp->u_arg[1]);
1672 if (entering(tcp)) {
1673 printpath(tcp, tcp->u_arg[0]);
1682 if (entering(tcp)) {
1683 printpath(tcp, tcp->u_arg[0]);
1685 printpath(tcp, tcp->u_arg[1]);
1694 if (entering(tcp)) {
1695 printpath(tcp, tcp->u_arg[0]);
1699 tprintf("%#lx", tcp->u_arg[1]);
1701 printpathn(tcp, tcp->u_arg[1], tcp->u_rval);
1702 tprintf(", %lu", tcp->u_arg[2]);
1711 if (entering(tcp)) {
1712 printpath(tcp, tcp->u_arg[0]);
1714 printpath(tcp, tcp->u_arg[1]);
1723 if (entering(tcp)) {
1724 printpath(tcp, tcp->u_arg[0]);
1725 printuid(", ", tcp->u_arg[1]);
1726 printuid(", ", tcp->u_arg[2]);
1735 if (entering(tcp)) {
1736 tprintf("%ld", tcp->u_arg[0]);
1737 printuid(", ", tcp->u_arg[1]);
1738 printuid(", ", tcp->u_arg[2]);
1747 if (entering(tcp)) {
1748 printpath(tcp, tcp->u_arg[0]);
1749 tprintf(", %#lo", tcp->u_arg[1]);
1758 if (entering(tcp)) {
1759 tprintf("%ld, %#lo", tcp->u_arg[0], tcp->u_arg[1]);
1769 if (entering(tcp)) {
1770 printpath(tcp, tcp->u_arg[0]);
1772 printtv32(tcp, tcp->u_arg[1]);
1782 if (entering(tcp)) {
1783 printpath(tcp, tcp->u_arg[0]);
1785 printtv(tcp, tcp->u_arg[1]);
1796 if (entering(tcp)) {
1797 printpath(tcp, tcp->u_arg[0]);
1801 else if (!verbose(tcp))
1802 tprintf("%#lx", tcp->u_arg[1]);
1803 else if (umoven(tcp, tcp->u_arg[1], sizeof ut,
1807 tprintf("[%s,", sprinttime(ut[0]));
1808 tprintf(" %s]", sprinttime(ut[1]));
1818 int mode = tcp->u_arg[1];
1820 if (entering(tcp)) {
1821 printpath(tcp, tcp->u_arg[0]);
1822 tprintf(", %s", sprintmode(mode));
1823 switch (mode & S_IFMT) {
1824 case S_IFCHR: case S_IFBLK:
1826 if (current_personality == 1)
1827 tprintf(", makedev(%lu, %lu)",
1828 (unsigned long) ((tcp->u_arg[2] >> 18) & 0x3fff),
1829 (unsigned long) (tcp->u_arg[2] & 0x3ffff));
1832 tprintf(", makedev(%lu, %lu)",
1833 (unsigned long) major(tcp->u_arg[2]),
1834 (unsigned long) minor(tcp->u_arg[2]));
1847 if (entering(tcp)) {
1848 printpath(tcp, tcp->u_arg[0]);
1849 tprintf(", %#lo", tcp->u_arg[1]);
1858 if (entering(tcp)) {
1859 tprintf("%ld", tcp->u_arg[0]);
1873 if (!verbose(tcp)) {
1874 tprintf("%#lx", addr);
1877 if (umove(tcp, addr, &d) < 0) {
1881 tprintf("{d_ino=%ld, ", (unsigned long) d.d_ino);
1883 printpathn(tcp, (long) ((struct dirent *) addr)->d_name, d.d_reclen);
1891 if (entering(tcp)) {
1892 tprintf("%lu, ", tcp->u_arg[0]);
1894 if (syserror(tcp) || tcp->u_rval == 0 || !verbose(tcp))
1895 tprintf("%#lx", tcp->u_arg[1]);
1897 printdir(tcp, tcp->u_arg[1]);
1898 /* Not much point in printing this out, it is always 1. */
1899 if (tcp->u_arg[2] != 1)
1900 tprintf(", %lu", tcp->u_arg[2]);
1907 #if defined FREEBSD || defined LINUX
1908 struct xlat direnttypes[] = {
1909 { DT_UNKNOWN, "DT_UNKNOWN" },
1910 { DT_FIFO, "DT_FIFO" },
1911 { DT_CHR, "DT_CHR" },
1912 { DT_DIR, "DT_DIR" },
1913 { DT_BLK, "DT_BLK" },
1914 { DT_REG, "DT_REG" },
1915 { DT_LNK, "DT_LNK" },
1916 { DT_SOCK, "DT_SOCK" },
1917 { DT_WHT, "DT_WHT" },
1927 int i, len, dents = 0;
1930 if (entering(tcp)) {
1931 tprintf("%lu, ", tcp->u_arg[0]);
1934 if (syserror(tcp) || !verbose(tcp)) {
1935 tprintf("%#lx, %lu", tcp->u_arg[1], tcp->u_arg[2]);
1939 if ((buf = malloc(len)) == NULL) {
1940 tprintf("out of memory\n");
1943 if (umoven(tcp, tcp->u_arg[1], len, buf) < 0) {
1944 tprintf("{...}, %lu", tcp->u_arg[2]);
1950 for (i = 0; i < len;) {
1951 struct kernel_dirent *d = (struct kernel_dirent *) &buf[i];
1954 tprintf("%s{d_ino=%lu, d_off=%lu, ",
1955 i ? " " : "", d->d_ino, d->d_off);
1956 tprintf("d_reclen=%u, d_name=\"%s\"}",
1957 d->d_reclen, d->d_name);
1962 tprintf("%s{d_ino=%lu, d_off=%lu, ",
1964 (unsigned long) d->d_ino,
1965 (unsigned long) d->d_off);
1966 tprintf("d_reclen=%u, d_name=\"%s\"}",
1967 d->d_reclen, d->d_name);
1972 tprintf("%s{d_off=%lu, d_fileno=%lu, d_reclen=%u, ",
1973 i ? " " : "", d->d_off, d->d_fileno,
1975 tprintf("d_namlen=%u, d_name=\"%.*s\"}",
1976 d->d_namlen, d->d_namlen, d->d_name);
1981 tprintf("%s{d_fileno=%u, d_reclen=%u, d_type=",
1982 i ? " " : "", d->d_fileno, d->d_reclen);
1983 printxval(direnttypes, d->d_type, "DT_???");
1984 tprintf(", d_namlen=%u, d_name=\"%.*s\"}",
1985 d->d_namlen, d->d_namlen, d->d_name);
1987 #endif /* FREEBSD */
1989 tprintf("/* d_reclen == 0, problem here */");
1998 tprintf("/* %u entries */", dents);
1999 tprintf(", %lu", tcp->u_arg[2]);
2005 #if _LFS64_LARGEFILE
2010 int i, len, dents = 0;
2013 if (entering(tcp)) {
2014 tprintf("%lu, ", tcp->u_arg[0]);
2017 if (syserror(tcp) || !verbose(tcp)) {
2018 tprintf("%#lx, %lu", tcp->u_arg[1], tcp->u_arg[2]);
2022 if ((buf = malloc(len)) == NULL) {
2023 tprintf("out of memory\n");
2026 if (umoven(tcp, tcp->u_arg[1], len, buf) < 0) {
2027 tprintf("{...}, %lu", tcp->u_arg[2]);
2033 for (i = 0; i < len;) {
2034 struct dirent64 *d = (struct dirent64 *) &buf[i];
2035 #if defined(LINUX) || defined(SVR4)
2037 tprintf("%s{d_ino=%llu, d_off=%llu, ",
2043 printxval(direnttypes, d->d_type, "DT_???");
2046 tprintf("d_reclen=%u, d_name=\"%s\"}",
2047 d->d_reclen, d->d_name);
2049 #endif /* LINUX || SVR4 */
2052 tprintf("%s{d_off=%lu, d_fileno=%lu, d_reclen=%u, ",
2053 i ? " " : "", d->d_off, d->d_fileno,
2055 tprintf("d_namlen=%u, d_name=\"%.*s\"}",
2056 d->d_namlen, d->d_namlen, d->d_name);
2065 tprintf("/* %u entries */", dents);
2066 tprintf(", %lu", tcp->u_arg[2]);
2074 sys_getdirentries(tcp)
2077 int i, len, dents = 0;
2081 if (entering(tcp)) {
2082 tprintf("%lu, ", tcp->u_arg[0]);
2085 if (syserror(tcp) || !verbose(tcp)) {
2086 tprintf("%#lx, %lu, %#lx", tcp->u_arg[1], tcp->u_arg[2], tcp->u_arg[3]);
2090 if ((buf = malloc(len)) == NULL) {
2091 tprintf("out of memory\n");
2094 if (umoven(tcp, tcp->u_arg[1], len, buf) < 0) {
2095 tprintf("{...}, %lu, %#lx", tcp->u_arg[2], tcp->u_arg[3]);
2101 for (i = 0; i < len;) {
2102 struct kernel_dirent *d = (struct kernel_dirent *) &buf[i];
2104 tprintf("%s{d_fileno=%u, d_reclen=%u, d_type=",
2105 i ? " " : "", d->d_fileno, d->d_reclen);
2106 printxval(direnttypes, d->d_type, "DT_???");
2107 tprintf(", d_namlen=%u, d_name=\"%.*s\"}",
2108 d->d_namlen, d->d_namlen, d->d_name);
2116 tprintf("/* %u entries */", dents);
2118 tprintf(", %lu", tcp->u_arg[2]);
2119 if (umove(tcp, tcp->u_arg[3], &basep) < 0)
2120 tprintf(", %#lx", tcp->u_arg[3]);
2122 tprintf(", [%lu]", basep);
2134 tprintf("%#lx", tcp->u_arg[0]);
2136 printpathn(tcp, tcp->u_arg[0], tcp->u_rval - 1);
2137 tprintf(", %lu", tcp->u_arg[1]);
2150 tprintf("%#lx", tcp->u_arg[0]);
2152 printpathn(tcp, tcp->u_arg[0], tcp->u_arg[1]);
2153 tprintf(", %lu", tcp->u_arg[1]);
2159 #ifdef HAVE_SYS_ASYNCH_H
2165 struct aio_result_t res;
2167 if (entering(tcp)) {
2168 tprintf("%lu, ", tcp->u_arg[0]);
2171 tprintf("%#lx", tcp->u_arg[1]);
2173 printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
2174 tprintf(", %lu, %lu, ", tcp->u_arg[2], tcp->u_arg[3]);
2175 printxval(whence, tcp->u_arg[4], "L_???");
2176 if (syserror(tcp) || tcp->u_arg[5] == 0
2177 || umove(tcp, tcp->u_arg[5], &res) < 0)
2178 tprintf(", %#lx", tcp->u_arg[5]);
2180 tprintf(", {aio_return %d aio_errno %d}",
2181 res.aio_return, res.aio_errno);
2190 struct aio_result_t res;
2192 if (entering(tcp)) {
2193 tprintf("%lu, ", tcp->u_arg[0]);
2194 printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
2195 tprintf(", %lu, %lu, ", tcp->u_arg[2], tcp->u_arg[3]);
2196 printxval(whence, tcp->u_arg[4], "L_???");
2199 if (tcp->u_arg[5] == 0)
2201 else if (syserror(tcp)
2202 || umove(tcp, tcp->u_arg[5], &res) < 0)
2203 tprintf(", %#lx", tcp->u_arg[5]);
2205 tprintf(", {aio_return %d aio_errno %d}",
2206 res.aio_return, res.aio_errno);
2216 printtv(tcp, tcp->u_arg[0]);
2224 struct aio_result_t res;
2227 if (tcp->u_arg[0] == 0)
2229 else if (syserror(tcp)
2230 || umove(tcp, tcp->u_arg[0], &res) < 0)
2231 tprintf("%#lx", tcp->u_arg[0]);
2233 tprintf("{aio_return %d aio_errno %d}",
2234 res.aio_return, res.aio_errno);
2239 #endif /* HAVE_SYS_ASYNCH_H */
2241 struct xlat xattrflags[] = {
2243 { XATTR_CREATE, "XATTR_CREATE" },
2244 { XATTR_REPLACE, "XATTR_REPLACE" },
2253 if (entering(tcp)) {
2254 printpath(tcp, tcp->u_arg[0]);
2256 printstr(tcp, tcp->u_arg[1], -1);
2257 /* XXX Print value in format */
2258 tprintf(", %p, %ld, ", (void *) tcp->u_arg[2], tcp->u_arg[3]);
2259 printflags(xattrflags, tcp->u_arg[4]);
2268 if (entering(tcp)) {
2269 tprintf("%ld, ", tcp->u_arg[0]);
2270 printstr(tcp, tcp->u_arg[1], -1);
2271 /* XXX Print value in format */
2272 tprintf(", %p, %ld, ", (void *) tcp->u_arg[2], tcp->u_arg[3]);
2273 printflags(xattrflags, tcp->u_arg[4]);
2282 if (entering(tcp)) {
2283 printpath(tcp, tcp->u_arg[0]);
2285 printstr(tcp, tcp->u_arg[1], -1);
2287 /* XXX Print value in format */
2288 tprintf(", %p, %ld", (void *) tcp->u_arg[2], tcp->u_arg[3]);
2297 if (entering(tcp)) {
2298 tprintf("%ld, ", tcp->u_arg[0]);
2299 printstr(tcp, tcp->u_arg[1], -1);
2301 /* XXX Print value in format */
2302 tprintf(", %p, %ld", (void *) tcp->u_arg[2], tcp->u_arg[3]);
2311 if (entering(tcp)) {
2312 printpath(tcp, tcp->u_arg[0]);
2314 /* XXX Print value in format */
2315 tprintf(", %p, %lu", (void *) tcp->u_arg[1], tcp->u_arg[2]);
2324 if (entering(tcp)) {
2325 tprintf("%ld", tcp->u_arg[0]);
2327 /* XXX Print value in format */
2328 tprintf(", %p, %lu", (void *) tcp->u_arg[1], tcp->u_arg[2]);
2334 sys_removexattr(tcp)
2337 if (entering(tcp)) {
2338 printpath(tcp, tcp->u_arg[0]);
2340 printstr(tcp, tcp->u_arg[1], -1);
2346 sys_fremovexattr(tcp)
2349 if (entering(tcp)) {
2350 tprintf("%ld, ", tcp->u_arg[0]);
2351 printstr(tcp, tcp->u_arg[1], -1);