Matt Whitlock wrote:
On Tuesday, 25 March 2014, at 10:52 pm, Cristian Ionescu-Idbohrn wrote:
I find out that using that option:
-x hostname:foo
^
shows up in /proc/<pid>/cmdline as:
-x hostname foo
^
/proc/<pid>/cmdline reflects any changes that the process has made to its argv array.
It's common when parsing a command line for a program to replace delimiters with null
bytes. The /proc/<pid>/cmdline interface converts null bytes to spaces for ease of
display and parsing.
My guess is also that udhcpcd does something like
strchr(hostname, ':') = '\0';
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.
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox