On Tue, 16 May 2006, Bernd Schmidt wrote:
>
> It's not the get_file that's the problem, it's the get_unused_fd and
> fd_install. These files are now open while the process lives and consume file
> descriptors.
Side note: this would be a valid argument, except it's not always true.
I'm not sure why Luke wanted the fd in the first place, though, and
whether we want it.
Some loaders may actually want the fd value, see for example themisc
loader and MISC_FMT_OPEN_BINARY, and the ELF loader _does_ actually do it
for the (interpreter_type == INTERPRETER_AOUT) case.
So it's certainly not a new concept, and other loaders do the exact same
thing.
Whether the flat loader should do it (or under what circumstances it
should do it), I just can't make any judgement. More information needed.
> Before the change, we didn't allocate or install a file descriptor, hence
> there wasn't any reason to return EMFILE. The spec at
> http://www.opengroup.org/onlinepubs/009695399/functions/exec.html
> doesn't list EMFILE as a possible error.
Totally irrelevant.
A lot of system calls will return errors other than the ones listed. The
text says "shall fail if", which just means that those errors are
_required_ to happen under the circumstances listed (and you can't use
other errors _for_those_particular_circumstances_).
See
http://www.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_03.html#tag_02_03
"Implementations may support additional errors not included in this
list, may generate errors included in this list under circumstances
other than those described here, or may contain extensions or
limitations that prevent some errors from occurring. The ERRORS section
on each reference page specifies whether an error shall be returned, or
whether it may be returned. Implementations shall not generate a
different error number from the ones described here for error
conditions described in this volume of IEEE Std 1003.1-2001, but may
generate additional errors unless explicitly disallowed for a
particular function."
for more.
Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]