From 38c77307c500a373ff96a80bbd0962282f51746f Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Wed, 25 Sep 2002 12:24:23 +0000 Subject: * fhandler_proc.cc (format_process_stat): make ctty a real device number. (format_process_status): use effective uid/gid as real and saved uid/gid. --- winsup/cygwin/fhandler_process.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'winsup/cygwin/fhandler_process.cc') diff --git a/winsup/cygwin/fhandler_process.cc b/winsup/cygwin/fhandler_process.cc index 755d639af..7cbfaa3cd 100644 --- a/winsup/cygwin/fhandler_process.cc +++ b/winsup/cygwin/fhandler_process.cc @@ -25,6 +25,7 @@ details. */ #include "ntdll.h" #include #include +#include #define _COMPILING_NEWLIB #include @@ -486,8 +487,8 @@ format_process_stat (_pinfo *p, char *destbuf, size_t maxsize) "%lu", p->pid, cmd, state, - p->ppid, p->pgid, p->sid, p->ctty, -1, - 0, fault_count, fault_count, 0, 0, utime, stime, + p->ppid, p->pgid, p->sid, makedev (FH_TTYS, p->ctty), + -1, 0, fault_count, fault_count, 0, 0, utime, stime, utime, stime, priority, 0, 0, 0, start_time, vmsize, vmrss, vmmaxrss @@ -556,6 +557,9 @@ format_process_status (_pinfo *p, char *destbuf, size_t maxsize) vmsize *= page_size; vmrss *= page_size; vmdata *= page_size; vmtext *= page_size; vmlib *= page_size; } + // The real uid value for *this* process is stored at cygheap->user.real_uid + // but we can't get at the real uid value for any other process, so + // just fake it as p->uid. Similar for p->gid. return __small_sprintf (destbuf, "Name: %s\n" "State: %c (%s)\n" "Tgid: %d\n" @@ -578,8 +582,8 @@ format_process_status (_pinfo *p, char *destbuf, size_t maxsize) p->pgid, p->pid, p->ppid, - p->uid, cygheap->user.real_uid, cygheap->user.real_uid, p->uid, - p->gid, cygheap->user.real_gid, cygheap->user.real_gid, p->gid, + p->uid, p->uid, p->uid, p->uid, + p->gid, p->gid, p->gid, p->gid, vmsize >> 10, 0, vmrss >> 10, vmdata >> 10, 0, vmtext >> 10, vmlib >> 10, 0, 0, p->getsigmask () ); -- cgit v1.2.3