/proc/<pid>/cmdline and udhcpcd

Bernd Petrovitsch bernd at petrovitsch.priv.at
Wed Mar 26 09:52:29 UTC 2014


On Mit, 2014-03-26 at 10:01 +0100, Ralf Friedl wrote:
[....]
> But the /proc/<pid>/cmdline interface doesn't convert null bytes to 
> spaces. Doing so would lose information. Some programs may choose to do 
> this conversion, but programs reading cmdline must be prepared for null 
> bytes anyway.
> 
> hex -g /proc/30883/cmdline
> 0000 2f 75 73 72 2f 73 62 69 6e 2f 61 63 70 69 64 00 /usr/sbin/acpid.
> 0010 2d 6e 00 2d 66 00                                 -n.-f.

Yup, the '\0' always separates the parameters ....

Kind regards,
	Bernd
-- 
Bernd Petrovitsch                  Email : bernd at petrovitsch.priv.at
                     LUGA : http://www.luga.at



More information about the busybox mailing list