Messages in this thread | | | Date | Thu, 8 May 2003 14:54:12 +1000 | From | Glenn McGrath <> | Subject | [patch] set argv[0] of init process to filename |
| |
In init/main.c the kernel always sets argv[0] = "init" when calling the init process.
The file being executed as init is commonly /sbin/init, but could be anything, as set from init= boot paramater.
Always setting argv[0] = "init" is inconsistent with standard behaviour of setting it to the filename that was run.
This current behaviour is inconvenient for busybox (www.busybox.net) as it uses argv[0] to determine functionality.
The attached patch against 2.4.20 sets argv[0] to the filename being run as the init process, it results in marginally smaller binary (12 bytes).
Is there a reason why argv[0] should always be set to "init" ?
Glenn [unhandled content-type:application/octet-stream][unhandled content-type:application/pgp-signature]
| |