kern: proc, dup: _procfdprint OCEXEC and ORCLOSE
In _procfdprint print additional informations in the second column: E is printed if the file was open with OCEXEC flag D is printed if the file was open with ORCLOSE flag Example output: 3 rE 9 46 (0000000000000001 0 00) 8192 13 /dev/cons
This commit is contained in:
parent
9f8050aa4a
commit
ba11888753
@ -558,15 +558,27 @@ procqidwidth(Chan *c)
|
|||||||
return jehanne_sprint(buf, "%lud", c->qid.vers);
|
return jehanne_sprint(buf, "%lud", c->qid.vers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
_procfdprint(Chan *c, int fd, int w, char *s, int ns, char * modestr)
|
_procfdprint(Chan *c, int fd, int w, char *s, int ns, char *modestr)
|
||||||
{
|
{
|
||||||
int n;
|
int n;
|
||||||
|
char *flags;
|
||||||
|
if((c->mode&(OCEXEC|ORCLOSE)) == (OCEXEC|ORCLOSE))
|
||||||
|
flags = "ED";
|
||||||
|
else if(c->mode&OCEXEC)
|
||||||
|
flags = "E ";
|
||||||
|
else if(c->mode&ORCLOSE)
|
||||||
|
flags = "D ";
|
||||||
|
else
|
||||||
|
flags = " ";
|
||||||
|
|
||||||
if(w == 0)
|
if(w == 0)
|
||||||
w = procqidwidth(c);
|
w = procqidwidth(c);
|
||||||
n = jehanne_snprint(s, ns, "%3d %.2s %C %4ud (%.16llux %*lud %.2ux) %5ld %8lld %s\n",
|
n = jehanne_snprint(s, ns, "%3d %.2s%s %C %4ud (%.16llux %*lud %.2ux) %5ld %8lld %s\n",
|
||||||
fd,
|
fd,
|
||||||
&modestr[(c->mode&3)<<1],
|
&modestr[(c->mode&3)<<1],
|
||||||
|
flags,
|
||||||
c->dev->dc, c->devno,
|
c->dev->dc, c->devno,
|
||||||
c->qid.path, w, c->qid.vers, c->qid.type,
|
c->qid.path, w, c->qid.vers, c->qid.type,
|
||||||
c->iounit, c->offset, c->path->s);
|
c->iounit, c->offset, c->path->s);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user