diff -X excludes -ruN lsof_4.86_src/dialects/linux/dnode.c _lsof_4.86_src/dialects/linux/dnode.c --- lsof_4.86_src/dialects/linux/dnode.c 2012-04-11 01:40:00.000000000 +0900 +++ _lsof_4.86_src/dialects/linux/dnode.c 2012-06-04 13:19:05.290490391 +0900 @@ -401,6 +401,10 @@ /* Lf->ntype = Ntype = N_REGLR; by alloc_lfile() */ process_proc_sock(p, s, ss, l, ls); return; + case 0: + if (!strcmp(p, "anon_inode")) + Lf->ntype = Ntype = N_ANON_INODE; + break; } } if (Selinet) @@ -503,9 +507,13 @@ tn = "VTXT"; break; default: - (void) snpf(Lf->type, sizeof(Lf->type), "%04o", - ((type >> 12) & 0xf)); - tn = (char *)NULL; + if (Ntype == N_ANON_INODE) { + tn = "a_inode"; + } else { + (void) snpf(Lf->type, sizeof(Lf->type), "%04o", + ((type >> 12) & 0xf)); + tn = (char *)NULL; + } } } else tn = "unknown"; diff -X excludes -ruN lsof_4.86_src/dialects/linux/dproc.c _lsof_4.86_src/dialects/linux/dproc.c --- lsof_4.86_src/dialects/linux/dproc.c 2012-04-11 01:40:01.000000000 +0900 +++ _lsof_4.86_src/dialects/linux/dproc.c 2012-06-04 13:29:44.684989913 +0900 @@ -81,7 +81,7 @@ */ _PROTOTYPE(static int get_fdinfo,(char *p, struct l_fdinfo *fi)); -_PROTOTYPE(static int getlinksrc,(char *ln, char *src, int srcl)); +_PROTOTYPE(static int getlinksrc,(char *ln, char *src, int srcl, char** rest)); _PROTOTYPE(static int isefsys,(char *path, char *type, int l, efsys_list_t **rep, struct lfile **lfr)); _PROTOTYPE(static int nm2id,(char *nm, int *id, int *idl)); @@ -440,14 +440,18 @@ static int -getlinksrc(ln, src, srcl) +getlinksrc(ln, src, srcl, rest) char *ln; /* link path */ char *src; /* link source path return address */ int srcl; /* length of src[] */ + char **rest; /* string after `:' of link source path */ { char *cp; int ll; + if (rest) + *rest = NULL; + if ((ll = readlink(ln, src, srcl - 1)) < 1 || ll >= srcl) return(-1); @@ -457,6 +461,8 @@ if ((cp = strchr(src, ':'))) { *cp = '\0'; ll = strlen(src); + if (rest) + *rest = cp + 1; } return(ll); } @@ -795,6 +801,7 @@ static char *pathi = (char *)NULL; static int pathil = 0; int txts = 0; + char* rest; #if defined(HASSELINUX) cntxlist_t *cntxp; @@ -825,7 +832,7 @@ (void) make_proc_path(idp, idpl, &path, &pathl, "cwd"); alloc_lfile(CWD, -1); efs = 0; - if (getlinksrc(path, pbuf, sizeof(pbuf)) < 1) { + if (getlinksrc(path, pbuf, sizeof(pbuf), NULL) < 1) { if (!Fwarn) { (void) memset((void *)&sb, 0, sizeof(sb)); lnk = ss = 0; @@ -873,7 +880,7 @@ if (!Ckscko) { (void) make_proc_path(idp, idpl, &path, &pathl, "root"); alloc_lfile(RTD, -1); - if (getlinksrc(path, pbuf, sizeof(pbuf)) < 1) { + if (getlinksrc(path, pbuf, sizeof(pbuf), NULL) < 1) { if (!Fwarn) { (void) memset((void *)&sb, 0, sizeof(sb)); lnk = ss = 0; @@ -921,7 +928,7 @@ txts = 0; (void) make_proc_path(idp, idpl, &path, &pathl, "exe"); alloc_lfile("txt", -1); - if (getlinksrc(path, pbuf, sizeof(pbuf)) < 1) { + if (getlinksrc(path, pbuf, sizeof(pbuf), NULL) < 1) { (void) memset((void *)&sb, 0, sizeof(sb)); lnk = ss = 0; if (!Fwarn) { @@ -1044,7 +1051,7 @@ continue; (void) make_proc_path(dpath, i, &path, &pathl, fp->d_name); (void) alloc_lfile((char *)NULL, fd); - if (getlinksrc(path, pbuf, sizeof(pbuf)) < 1) { + if (getlinksrc(path, pbuf, sizeof(pbuf), &rest) < 1) { (void) memset((void *)&sb, 0, sizeof(sb)); lnk = ss = 0; if (!Fwarn) { @@ -1137,6 +1144,8 @@ } if (pn) { process_proc_node(lnk ? pbuf : path, &sb, ss, &lsb, ls); + if (Lf->ntype == N_ANON_INODE) + enter_nm(rest); if (Lf->sf) link_lfile(); } diff -X excludes -ruN lsof_4.86_src/lsof.h _lsof_4.86_src/lsof.h --- lsof_4.86_src/lsof.h 2011-09-08 04:14:10.000000000 +0900 +++ _lsof_4.86_src/lsof.h 2012-06-04 13:27:40.190724414 +0900 @@ -349,6 +349,7 @@ #define N_VXFS 51 /* Veritas file system node */ #define N_XFS 52 /* XFS node */ #define N_ZFS 53 /* ZFS node */ +#define N_ANON_INODE 54 /* inode on linux anon_inodefs */ # if !defined(OFFDECDIG) #define OFFDECDIG 8 /* maximum number of digits in the