tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: fexecve, round 2



On Sun 18 Nov 2012 at 04:40:58 +0100, Emmanuel Dreyfus wrote:
> Thor Lancelot Simon <tls%panix.com@localhost> wrote:
> 
> > This appears to contradict either the description of O_EXEC in the
> > standard, or the standard's rationale for adding fexecve().  The
> > standard says O_EXEC causes the file to be open for execution "only".
> 
> The definition is really vague. As I understand, nothing forbids opening
> O_EXEC|O_RDWR.

Unortunately, it does, in
http://pubs.opengroup.org/onlinepubs/9699919799/functions/open.html:

    Applications shall specify exactly one of the first five values (file 
access modes) below in the value of oflag:

    O_EXEC
        Open for execute only (non-directory files). The result is unspecified 
if this flag is applied to a directory.
    O_RDONLY
        Open for reading only.
    O_RDWR
        Open for reading and writing. The result is undefined if this flag is 
applied to a FIFO.
    O_SEARCH
        Open directory for search only. The result is unspecified if this flag 
is applied to a non-directory file.
    O_WRONLY
        Open for writing only. 

(That document specifies waaaaay too many O_* flags, imho. In particular
O_TTY_INIT seems a far too specific use-case to need such a general
mechanism.)

-Olaf.
-- 
___ Olaf 'Rhialto' Seibert  -- There's no point being grown-up if you 
\X/ rhialto/at/xs4all.nl    -- can't be childish sometimes. -The 4th Doctor


Home | Main Index | Thread Index | Old Index