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.
36 #define dirent kernel_dirent
37 #include <linux/types.h>
38 #include <linux/dirent.h>
41 #define kernel_dirent dirent
45 # include <asm/stat.h>
46 # define stat libc_stat
47 # include <sys/stat.h>
50 # include <sys/stat.h>
56 # include <sys/cred.h>
61 #ifdef MAJOR_IN_SYSMACROS
62 #include <sys/sysmacros.h>
66 #include <sys/mkdev.h>
69 #ifdef HAVE_SYS_ASYNCH_H
70 #include <sys/asynch.h>
78 * This is a really dirty trick but it should always work. Traditional
79 * Unix says r/w/rw are 0/1/2, so we make them true flags 1/2/3 by
80 * adding 1. Just remember to add 1 to any arg decoded with openmodes.
82 struct xlat openmodes[] = {
83 { O_RDWR+1, "O_RDWR" },
84 { O_RDONLY+1, "O_RDONLY" },
85 { O_WRONLY+1, "O_WRONLY" },
86 { O_NONBLOCK, "O_NONBLOCK" },
87 { O_APPEND, "O_APPEND" },
88 { O_CREAT, "O_CREAT" },
89 { O_TRUNC, "O_TRUNC" },
91 { O_NOCTTY, "O_NOCTTY" },
96 { O_ASYNC, "O_ASYNC" },
99 { O_DSYNC, "O_DSYNC" },
102 { O_RSYNC, "O_RSYNC" },
105 { O_NDELAY, "O_NDELAY" },
108 { O_PRIV, "O_PRIV" },
111 { O_DIRECT, "O_DIRECT" },
114 { O_LARGEFILE, "O_LARGEFILE" },
117 { O_DIRECTORY, "O_DIRECTORY" },
121 { FNDELAY, "FNDELAY" },
124 { FAPPEND, "FAPPEND" },
130 { FDEFER, "FDEFER" },
133 { FASYNC, "FASYNC" },
136 { FSHLOCK, "FSHLOCK" },
139 { FEXLOCK, "FEXLOCK" },
142 { FCREAT, "FCREAT" },
145 { FTRUNC, "FTRUNC" },
157 { FNOCTTY, "FNOCTTY" },
167 printpath(tcp, tcp->u_arg[0]);
170 printflags(openmodes, tcp->u_arg[1] + 1);
171 if (tcp->u_arg[1] & O_CREAT) {
173 tprintf(", %#lo", tcp->u_arg[2]);
180 struct xlat openmodessol[] = {
184 { 0x80, "O_NONBLOCK" },
186 { 0x100, "O_CREAT" },
187 { 0x200, "O_TRUNC" },
189 { 0x800, "O_NOCTTY" },
192 { 0x8000, "O_RSYNC" },
194 { 0x1000, "O_PRIV" },
203 printpath(tcp, tcp->u_arg[0]);
206 printflags(openmodessol, tcp->u_arg[1] + 1);
207 if (tcp->u_arg[1] & 0x100) {
209 tprintf(", %#lo", tcp->u_arg[2]);
222 printpath(tcp, tcp->u_arg[0]);
223 tprintf(", %#lo", tcp->u_arg[1]);
228 static struct xlat access_flags[] = {
234 { EFF_ONLY_OK, "EFF_ONLY_OK" },
247 printpath(tcp, tcp->u_arg[0]);
249 printflags(access_flags, tcp->u_arg[1]);
259 tprintf("%#lo", tcp->u_arg[0]);
264 static struct xlat whence[] = {
265 { SEEK_SET, "SEEK_SET" },
266 { SEEK_CUR, "SEEK_CUR" },
267 { SEEK_END, "SEEK_END" },
276 tprintf("%ld, ", tcp->u_arg[0]);
277 if (tcp->u_arg[2] == SEEK_SET)
278 tprintf("%lu, ", tcp->u_arg[1]);
280 tprintf("%ld, ", tcp->u_arg[1]);
281 printxval(whence, tcp->u_arg[2], "SEEK_???");
283 return RVAL_UDECIMAL;
292 if (tcp->u_arg[4] == SEEK_SET)
293 tprintf("%ld, %llu, ", tcp->u_arg[0],
294 (((long long int) tcp->u_arg[1]) << 32
295 | (unsigned long long) tcp->u_arg[2]));
297 tprintf("%ld, %lld, ", tcp->u_arg[0],
298 (((long long int) tcp->u_arg[1]) << 32
299 | (unsigned long long) tcp->u_arg[2]));
303 if (syserror(tcp) || umove(tcp, tcp->u_arg[3], &off) < 0)
304 tprintf("%#lx, ", tcp->u_arg[3]);
306 tprintf("[%llu], ", off);
307 printxval(whence, tcp->u_arg[4], "SEEK_???");
318 printpath(tcp, tcp->u_arg[0]);
319 tprintf(", %lu", tcp->u_arg[1]);
329 tprintf("%ld, %lu", tcp->u_arg[0], tcp->u_arg[1]);
336 static struct xlat modetypes[] = {
337 { S_IFREG, "S_IFREG" },
338 { S_IFSOCK, "S_IFSOCK" },
339 { S_IFIFO, "S_IFIFO" },
340 { S_IFLNK, "S_IFLNK" },
341 { S_IFDIR, "S_IFDIR" },
342 { S_IFBLK, "S_IFBLK" },
343 { S_IFCHR, "S_IFCHR" },
354 if ((mode & S_IFMT) == 0)
356 else if ((s = xlookup(modetypes, mode & S_IFMT)) == NULL) {
357 sprintf(buf, "%#o", mode);
360 sprintf(buf, "%s%s%s%s", s,
361 (mode & S_ISUID) ? "|S_ISUID" : "",
362 (mode & S_ISGID) ? "|S_ISGID" : "",
363 (mode & S_ISVTX) ? "|S_ISVTX" : "");
364 mode &= ~(S_IFMT|S_ISUID|S_ISGID|S_ISVTX);
366 sprintf(buf + strlen(buf), "|%#o", mode);
367 s = (*buf == '|') ? buf + 1 : buf;
383 sprintf(buf, "%02d/%02d/%02d-%02d:%02d:%02d",
384 tmp->tm_year, tmp->tm_mon + 1, tmp->tm_mday,
385 tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
397 int st_pad1[3]; /* network id */
406 int st_pad3; /* st_size, off_t expansion */
407 timestruct_t st_atime;
408 timestruct_t st_mtime;
409 timestruct_t st_ctime;
413 int st_pad4[8]; /* expansion area */
417 printstatsol(tcp, addr)
421 struct solstat statbuf;
427 if (syserror(tcp) || !verbose(tcp)) {
428 tprintf("%#x", addr);
431 if (umove(tcp, addr, &statbuf) < 0) {
436 tprintf("{st_dev=makedev(%lu, %lu), st_ino=%lu, st_mode=%s, ",
437 (unsigned long) ((statbuf.st_dev >> 18) & 0x3fff),
438 (unsigned long) (statbuf.st_dev & 0x3ffff),
439 (unsigned long) statbuf.st_ino,
440 sprintmode(statbuf.st_mode));
441 tprintf("st_nlink=%lu, st_uid=%lu, st_gid=%lu, ",
442 (unsigned long) statbuf.st_nlink,
443 (unsigned long) statbuf.st_uid,
444 (unsigned long) statbuf.st_gid);
445 tprintf("st_blksize=%lu, ", (unsigned long) statbuf.st_blksize);
446 tprintf("st_blocks=%lu, ", (unsigned long) statbuf.st_blocks);
449 tprintf("{st_mode=%s, ", sprintmode(statbuf.st_mode));
450 switch (statbuf.st_mode & S_IFMT) {
451 case S_IFCHR: case S_IFBLK:
452 tprintf("st_rdev=makedev(%lu, %lu), ",
453 (unsigned long) ((statbuf.st_rdev >> 18) & 0x3fff),
454 (unsigned long) (statbuf.st_rdev & 0x3ffff));
457 tprintf("st_size=%u, ", statbuf.st_size);
461 tprintf("st_atime=%s, ", sprinttime(statbuf.st_atime));
462 tprintf("st_mtime=%s, ", sprinttime(statbuf.st_mtime));
463 tprintf("st_ctime=%s}", sprinttime(statbuf.st_ctime));
468 #endif /* LINUXSPARC */
471 realprintstat(tcp, statbuf)
473 struct stat *statbuf;
476 tprintf("{st_dev=makedev(%lu, %lu), st_ino=%lu, st_mode=%s, ",
477 (unsigned long) major(statbuf->st_dev),
478 (unsigned long) minor(statbuf->st_dev),
479 (unsigned long) statbuf->st_ino,
480 sprintmode(statbuf->st_mode));
481 tprintf("st_nlink=%lu, st_uid=%lu, st_gid=%lu, ",
482 (unsigned long) statbuf->st_nlink,
483 (unsigned long) statbuf->st_uid,
484 (unsigned long) statbuf->st_gid);
485 #ifdef HAVE_ST_BLKSIZE
486 tprintf("st_blksize=%lu, ", (unsigned long) statbuf->st_blksize);
487 #endif /* HAVE_ST_BLKSIZE */
488 #ifdef HAVE_ST_BLOCKS
489 tprintf("st_blocks=%lu, ", (unsigned long) statbuf->st_blocks);
490 #endif /* HAVE_ST_BLOCKS */
493 tprintf("{st_mode=%s, ", sprintmode(statbuf->st_mode));
494 switch (statbuf->st_mode & S_IFMT) {
495 case S_IFCHR: case S_IFBLK:
497 tprintf("st_rdev=makedev(%lu, %lu), ",
498 (unsigned long) major(statbuf->st_rdev),
499 (unsigned long) minor(statbuf->st_rdev));
500 #else /* !HAVE_ST_RDEV */
501 tprintf("st_size=makedev(%lu, %lu), ",
502 (unsigned long) major(statbuf->st_size),
503 (unsigned long) minor(statbuf->st_size));
504 #endif /* !HAVE_ST_RDEV */
507 tprintf("st_size=%lu, ", statbuf->st_size);
511 tprintf("st_atime=%s, ", sprinttime(statbuf->st_atime));
512 tprintf("st_mtime=%s, ", sprinttime(statbuf->st_mtime));
513 tprintf("st_ctime=%s}", sprinttime(statbuf->st_ctime));
528 if (current_personality == 1) {
529 printstatsol(tcp, addr);
532 #endif /* LINUXSPARC */
538 if (syserror(tcp) || !verbose(tcp)) {
539 tprintf("%#x", addr);
542 if (umove(tcp, addr, &statbuf) < 0) {
547 realprintstat(tcp, &statbuf);
552 convertoldstat(oldbuf, newbuf)
553 const struct __old_kernel_stat *oldbuf;
556 newbuf->st_dev=oldbuf->st_dev;
557 newbuf->st_ino=oldbuf->st_ino;
558 newbuf->st_mode=oldbuf->st_mode;
559 newbuf->st_nlink=oldbuf->st_nlink;
560 newbuf->st_uid=oldbuf->st_uid;
561 newbuf->st_gid=oldbuf->st_gid;
562 newbuf->st_rdev=oldbuf->st_rdev;
563 newbuf->st_size=oldbuf->st_size;
564 newbuf->st_atime=oldbuf->st_atime;
565 newbuf->st_mtime=oldbuf->st_mtime;
566 newbuf->st_ctime=oldbuf->st_ctime;
567 newbuf->st_blksize=0; /* not supported in old_stat */
568 newbuf->st_blocks=0; /* not supported in old_stat */
575 printoldstat(tcp, addr)
579 struct __old_kernel_stat statbuf;
580 struct stat newstatbuf;
583 if (current_personality == 1) {
584 printstatsol(tcp, addr);
587 #endif /* LINUXSPARC */
593 if (syserror(tcp) || !verbose(tcp)) {
594 tprintf("%#x", addr);
597 if (umove(tcp, addr, &statbuf) < 0) {
602 convertoldstat(&statbuf, &newstatbuf);
603 realprintstat(tcp, &newstatbuf);
613 printpath(tcp, tcp->u_arg[0]);
616 printstat(tcp, tcp->u_arg[1]);
627 printpath(tcp, tcp->u_arg[0]);
630 printoldstat(tcp, tcp->u_arg[1]);
641 tprintf("%ld, ", tcp->u_arg[0]);
643 printstat(tcp, tcp->u_arg[1]);
654 tprintf("%ld, ", tcp->u_arg[0]);
656 printoldstat(tcp, tcp->u_arg[1]);
667 printpath(tcp, tcp->u_arg[0]);
670 printstat(tcp, tcp->u_arg[1]);
681 printpath(tcp, tcp->u_arg[0]);
684 printoldstat(tcp, tcp->u_arg[1]);
691 #if defined(SVR4) || defined(LINUXSPARC)
698 tprintf("%ld, ", tcp->u_arg[0]);
699 printpath(tcp, tcp->u_arg[1]);
702 printstat(tcp, tcp->u_arg[2]);
712 tprintf("%ld, %ld, ", tcp->u_arg[0], tcp->u_arg[1]);
714 printstat(tcp, tcp->u_arg[2]);
724 tprintf("%ld, ", tcp->u_arg[0]);
725 printpath(tcp, tcp->u_arg[1]);
728 printstat(tcp, tcp->u_arg[2]);
737 int mode = tcp->u_arg[2];
740 tprintf("%ld, ", tcp->u_arg[0]);
741 printpath(tcp, tcp->u_arg[1]);
742 tprintf(", %s", sprintmode(mode));
743 switch (mode & S_IFMT) {
744 case S_IFCHR: case S_IFBLK:
746 tprintf(", makedev(%lu, %lu)",
747 (unsigned long) ((tcp->u_arg[3] >> 18) & 0x3fff),
748 (unsigned long) (tcp->u_arg[3] & 0x3ffff));
750 tprintf(", makedev(%lu, %lu)",
751 (unsigned long) major(tcp->u_arg[3]),
752 (unsigned long) minor(tcp->u_arg[3]));
762 #endif /* SVR4 || LINUXSPARC */
766 static struct xlat fsmagic[] = {
767 { 0xef51, "EXT2_OLD_SUPER_MAGIC" },
768 { 0xef53, "EXT2_SUPER_MAGIC" },
769 { 0x137d, "EXT_SUPER_MAGIC" },
770 { 0x9660, "ISOFS_SUPER_MAGIC" },
771 { 0x137f, "MINIX_SUPER_MAGIC" },
772 { 0x138f, "MINIX_SUPER_MAGIC2" },
773 { 0x2468, "MINIX2_SUPER_MAGIC" },
774 { 0x2478, "MINIX2_SUPER_MAGIC2" },
775 { 0x4d44, "MSDOS_SUPER_MAGIC" },
776 { 0x6969, "NFS_SUPER_MAGIC" },
777 { 0x9fa0, "PROC_SUPER_MAGIC" },
778 { 0x012fd16d, "XIAFS_SUPER_MAGIC" },
794 s = xlookup(fsmagic, magic);
796 sprintf(buf, "\"%s\"", s);
800 sprintf(buf, "%#x", magic);
805 printstatfs(tcp, addr)
809 struct statfs statbuf;
811 if (syserror(tcp) || !verbose(tcp)) {
812 tprintf("%#lx", addr);
815 if (umove(tcp, addr, &statbuf) < 0) {
821 tprintf("{f_type=%s, f_fbsize=%u, f_blocks=%u, f_bfree=%u, ",
822 sprintfstype(statbuf.f_type),
823 statbuf.f_bsize, statbuf.f_blocks, statbuf.f_bfree);
824 tprintf("f_bavail=%u, f_files=%u, f_ffree=%u, f_namelen=%u",
825 statbuf.f_bavail,statbuf.f_files, statbuf.f_ffree, statbuf.f_namelen);
827 tprintf("{f_type=%s, f_bsize=%lu, f_blocks=%lu, f_bfree=%lu, ",
828 sprintfstype(statbuf.f_type),
829 (unsigned long)statbuf.f_bsize,
830 (unsigned long)statbuf.f_blocks,
831 (unsigned long)statbuf.f_bfree);
832 tprintf("f_files=%lu, f_ffree=%lu",
833 (unsigned long)statbuf.f_files,
834 (unsigned long)statbuf.f_ffree);
836 tprintf(", f_namelen=%lu", (unsigned long)statbuf.f_namelen);
847 printpath(tcp, tcp->u_arg[0]);
850 printstatfs(tcp, tcp->u_arg[1]);
860 tprintf("%lu, ", tcp->u_arg[0]);
862 printstatfs(tcp, tcp->u_arg[1]);
867 #if defined(linux) && defined(__alpha)
874 printpath(tcp, tcp->u_arg[0]);
877 printstatfs(tcp, tcp->u_arg[1]);
878 tprintf(", %lu", tcp->u_arg[2]);
888 tprintf("%lu, ", tcp->u_arg[0]);
890 printstatfs(tcp, tcp->u_arg[1]);
891 tprintf(", %lu", tcp->u_arg[2]);
895 #endif /* linux && __alpha */
905 struct ustat statbuf;
908 tprintf("makedev(%lu, %lu), ",
909 (long) major(tcp->u_arg[0]),
910 (long) minor(tcp->u_arg[0]));
913 if (syserror(tcp) || !verbose(tcp))
914 tprintf("%#lx", tcp->u_arg[1]);
915 else if (umove(tcp, tcp->u_arg[1], &statbuf) < 0)
918 tprintf("{f_tfree=%lu, f_tinode=%lu, ",
919 statbuf.f_tfree, statbuf.f_tinode);
920 tprintf("f_fname=\"%.*s\", ",
921 (int) sizeof(statbuf.f_fname),
923 tprintf("f_fpack=\"%.*s\"}",
924 (int) sizeof(statbuf.f_fpack),
939 printpath(tcp, tcp->u_arg[0]);
949 printpath(tcp, tcp->u_arg[0]);
950 tprintf(", %#lo", tcp->u_arg[1]);
960 printpath(tcp, tcp->u_arg[0]);
970 tprintf("%ld", tcp->u_arg[0]);
980 printpath(tcp, tcp->u_arg[0]);
990 tprintf("%ld", tcp->u_arg[0]);
1000 printpath(tcp, tcp->u_arg[0]);
1002 printpath(tcp, tcp->u_arg[1]);
1011 if (entering(tcp)) {
1012 printpath(tcp, tcp->u_arg[0]);
1021 if (entering(tcp)) {
1022 printpath(tcp, tcp->u_arg[0]);
1024 printpath(tcp, tcp->u_arg[1]);
1033 if (entering(tcp)) {
1034 printpath(tcp, tcp->u_arg[0]);
1038 tprintf("%#lx", tcp->u_arg[1]);
1040 printpathn(tcp, tcp->u_arg[1], tcp->u_rval);
1041 tprintf(", %lu", tcp->u_arg[2]);
1050 if (entering(tcp)) {
1051 printpath(tcp, tcp->u_arg[0]);
1053 printpath(tcp, tcp->u_arg[1]);
1062 if (entering(tcp)) {
1063 printpath(tcp, tcp->u_arg[0]);
1064 tprintf(", %lu, %lu", tcp->u_arg[1], tcp->u_arg[2]);
1073 if (entering(tcp)) {
1074 tprintf("%ld, %lu, %lu",
1075 tcp->u_arg[0], tcp->u_arg[1], tcp->u_arg[2]);
1084 if (entering(tcp)) {
1085 printpath(tcp, tcp->u_arg[0]);
1086 tprintf(", %#lo", tcp->u_arg[1]);
1095 if (entering(tcp)) {
1096 tprintf("%ld, %#lo", tcp->u_arg[0], tcp->u_arg[1]);
1105 if (entering(tcp)) {
1106 printpath(tcp, tcp->u_arg[0]);
1108 printtv(tcp, tcp->u_arg[1]);
1119 if (entering(tcp)) {
1120 printpath(tcp, tcp->u_arg[0]);
1124 else if (!verbose(tcp))
1125 tprintf("%#lx", tcp->u_arg[1]);
1126 else if (umoven(tcp, tcp->u_arg[1], sizeof ut,
1130 tprintf("[%s,", sprinttime(ut[0]));
1131 tprintf(" %s]", sprinttime(ut[1]));
1141 int mode = tcp->u_arg[1];
1143 if (entering(tcp)) {
1144 printpath(tcp, tcp->u_arg[0]);
1145 tprintf(", %s", sprintmode(mode));
1146 switch (mode & S_IFMT) {
1147 case S_IFCHR: case S_IFBLK:
1149 if (current_personality == 1)
1150 tprintf(", makedev(%lu, %lu)",
1151 (unsigned long) ((tcp->u_arg[2] >> 18) & 0x3fff),
1152 (unsigned long) (tcp->u_arg[2] & 0x3ffff));
1155 tprintf(", makedev(%lu, %lu)",
1156 (unsigned long) major(tcp->u_arg[2]),
1157 (unsigned long) minor(tcp->u_arg[2]));
1170 if (entering(tcp)) {
1171 printpath(tcp, tcp->u_arg[0]);
1172 tprintf(", %#lo", tcp->u_arg[1]);
1181 if (entering(tcp)) {
1182 tprintf("%ld", tcp->u_arg[0]);
1196 if (!verbose(tcp)) {
1197 tprintf("%#lx", addr);
1200 if (umove(tcp, addr, &d) < 0) {
1204 tprintf("{d_ino=%ld, ", (unsigned long) d.d_ino);
1206 printpathn(tcp, (long) ((struct dirent *) addr)->d_name, d.d_reclen);
1214 if (entering(tcp)) {
1215 tprintf("%lu, ", tcp->u_arg[0]);
1217 if (syserror(tcp) || tcp->u_rval == 0 || !verbose(tcp))
1218 tprintf("%#lx", tcp->u_arg[1]);
1220 printdir(tcp, tcp->u_arg[1]);
1221 /* Not much point in printing this out, it is always 1. */
1222 if (tcp->u_arg[2] != 1)
1223 tprintf(", %lu", tcp->u_arg[2]);
1234 int i, len, dents = 0;
1237 if (entering(tcp)) {
1238 tprintf("%lu, ", tcp->u_arg[0]);
1241 if (syserror(tcp) || !verbose(tcp)) {
1242 tprintf("%#lx, %lu", tcp->u_arg[1], tcp->u_arg[2]);
1246 if ((buf = malloc(len)) == NULL) {
1247 tprintf("out of memory\n");
1250 if (umoven(tcp, tcp->u_arg[1], len, buf) < 0) {
1251 tprintf("{...}, %lu", tcp->u_arg[2]);
1257 for (i = 0; i < len;) {
1258 struct kernel_dirent *d = (struct kernel_dirent *) &buf[i];
1261 tprintf("%s{d_ino=%lu, d_off=%lu, ",
1262 i ? " " : "", d->d_ino, d->d_off);
1263 tprintf("d_reclen=%u, d_name=\"%s\"}",
1264 d->d_reclen, d->d_name);
1269 tprintf("%s{d_ino=%lu, d_off=%lu, ",
1270 i ? " " : "", d->d_ino, d->d_off);
1271 tprintf("d_reclen=%u, d_name=\"%s\"}",
1272 d->d_reclen, d->d_name);
1277 tprintf("%s{d_off=%lu, d_fileno=%lu, d_reclen=%u, ",
1278 i ? " " : "", d->d_off, d->d_fileno,
1280 tprintf("d_namlen=%u, d_name=\"%.*s\"}",
1281 d->d_namlen, d->d_namlen, d->d_name);
1290 tprintf("/* %u entries */", dents);
1291 tprintf(", %lu", tcp->u_arg[2]);
1304 tprintf("%#lx", tcp->u_arg[0]);
1306 printpathn(tcp, tcp->u_arg[0], tcp->u_rval - 1);
1307 tprintf(", %lu", tcp->u_arg[1]);
1313 #ifdef HAVE_SYS_ASYNCH_H
1319 struct aio_result_t res;
1321 if (entering(tcp)) {
1322 tprintf("%lu, ", tcp->u_arg[0]);
1325 tprintf("%#lx", tcp->u_arg[1]);
1327 printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
1328 tprintf(", %lu, %lu, ", tcp->u_arg[2], tcp->u_arg[3]);
1329 printxval(whence, tcp->u_arg[4], "L_???");
1330 if (syserror(tcp) || tcp->u_arg[5] == 0
1331 || umove(tcp, tcp->u_arg[5], &res) < 0)
1332 tprintf(", %#lx", tcp->u_arg[5]);
1334 tprintf(", {aio_return %d aio_errno %d}",
1335 res.aio_return, res.aio_errno);
1344 struct aio_result_t res;
1346 if (entering(tcp)) {
1347 tprintf("%lu, ", tcp->u_arg[0]);
1348 printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
1349 tprintf(", %lu, %lu, ", tcp->u_arg[2], tcp->u_arg[3]);
1350 printxval(whence, tcp->u_arg[4], "L_???");
1353 if (tcp->u_arg[5] == 0)
1355 else if (syserror(tcp)
1356 || umove(tcp, tcp->u_arg[5], &res) < 0)
1357 tprintf(", %#lx", tcp->u_arg[5]);
1359 tprintf(", {aio_return %d aio_errno %d}",
1360 res.aio_return, res.aio_errno);
1370 printtv(tcp, tcp->u_arg[0]);
1378 struct aio_result_t res;
1381 if (tcp->u_arg[0] == 0)
1383 else if (syserror(tcp)
1384 || umove(tcp, tcp->u_arg[0], &res) < 0)
1385 tprintf("%#lx", tcp->u_arg[0]);
1387 tprintf("{aio_return %d aio_errno %d}",
1388 res.aio_return, res.aio_errno);
1393 #endif /* HAVE_SYS_ASYNCH_H */