Use FreeBSD-specific invocation of /bin/ps
This commit is contained in:
parent
724671a2ad
commit
c3cd844df6
|
|
@ -36,8 +36,10 @@
|
|||
pexec=$(LC_TIME=C ps -p $PPID | awk 'NR==2 {print $5}')
|
||||
#elif defined(USL) && (OSMAJORVERSION > 1)
|
||||
pexec=$(LC_TIME=C ps -p $PPID | awk 'NR==2 {print $6}')
|
||||
#elif defined(linux) || defined(CSRG_BASED)
|
||||
#elif defined(linux) || defined(CSRG_BASED) && !defined(__FreeBSD__)
|
||||
pexec=$(LC_TIME=C /bin/ps -p $PPID 2>/dev/null | awk 'NR==2 {print $4}')
|
||||
#elif defined(__FreeBSD__)
|
||||
pexec=$(LC_TIME=C /bin/ps -o comm= -p $PPID 2>/dev/null)
|
||||
#else
|
||||
pexec=$(LC_TIME=C /usr/bin/ps -p $PPID | awk 'NR==2 {print $4}')
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -38,6 +38,8 @@ Process::Process()
|
|||
{
|
||||
#ifdef aix
|
||||
(void)Invoke("ps -e -F \"pid ppid uid command\"", &procs);
|
||||
#elif defined(__FreeBSD__)
|
||||
(void)Invoke("/bin/ps ax -o pid,ppid,uid,comm", &procs);
|
||||
#else
|
||||
(void)Invoke("/bin/ps -el | awk '{printf(\"%s %s %s %s\\n\",$4,$5,$3,$NF)}'",
|
||||
&procs);
|
||||
|
|
|
|||
Loading…
Reference in New Issue