mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Glenn McGrath <bug1@optushome.com.au>
To: linux-kernel@vger.kernel.org
Subject: [patch] set argv[0] of init process to filename
Date: Thu, 8 May 2003 14:54:12 +1000	[thread overview]
Message-ID: <20030508145412.5d98ba5c.bug1@optushome.com.au> (raw)


[-- 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 --]

             reply	other threads:[~2003-05-08  4:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-08  4:54 Glenn McGrath [this message]
2003-05-08  8:22 ` DervishD

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030508145412.5d98ba5c.bug1@optushome.com.au \
    --to=bug1@optushome.com.au \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome