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>
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. The name of the author may not be used to endorse or promote products
16 * derived from this software without specific prior written permission.
18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43 # include <sys/cred.h>
48 #ifdef MAJOR_IN_SYSMACROS
49 #include <sys/sysmacros.h>
53 #include <sys/mkdev.h>
56 #ifdef HAVE_SYS_ASYNCH_H
57 #include <sys/asynch.h>
65 * This is a really dirty trick but it should always work. Traditional
66 * Unix says r/w/rw are 0/1/2, so we make them true flags 1/2/3 by
67 * adding 1. Just remember to add 1 to any arg decoded with openmodes.
69 struct xlat openmodes[] = {
70 { O_RDWR+1, "O_RDWR" },
71 { O_RDONLY+1, "O_RDONLY" },
72 { O_WRONLY+1, "O_WRONLY" },
73 { O_NONBLOCK, "O_NONBLOCK" },
74 { O_APPEND, "O_APPEND" },
75 { O_CREAT, "O_CREAT" },
76 { O_TRUNC, "O_TRUNC" },
78 { O_NOCTTY, "O_NOCTTY" },
83 { O_ASYNC, "O_ASYNC" },
86 { O_DSYNC, "O_DSYNC" },
89 { O_RSYNC, "O_RSYNC" },
92 { O_NDELAY, "O_NDELAY" },
98 { O_DIRECT, "O_DIRECT" },
101 { O_LARGEFILE, "O_LARGEFILE" },
104 { O_DIRECTORY, "O_DIRECTORY" },
108 { FNDELAY, "FNDELAY" },
111 { FAPPEND, "FAPPEND" },
117 { FDEFER, "FDEFER" },
120 { FASYNC, "FASYNC" },
123 { FSHLOCK, "FSHLOCK" },
126 { FEXLOCK, "FEXLOCK" },
129 { FCREAT, "FCREAT" },
132 { FTRUNC, "FTRUNC" },
144 { FNOCTTY, "FNOCTTY" },
154 printpath(tcp, tcp->u_arg[0]);
157 printflags(openmodes, tcp->u_arg[1] + 1);
158 if (tcp->u_arg[1] & O_CREAT) {
160 tprintf(", %#lo", tcp->u_arg[2]);
167 struct xlat openmodessol[] = {
171 { 0x80, "O_NONBLOCK" },
173 { 0x100, "O_CREAT" },
174 { 0x200, "O_TRUNC" },
176 { 0x800, "O_NOCTTY" },
179 { 0x8000, "O_RSYNC" },
181 { 0x1000, "O_PRIV" },
190 printpath(tcp, tcp->u_arg[0]);
193 printflags(openmodessol, tcp->u_arg[1] + 1);
194 if (tcp->u_arg[1] & 0x100) {
196 tprintf(", %#lo", tcp->u_arg[2]);
209 printpath(tcp, tcp->u_arg[0]);
210 tprintf(", %#lo", tcp->u_arg[1]);
215 static struct xlat access_flags[] = {
221 { EFF_ONLY_OK, "EFF_ONLY_OK" },
234 printpath(tcp, tcp->u_arg[0]);
236 printflags(access_flags, tcp->u_arg[1]);
246 tprintf("%#lo", tcp->u_arg[0]);
251 static struct xlat whence[] = {
252 { SEEK_SET, "SEEK_SET" },
253 { SEEK_CUR, "SEEK_CUR" },
254 { SEEK_END, "SEEK_END" },
263 tprintf("%ld, ", tcp->u_arg[0]);
264 if (tcp->u_arg[2] == SEEK_SET)
265 tprintf("%lu, ", tcp->u_arg[1]);
267 tprintf("%ld, ", tcp->u_arg[1]);
268 printxval(whence, tcp->u_arg[2], "SEEK_???");
270 return RVAL_UDECIMAL;
279 if (tcp->u_arg[4] == SEEK_SET)
280 tprintf("%ld, %llu, ", tcp->u_arg[0],
281 (((unsigned long long int) tcp->u_arg[1]) << 32
282 | (unsigned long) tcp->u_arg[2]));
284 tprintf("%ld, %lld, ", tcp->u_arg[0],
285 (((long long int) tcp->u_arg[1]) << 32
286 | (unsigned long) tcp->u_arg[2]));
290 tprintf("%#lx, ", tcp->u_arg[3]);
293 umove(tcp, tcp->u_arg[3], &off);
294 tprintf("{%lld}, ", off);
296 printxval(whence, tcp->u_arg[4], "SEEK_???");
307 printpath(tcp, tcp->u_arg[0]);
308 tprintf(", %lu", tcp->u_arg[1]);
318 tprintf("%ld, %lu", tcp->u_arg[0], tcp->u_arg[1]);
325 static struct xlat modetypes[] = {
326 { S_IFREG, "S_IFREG" },
327 { S_IFSOCK, "S_IFSOCK" },
328 { S_IFIFO, "S_IFIFO" },
329 { S_IFLNK, "S_IFLNK" },
330 { S_IFDIR, "S_IFDIR" },
331 { S_IFBLK, "S_IFBLK" },
332 { S_IFCHR, "S_IFCHR" },
343 if ((mode & S_IFMT) == 0)
345 else if ((s = xlookup(modetypes, mode & S_IFMT)) == NULL) {
346 sprintf(buf, "%#o", mode);
349 sprintf(buf, "%s%s%s%s", s,
350 (mode & S_ISUID) ? "|S_ISUID" : "",
351 (mode & S_ISGID) ? "|S_ISGID" : "",
352 (mode & S_ISVTX) ? "|S_ISVTX" : "");
353 mode &= ~(S_IFMT|S_ISUID|S_ISGID|S_ISVTX);
355 sprintf(buf + strlen(buf), "|%#o", mode);
356 s = (*buf == '|') ? buf + 1 : buf;
372 sprintf(buf, "%02d/%02d/%02d-%02d:%02d:%02d",
373 tmp->tm_year, tmp->tm_mon + 1, tmp->tm_mday,
374 tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
386 int st_pad1[3]; /* network id */
395 int st_pad3; /* st_size, off_t expansion */
396 timestruct_t st_atime;
397 timestruct_t st_mtime;
398 timestruct_t st_ctime;
402 int st_pad4[8]; /* expansion area */
406 printstatsol(tcp, addr)
410 struct solstat statbuf;
416 if (syserror(tcp) || !verbose(tcp)) {
417 tprintf("%#x", addr);
420 if (umove(tcp, addr, &statbuf) < 0) {
425 tprintf("{st_dev=makedev(%lu, %lu), st_ino=%lu, st_mode=%s, ",
426 (unsigned long) ((statbuf.st_dev >> 18) & 0x3fff),
427 (unsigned long) (statbuf.st_dev & 0x3ffff),
428 (unsigned long) statbuf.st_ino,
429 sprintmode(statbuf.st_mode));
430 tprintf("st_nlink=%lu, st_uid=%lu, st_gid=%lu, ",
431 (unsigned long) statbuf.st_nlink,
432 (unsigned long) statbuf.st_uid,
433 (unsigned long) statbuf.st_gid);
434 tprintf("st_blksize=%lu, ", (unsigned long) statbuf.st_blksize);
435 tprintf("st_blocks=%lu, ", (unsigned long) statbuf.st_blocks);
438 tprintf("{st_mode=%s, ", sprintmode(statbuf.st_mode));
439 switch (statbuf.st_mode & S_IFMT) {
440 case S_IFCHR: case S_IFBLK:
441 tprintf("st_rdev=makedev(%lu, %lu), ",
442 (unsigned long) ((statbuf.st_rdev >> 18) & 0x3fff),
443 (unsigned long) (statbuf.st_rdev & 0x3ffff));
446 tprintf("st_size=%u, ", statbuf.st_size);
450 tprintf("st_atime=%s, ", sprinttime(statbuf.st_atime));
451 tprintf("st_mtime=%s, ", sprinttime(statbuf.st_mtime));
452 tprintf("st_ctime=%s}", sprinttime(statbuf.st_ctime));
460 realprintstat(tcp, statbuf)
463 struct new_stat *statbuf;
465 struct stat *statbuf;
469 tprintf("{st_dev=makedev(%lu, %lu), st_ino=%lu, st_mode=%s, ",
470 (unsigned long) major(statbuf->st_dev),
471 (unsigned long) minor(statbuf->st_dev),
472 (unsigned long) statbuf->st_ino,
473 sprintmode(statbuf->st_mode));
474 tprintf("st_nlink=%lu, st_uid=%lu, st_gid=%lu, ",
475 (unsigned long) statbuf->st_nlink,
476 (unsigned long) statbuf->st_uid,
477 (unsigned long) statbuf->st_gid);
478 #ifdef HAVE_ST_BLKSIZE
479 tprintf("st_blksize=%lu, ", (unsigned long) statbuf->st_blksize);
480 #endif /* HAVE_ST_BLKSIZE */
481 #ifdef HAVE_ST_BLOCKS
482 tprintf("st_blocks=%lu, ", (unsigned long) statbuf->st_blocks);
483 #endif /* HAVE_ST_BLOCKS */
486 tprintf("{st_mode=%s, ", sprintmode(statbuf->st_mode));
487 switch (statbuf->st_mode & S_IFMT) {
488 case S_IFCHR: case S_IFBLK:
490 tprintf("st_rdev=makedev(%lu, %lu), ",
491 (unsigned long) major(statbuf->st_rdev),
492 (unsigned long) minor(statbuf->st_rdev));
493 #else /* !HAVE_ST_RDEV */
494 tprintf("st_size=makedev(%lu, %lu), ",
495 (unsigned long) major(statbuf->st_size),
496 (unsigned long) minor(statbuf->st_size));
497 #endif /* !HAVE_ST_RDEV */
500 tprintf("st_size=%lu, ", statbuf->st_size);
504 tprintf("st_atime=%s, ", sprinttime(statbuf->st_atime));
505 tprintf("st_mtime=%s, ", sprinttime(statbuf->st_mtime));
506 tprintf("st_ctime=%s}", sprinttime(statbuf->st_ctime));
519 struct new_stat statbuf;
525 if (current_personality == 1) {
526 printstatsol(tcp, addr);
529 #endif /* LINUXSPARC */
535 if (syserror(tcp) || !verbose(tcp)) {
536 tprintf("%#x", addr);
539 if (umove(tcp, addr, &statbuf) < 0) {
544 realprintstat(tcp, &statbuf);
549 convertoldstat(oldbuf, newbuf)
550 const struct old_stat *oldbuf;
551 struct new_stat *newbuf;
553 newbuf->st_dev=oldbuf->st_dev;
554 newbuf->st_ino=oldbuf->st_ino;
555 newbuf->st_mode=oldbuf->st_mode;
556 newbuf->st_nlink=oldbuf->st_nlink;
557 newbuf->st_uid=oldbuf->st_uid;
558 newbuf->st_gid=oldbuf->st_gid;
559 newbuf->st_rdev=oldbuf->st_rdev;
560 newbuf->st_size=oldbuf->st_size;
561 newbuf->st_atime=oldbuf->st_atime;
562 newbuf->st_mtime=oldbuf->st_mtime;
563 newbuf->st_ctime=oldbuf->st_ctime;
564 newbuf->st_blksize=0; /* not supported in old_stat */
565 newbuf->st_blocks=0; /* not supported in old_stat */
572 printoldstat(tcp, addr)
576 struct old_stat statbuf;
577 struct new_stat newstatbuf;
580 if (current_personality == 1) {
581 printstatsol(tcp, addr);
584 #endif /* LINUXSPARC */
590 if (syserror(tcp) || !verbose(tcp)) {
591 tprintf("%#x", addr);
594 if (umove(tcp, addr, &statbuf) < 0) {
599 convertoldstat(&statbuf, &newstatbuf);
600 realprintstat(tcp, &newstatbuf);
610 printpath(tcp, tcp->u_arg[0]);
613 printstat(tcp, tcp->u_arg[1]);
624 printpath(tcp, tcp->u_arg[0]);
627 printoldstat(tcp, tcp->u_arg[1]);
638 tprintf("%ld, ", tcp->u_arg[0]);
640 printstat(tcp, tcp->u_arg[1]);
651 tprintf("%ld, ", tcp->u_arg[0]);
653 printoldstat(tcp, tcp->u_arg[1]);
664 printpath(tcp, tcp->u_arg[0]);
667 printstat(tcp, tcp->u_arg[1]);
678 printpath(tcp, tcp->u_arg[0]);
681 printoldstat(tcp, tcp->u_arg[1]);
688 #if defined(SVR4) || defined(LINUXSPARC)
695 tprintf("%ld, ", tcp->u_arg[0]);
696 printpath(tcp, tcp->u_arg[1]);
699 printstat(tcp, tcp->u_arg[2]);
709 tprintf("%ld, %ld, ", tcp->u_arg[0], tcp->u_arg[1]);
711 printstat(tcp, tcp->u_arg[2]);
721 tprintf("%ld, ", tcp->u_arg[0]);
722 printpath(tcp, tcp->u_arg[1]);
725 printstat(tcp, tcp->u_arg[2]);
734 int mode = tcp->u_arg[2];
737 tprintf("%ld, ", tcp->u_arg[0]);
738 printpath(tcp, tcp->u_arg[1]);
739 tprintf(", %s", sprintmode(mode));
740 switch (mode & S_IFMT) {
741 case S_IFCHR: case S_IFBLK:
743 tprintf(", makedev(%lu, %lu)",
744 (unsigned long) ((tcp->u_arg[3] >> 18) & 0x3fff),
745 (unsigned long) (tcp->u_arg[3] & 0x3ffff));
747 tprintf(", makedev(%lu, %lu)",
748 (unsigned long) major(tcp->u_arg[3]),
749 (unsigned long) minor(tcp->u_arg[3]));
759 #endif /* SVR4 || LINUXSPARC */
763 static struct xlat fsmagic[] = {
764 { 0xef51, "EXT2_OLD_SUPER_MAGIC" },
765 { 0xef53, "EXT2_SUPER_MAGIC" },
766 { 0x137d, "EXT_SUPER_MAGIC" },
767 { 0x9660, "ISOFS_SUPER_MAGIC" },
768 { 0x137f, "MINIX_SUPER_MAGIC" },
769 { 0x138f, "MINIX_SUPER_MAGIC2" },
770 { 0x2468, "NEW_MINIX_SUPER_MAGIC" },
771 { 0x4d44, "MSDOS_SUPER_MAGIC" },
772 { 0x6969, "NFS_SUPER_MAGIC" },
773 { 0x9fa0, "PROC_SUPER_MAGIC" },
774 { 0x012fd16d, "XIAFS_SUPER_MAGIC" },
790 s = xlookup(fsmagic, magic);
792 sprintf(buf, "\"%s\"", s);
796 sprintf(buf, "%#x", magic);
801 printstatfs(tcp, addr)
805 struct statfs statbuf;
807 if (syserror(tcp) || !verbose(tcp)) {
808 tprintf("%#lx", addr);
811 if (umove(tcp, addr, &statbuf) < 0) {
817 tprintf("{f_type=%s, f_fbsize=%u, f_blocks=%u, f_bfree=%u, ",
818 sprintfstype(statbuf.f_type),
819 statbuf.f_bsize, statbuf.f_blocks, statbuf.f_bfree);
820 tprintf("f_bavail=%u, f_files=%u, f_ffree=%u, f_namelen=%u}",
821 statbuf.f_bavail,statbuf.f_files, statbuf.f_ffree, statbuf.f_namelen);
823 tprintf("{f_type=%s, f_bsize=%lu, f_blocks=%lu, f_bfree=%lu, ",
824 sprintfstype(statbuf.f_type),
825 (unsigned long)statbuf.f_bsize,
826 (unsigned long)statbuf.f_blocks,
827 (unsigned long)statbuf.f_bfree);
828 tprintf("f_files=%lu, f_ffree=%lu",
829 (unsigned long)statbuf.f_files,
830 (unsigned long)statbuf.f_ffree);
832 tprintf(", f_namelen=%lu}", (unsigned long)statbuf.f_namelen);
843 printpath(tcp, tcp->u_arg[0]);
846 printstatfs(tcp, tcp->u_arg[1]);
856 tprintf("%lu, ", tcp->u_arg[0]);
858 printstatfs(tcp, tcp->u_arg[1]);
863 #if defined(linux) && defined(alpha)
870 printpath(tcp, tcp->u_arg[0]);
873 printstatfs(tcp, tcp->u_arg[1]);
874 tprintf(", %lu", tcp->u_arg[2]);
884 tprintf("%lu, ", tcp->u_arg[0]);
886 printstatfs(tcp, tcp->u_arg[1]);
887 tprintf(", %lu", tcp->u_arg[2]);
891 #endif /* linux && alpha */
901 struct ustat statbuf;
904 tprintf("makedev(%lu, %lu), ",
905 (long) major(tcp->u_arg[0]),
906 (long) minor(tcp->u_arg[0]));
909 if (syserror(tcp) || !verbose(tcp))
910 tprintf("%#lx", tcp->u_arg[1]);
911 else if (umove(tcp, tcp->u_arg[1], &statbuf) < 0)
914 tprintf("{f_tfree=%lu, f_tinode=%lu, ",
915 statbuf.f_tfree, statbuf.f_tinode);
916 tprintf("f_fname=\"%.*s\", ",
917 (int) sizeof(statbuf.f_fname),
919 tprintf("f_fpack=\"%.*s\"}",
920 (int) sizeof(statbuf.f_fpack),
935 printpath(tcp, tcp->u_arg[0]);
945 printpath(tcp, tcp->u_arg[0]);
946 tprintf(", %#lo", tcp->u_arg[1]);
956 printpath(tcp, tcp->u_arg[0]);
966 tprintf("%ld", tcp->u_arg[0]);
976 printpath(tcp, tcp->u_arg[0]);
986 tprintf("%ld", tcp->u_arg[0]);
996 printpath(tcp, tcp->u_arg[0]);
998 printpath(tcp, tcp->u_arg[1]);
1007 if (entering(tcp)) {
1008 printpath(tcp, tcp->u_arg[0]);
1017 if (entering(tcp)) {
1018 printpath(tcp, tcp->u_arg[0]);
1020 printpath(tcp, tcp->u_arg[1]);
1029 if (entering(tcp)) {
1030 printpath(tcp, tcp->u_arg[0]);
1034 tprintf("%#lx", tcp->u_arg[1]);
1036 printpathn(tcp, tcp->u_arg[1], tcp->u_rval);
1037 tprintf(", %lu", tcp->u_arg[2]);
1046 if (entering(tcp)) {
1047 printpath(tcp, tcp->u_arg[0]);
1049 printpath(tcp, tcp->u_arg[1]);
1058 if (entering(tcp)) {
1059 printpath(tcp, tcp->u_arg[0]);
1060 tprintf(", %lu, %lu", tcp->u_arg[1], tcp->u_arg[2]);
1069 if (entering(tcp)) {
1070 tprintf("%ld, %lu, %lu",
1071 tcp->u_arg[0], tcp->u_arg[1], tcp->u_arg[2]);
1080 if (entering(tcp)) {
1081 printpath(tcp, tcp->u_arg[0]);
1082 tprintf(", %#lo", tcp->u_arg[1]);
1091 if (entering(tcp)) {
1092 tprintf("%ld, %#lo", tcp->u_arg[0], tcp->u_arg[1]);
1101 if (entering(tcp)) {
1102 printpath(tcp, tcp->u_arg[0]);
1104 printtv(tcp, tcp->u_arg[1]);
1115 if (entering(tcp)) {
1116 printpath(tcp, tcp->u_arg[0]);
1120 else if (!verbose(tcp))
1121 tprintf("%#lx", tcp->u_arg[1]);
1122 else if (umoven(tcp, tcp->u_arg[1], sizeof ut,
1126 tprintf("[%s,", sprinttime(ut[0]));
1127 tprintf(" %s]", sprinttime(ut[1]));
1137 int mode = tcp->u_arg[1];
1139 if (entering(tcp)) {
1140 printpath(tcp, tcp->u_arg[0]);
1141 tprintf(", %s", sprintmode(mode));
1142 switch (mode & S_IFMT) {
1143 case S_IFCHR: case S_IFBLK:
1145 if (current_personality == 1)
1146 tprintf(", makedev(%lu, %lu)",
1147 (unsigned long) ((tcp->u_arg[2] >> 18) & 0x3fff),
1148 (unsigned long) (tcp->u_arg[2] & 0x3ffff));
1151 tprintf(", makedev(%lu, %lu)",
1152 (unsigned long) major(tcp->u_arg[2]),
1153 (unsigned long) minor(tcp->u_arg[2]));
1166 if (entering(tcp)) {
1167 printpath(tcp, tcp->u_arg[0]);
1168 tprintf(", %#lo", tcp->u_arg[1]);
1177 if (entering(tcp)) {
1178 tprintf("%ld", tcp->u_arg[0]);
1192 if (!verbose(tcp)) {
1193 tprintf("%#lx", addr);
1196 if (umove(tcp, addr, &d) < 0) {
1200 tprintf("{d_ino=%ld, ", (unsigned long) d.d_ino);
1202 printpathn(tcp, (long) ((struct dirent *) addr)->d_name, d.d_reclen);
1210 if (entering(tcp)) {
1211 tprintf("%lu, ", tcp->u_arg[0]);
1213 if (syserror(tcp) || tcp->u_rval == 0 || !verbose(tcp))
1214 tprintf("%#lx", tcp->u_arg[1]);
1216 printdir(tcp, tcp->u_arg[1]);
1217 /* Not much point in printing this out, it is always 1. */
1218 if (tcp->u_arg[2] != 1)
1219 tprintf(", %lu", tcp->u_arg[2]);
1230 int i, len, dents = 0;
1233 if (entering(tcp)) {
1234 tprintf("%lu, ", tcp->u_arg[0]);
1237 if (syserror(tcp) || !verbose(tcp)) {
1238 tprintf("%#lx, %lu", tcp->u_arg[1], tcp->u_arg[2]);
1243 tprintf (" = Unknown value\n");
1248 if ((buf = malloc(len)) == NULL) {
1249 tprintf("out of memory\n");
1252 if (umoven(tcp, tcp->u_arg[1], len, buf) < 0) {
1253 tprintf("{...}, %lu", tcp->u_arg[2]);
1259 for (i = 0; i < len;) {
1260 struct dirent *d = (struct dirent *) &buf[i];
1263 tprintf("%s{d_ino=%lu, d_off=%lu, ",
1264 i ? " " : "", d->d_ino, d->d_off);
1265 tprintf("d_reclen=%u, d_name=\"%s\"}",
1266 d->d_reclen, d->d_name);
1271 tprintf("%s{d_ino=%lu, d_off=%lu, ",
1272 i ? " " : "", d->d_ino, d->d_off);
1273 tprintf("d_reclen=%u, d_name=\"%s\"}",
1274 d->d_reclen, d->d_name);
1279 tprintf("%s{d_off=%lu, d_fileno=%lu, d_reclen=%u, ",
1280 i ? " " : "", d->d_off, d->d_fileno,
1282 tprintf("d_namlen=%u, d_name=\"%.*s\"}",
1283 d->d_namlen, d->d_namlen, d->d_name);
1292 tprintf("/* %u entries */", dents);
1293 tprintf(", %lu", tcp->u_arg[2]);
1306 tprintf("%#lx", tcp->u_arg[0]);
1308 printstr(tcp, tcp->u_arg[0], tcp->u_arg[1]);
1309 tprintf(", %lu", tcp->u_arg[1]);
1315 #ifdef HAVE_SYS_ASYNCH_H
1321 struct aio_result_t res;
1323 if (entering(tcp)) {
1324 tprintf("%lu, ", tcp->u_arg[0]);
1327 tprintf("%#lx", tcp->u_arg[1]);
1329 printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
1330 tprintf(", %lu, %lu, ", tcp->u_arg[2], tcp->u_arg[3]);
1331 printxval(whence, tcp->u_arg[4], "L_???");
1332 if (syserror(tcp) || tcp->u_arg[5] == 0
1333 || umove(tcp, tcp->u_arg[5], &res) < 0)
1334 tprintf(", %#lx", tcp->u_arg[5]);
1336 tprintf(", {aio_return %d aio_errno %d}",
1337 res.aio_return, res.aio_errno);
1346 struct aio_result_t res;
1348 if (entering(tcp)) {
1349 tprintf("%lu, ", tcp->u_arg[0]);
1350 printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
1351 tprintf(", %lu, %lu, ", tcp->u_arg[2], tcp->u_arg[3]);
1352 printxval(whence, tcp->u_arg[4], "L_???");
1355 if (tcp->u_arg[5] == 0)
1357 else if (syserror(tcp)
1358 || umove(tcp, tcp->u_arg[5], &res) < 0)
1359 tprintf(", %#lx", tcp->u_arg[5]);
1361 tprintf(", {aio_return %d aio_errno %d}",
1362 res.aio_return, res.aio_errno);
1372 printtv(tcp, tcp->u_arg[0]);
1380 struct aio_result_t res;
1383 if (tcp->u_arg[0] == 0)
1385 else if (syserror(tcp)
1386 || umove(tcp, tcp->u_arg[0], &res) < 0)
1387 tprintf("%#lx", tcp->u_arg[0]);
1389 tprintf("{aio_return %d aio_errno %d}",
1390 res.aio_return, res.aio_errno);
1395 #endif /* HAVE_SYS_ASYNCH_H */