From: Alexander Clouter <alex@digriz.org.uk>
To: linux-kernel@vger.kernel.org
Subject: Re: [PATCH]exit.c: support larger exit code
Date: Mon, 9 Aug 2010 09:25:49 +0100 [thread overview]
Message-ID: <dlq4j7-0tp.ln1@chipmunk.wormnet.eu> (raw)
In-Reply-To: 14414B36FFA0F1418CB707361EAA199A0194FB16@CNBEEXC006.nsn-intra.net
"Zhang, Wei-Jovi (NSN - CN/Hangzhou)" <wei-jovi.zhang@nsn.com> wrote:
>
> I think this is just a convention of userspace program. if program
> want to obey this convention, it should be use one-byte limition exit
> code, I agree this. so this mail thread's subject should change to "if
> program use exit code with not want to obey the convention, kernel
> should return which value?"
>
I do have to agree with you on this point, although I stand by my
thoughts on *how* you should be using the exit code. Whilst writing my
post I was thinking why in C is it 'int main()' and not 'u8 main()'.
A dig around with my Googlefu and on Wackipedia gave me nothing
either...
One thing I can think of why the kernel is forcing a one byte return
code is that:
* guarantee there is no endian issue; hard to pull off though but I
guess that exit code could travel across IP to another
architecture
* stop people abusing the exitcode :)
There is probably a deeper reason as errno.h/errno-base.h all seem to be
one byte return codes too. I'm starting to ponder if that top three
bytes are meant to carry some other information?
Cheers
--
Alexander Clouter
.sigmonster says: Make sure your code does nothing gracefully.
next prev parent reply other threads:[~2010-08-09 9:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-09 3:14 [PATCH]exit.c: support larger exit code Zhang, Wei-Jovi (NSN - CN/Hangzhou)
2010-08-09 8:25 ` Alexander Clouter [this message]
2010-08-09 10:57 ` Alan Cox
[not found] <14414B36FFA0F1418CB707361EAA199A0194F7D2@CNBEEXC006.nsn-intra.net>
2010-08-06 12:44 ` Oleg Nesterov
2010-08-07 10:41 ` Alexander Clouter
2010-08-25 21:49 ` Andrew Morton
2010-08-25 22:23 ` Tony Luck
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=dlq4j7-0tp.ln1@chipmunk.wormnet.eu \
--to=alex@digriz.org.uk \
--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