present for Jim

This commit is contained in:
albert
2002-12-03 09:07:59 +00:00
parent 538f249009
commit 7ac9a0e1f5
8 changed files with 100 additions and 38 deletions

View File

@@ -144,15 +144,15 @@ static const char *parse_tty(char *str, sel_union *ret){
lookup("/dev/pty%s");
lookup("/dev/%snsole"); /* "co" means "console", maybe do all VCs too? */
if(!strcmp(str,"-")){ /* "-" means no tty (from AIX) */
ret->tty = -1; /* processes w/o tty */
ret->tty = 0; /* processes w/o tty */
return 0;
}
if(!strcmp(str,"?")){ /* "?" means no tty, which bash eats (Reno BSD?) */
ret->tty = -1; /* processes w/o tty */
ret->tty = 0; /* processes w/o tty */
return 0;
}
if(!*(str+1) && (stat(str,&sbuf)>=0)){ /* Kludge! Assume bash ate '?'. */
ret->tty = -1; /* processes w/o tty */
ret->tty = 0; /* processes w/o tty */
return 0;
}
#undef lookup

View File

@@ -239,6 +239,8 @@ D uninterruptible sleep (usually IO)
R runnable (on run queue)
S sleeping
T traced or stopped
W paging
X dead
Z a defunct ("zombie") process
For BSD formats and when the "stat" keyword is used, additional

View File

@@ -19,7 +19,7 @@
#define session_leader(p) ((p)->session == (p)->pid)
#define process_group_leader(p) ((p)->pgid == (p)->pid)
#define without_a_tty(p) ((unsigned short)((p)->tty) == (unsigned short)-1)
#define without_a_tty(p) ((unsigned short)((p)->tty) == (unsigned short)0)
#define some_other_user(p) ((p)->euid != cached_euid)
#define running(p) (((p)->state=='R')||((p)->state=='D'))
#define has_our_euid(p) ((unsigned short)((p)->euid) == (unsigned short)cached_euid)