version 1.89, 2016/10/02 23:16:08 |
version 1.90, 2017/01/21 12:21:57 |
|
|
#include <sys/socketvar.h> |
#include <sys/socketvar.h> |
#include <sys/eventvar.h> |
#include <sys/eventvar.h> |
#include <sys/sysctl.h> |
#include <sys/sysctl.h> |
|
#include <sys/filedesc.h> |
#define _KERNEL /* for DTYPE_* */ |
#define _KERNEL /* for DTYPE_* */ |
#include <sys/file.h> |
#include <sys/file.h> |
#undef _KERNEL |
#undef _KERNEL |
|
|
{ |
{ |
if (nflg) |
if (nflg) |
printf("%s", |
printf("%s", |
"USER CMD PID FD DEV INUM MODE R/W SZ|DV"); |
"USER CMD PID FD DEV INUM MODE R/W SZ|DV"); |
else |
else |
printf("%s", |
printf("%s", |
"USER CMD PID FD MOUNT INUM MODE R/W SZ|DV"); |
"USER CMD PID FD MOUNT INUM MODE R/W SZ|DV"); |
if (oflg) |
if (oflg) |
printf("%s", ":OFFSET "); |
printf("%s", ":OFFSET "); |
if (checkfile && fsflg == 0) |
if (checkfile && fsflg == 0) |
|
|
vtrans(struct kinfo_file *kf) |
vtrans(struct kinfo_file *kf) |
{ |
{ |
const char *badtype = NULL; |
const char *badtype = NULL; |
char rw[3], mode[12]; |
char rwep[5], mode[12]; |
char *filename = NULL; |
char *filename = NULL; |
|
|
if (kf->v_type == VNON) |
if (kf->v_type == VNON) |
|
|
printf(" %8llu%s %11s", kf->va_fileid, |
printf(" %8llu%s %11s", kf->va_fileid, |
kf->va_nlink == 0 ? "*" : " ", |
kf->va_nlink == 0 ? "*" : " ", |
mode); |
mode); |
rw[0] = '\0'; |
rwep[0] = '\0'; |
if (kf->f_flag & FREAD) |
if (kf->f_flag & FREAD) |
strlcat(rw, "r", sizeof rw); |
strlcat(rwep, "r", sizeof rwep); |
if (kf->f_flag & FWRITE) |
if (kf->f_flag & FWRITE) |
strlcat(rw, "w", sizeof rw); |
strlcat(rwep, "w", sizeof rwep); |
printf(" %2s", rw); |
if (kf->fd_ofileflags & UF_EXCLOSE) |
|
strlcat(rwep, "e", sizeof rwep); |
|
printf(" %4s", rwep); |
switch (kf->v_type) { |
switch (kf->v_type) { |
case VBLK: |
case VBLK: |
case VCHR: { |
case VCHR: { |