fstat.c (739e31f6d7f6d023d4cd47a4a4d5d35a2a19ce5f) fstat.c (9f365aa1d6aab0aca269b54fb5d216ac0e31a06f)
1/*-
2 * Copyright (c) 2009 Stanislav Sedov <stas@FreeBSD.org>
3 * Copyright (c) 1988, 1993
4 * The Regents of the University of California. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 397 unchanged lines hidden (view full) ---

406
407 error = procstat_get_pts_info(procstat, fst, &pts, errbuf);
408 if (error != 0) {
409 printf("* error");
410 return;
411 }
412 printf("* pseudo-terminal master ");
413 if (nflg || !*pts.devname) {
1/*-
2 * Copyright (c) 2009 Stanislav Sedov <stas@FreeBSD.org>
3 * Copyright (c) 1988, 1993
4 * The Regents of the University of California. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 397 unchanged lines hidden (view full) ---

406
407 error = procstat_get_pts_info(procstat, fst, &pts, errbuf);
408 if (error != 0) {
409 printf("* error");
410 return;
411 }
412 printf("* pseudo-terminal master ");
413 if (nflg || !*pts.devname) {
414 printf("%10d,%-2d", major(pts.dev), minor(pts.dev));
414 printf("%#10jx", (uintmax_t)pts.dev);
415 } else {
416 printf("%10s", pts.devname);
417 }
418 print_access_flags(fst->fs_fflags);
419}
420
421static void
422print_vnode_info(struct procstat *procstat, struct filestat *fst)

--- 13 unchanged lines hidden (view full) ---

436 else if (vn.vn_type == PS_FST_VTYPE_VNON)
437 badtype = "none";
438 if (badtype != NULL) {
439 printf(" - - %10s -", badtype);
440 return;
441 }
442
443 if (nflg)
415 } else {
416 printf("%10s", pts.devname);
417 }
418 print_access_flags(fst->fs_fflags);
419}
420
421static void
422print_vnode_info(struct procstat *procstat, struct filestat *fst)

--- 13 unchanged lines hidden (view full) ---

436 else if (vn.vn_type == PS_FST_VTYPE_VNON)
437 badtype = "none";
438 if (badtype != NULL) {
439 printf(" - - %10s -", badtype);
440 return;
441 }
442
443 if (nflg)
444 printf(" %2d,%-2d", major(vn.vn_fsid), minor(vn.vn_fsid));
444 printf(" %#8jx", (uintmax_t)vn.vn_fsid);
445 else if (vn.vn_mntdir != NULL)
446 (void)printf(" %-8s", vn.vn_mntdir);
447
448 /*
449 * Print access mode.
450 */
451 if (nflg)
452 (void)snprintf(mode, sizeof(mode), "%o", vn.vn_mode);
453 else {
454 strmode(vn.vn_mode, mode);
455 }
456 (void)printf(" %6jd %10s", (intmax_t)vn.vn_fileid, mode);
457
458 if (vn.vn_type == PS_FST_VTYPE_VBLK || vn.vn_type == PS_FST_VTYPE_VCHR) {
459 if (nflg || !*vn.vn_devname)
445 else if (vn.vn_mntdir != NULL)
446 (void)printf(" %-8s", vn.vn_mntdir);
447
448 /*
449 * Print access mode.
450 */
451 if (nflg)
452 (void)snprintf(mode, sizeof(mode), "%o", vn.vn_mode);
453 else {
454 strmode(vn.vn_mode, mode);
455 }
456 (void)printf(" %6jd %10s", (intmax_t)vn.vn_fileid, mode);
457
458 if (vn.vn_type == PS_FST_VTYPE_VBLK || vn.vn_type == PS_FST_VTYPE_VCHR) {
459 if (nflg || !*vn.vn_devname)
460 printf(" %2d,%-2d", major(vn.vn_dev), minor(vn.vn_dev));
460 printf(" %#6jx", (uintmax_t)vn.vn_dev);
461 else {
462 printf(" %6s", vn.vn_devname);
463 }
464 } else
465 printf(" %6ju", (uintmax_t)vn.vn_size);
466 print_access_flags(fst->fs_fflags);
467}
468

--- 41 unchanged lines hidden ---
461 else {
462 printf(" %6s", vn.vn_devname);
463 }
464 } else
465 printf(" %6ju", (uintmax_t)vn.vn_size);
466 print_access_flags(fst->fs_fflags);
467}
468

--- 41 unchanged lines hidden ---