Use FreeBSD-specific invocation of /bin/ps
This commit is contained in:
committed by
Jon Trulson
parent
724671a2ad
commit
c3cd844df6
@@ -36,8 +36,10 @@
|
|||||||
pexec=$(LC_TIME=C ps -p $PPID | awk 'NR==2 {print $5}')
|
pexec=$(LC_TIME=C ps -p $PPID | awk 'NR==2 {print $5}')
|
||||||
#elif defined(USL) && (OSMAJORVERSION > 1)
|
#elif defined(USL) && (OSMAJORVERSION > 1)
|
||||||
pexec=$(LC_TIME=C ps -p $PPID | awk 'NR==2 {print $6}')
|
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}')
|
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
|
#else
|
||||||
pexec=$(LC_TIME=C /usr/bin/ps -p $PPID | awk 'NR==2 {print $4}')
|
pexec=$(LC_TIME=C /usr/bin/ps -p $PPID | awk 'NR==2 {print $4}')
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -38,6 +38,8 @@ Process::Process()
|
|||||||
{
|
{
|
||||||
#ifdef aix
|
#ifdef aix
|
||||||
(void)Invoke("ps -e -F \"pid ppid uid command\"", &procs);
|
(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
|
#else
|
||||||
(void)Invoke("/bin/ps -el | awk '{printf(\"%s %s %s %s\\n\",$4,$5,$3,$NF)}'",
|
(void)Invoke("/bin/ps -el | awk '{printf(\"%s %s %s %s\\n\",$4,$5,$3,$NF)}'",
|
||||||
&procs);
|
&procs);
|
||||||
|
|||||||
Reference in New Issue
Block a user