This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

bug in /proc/*/cmdline


Hi

/proc/*/cmdline contains one extra <nul> which makes pgrep,pkill and ps misbehave

on cygwin
$ cat /proc/self/cmdline |od -c
0000000   c   a   t  \0   /   p   r   o   c   /   s   e   l   f   /   c
0000020   m   d   l   i   n   e  \0  \0
0000030
note the terminating <nul><nul>

on linux(trustix)
baf@xxx ~/procps$  cat /proc/self/cmdline |od -c
0000000   c   a   t  \0   /   p   r   o   c   /   s   e   l   f   /   c
0000020   m   d   l   i   n   e  \0
0000027

This diff makes
sleep 100&
pgrep -fx "sleep 100"
#fail
#but
pgrep -fx "sleep 100 "
#works

-- 
Bengt-Arne Fjellner




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]