public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] set argv[0] of init process to filename
@ 2003-05-08  4:54 Glenn McGrath
  2003-05-08  8:22 ` DervishD
  0 siblings, 1 reply; 2+ messages in thread
From: Glenn McGrath @ 2003-05-08  4:54 UTC (permalink / raw)
  To: linux-kernel


[-- Attachment #1.1: Type: text/plain, Size: 656 bytes --]


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 

[-- Attachment #1.2: init_argv.diff.gz --]
[-- Type: application/octet-stream, Size: 906 bytes --]

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-05-08  8:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-08  4:54 [patch] set argv[0] of init process to filename Glenn McGrath
2003-05-08  8:22 ` DervishD

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox