[patch] set argv[0] of init process to filename

From: Glenn McGrath (bug1@optushome.com.au)
Date: Wed May 07 2003 - 23:54:12 EST


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





-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu May 15 2003 - 22:00:26 EST