Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Jun 2005 13:37:28 +0200 (CEST)
From:      Harti Brandt <hartmut.brandt@dlr.de>
To:        Wartan Hachaturow <wartan.hachaturow@gmail.com>
Cc:        freebsd-standards@freebsd.org, Garance A Drosihn <drosih@rpi.edu>
Subject:   Re: Change the executing of a 0-byte file to be an error...
Message-ID:  <20050610133505.U646@beagle.kn.op.dlr.de>
In-Reply-To: <4aaa2e1c0506100432117ea3b8@mail.gmail.com>
References:  <p06210260beced2897aba@128.113.24.47> <4aaa2e1c0506100432117ea3b8@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 10 Jun 2005, Wartan Hachaturow wrote:

WH>On 6/10/05, Garance A Drosihn <drosih@rpi.edu> wrote:
WH>
WH>> error?  I read through a few likely pages in SUSv3, and it looked
WH>> like the behavior for executing an 0-byte file is not explicitly
WH>> defined.  Of course, it might be that I was simply looking in the
WH>> wrong part of the standard.
WH>
WH>To quote SUSv3's Shell and Utilities:
WH>"If the execve() function fails due to an error equivalent to the
WH>[ENOEXEC] error  defined in the System Interfaces volume of IEEE Std
WH>1003.1-2001, the shell shall execute a command equivalent to having a
WH>shell invoked with the command name as its first operand, with any
WH>remaining arguments passed to the new shell. If the executable file is
WH>not a text file, the shell may bypass this command execution. In this
WH>case, it shall write an error message, and shall return an exit status
WH>of 126."
WH>
WH>So it is merely an empty script execution. The kernel reports a failure, as it
WH>should.

Well, according to Posix an empty file is not a text file ('A file that 
contains characters organized in one or more lines.'). The 'may' above 
allows both behaviours for this case.

harti



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050610133505.U646>