lkml.org 
[lkml]   [2003]   [May]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
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]
\
 
 \ /
  Last update: 2005-03-22 13:35    [W:0.113 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site