On Mon, Mar 31, 2008 at 06:01:48PM +0200, Ivan Voras wrote: > Hi, > What is the purpose of O_EXEC ("open file for execution") flag to > open(2)? Just a hint to the VM system on how to cache the file pages or > is there something else that makes it different from O_RDONLY?
No, this is the only way to open file that has, for instance, mode 0111. You can get the filedescriptor pointing to this file, that is useful for the fexecve(2). Note that fexecve(2) ignores the open mode of the filedescriptor and checks the vnode access right for the exec.
pgpekVy5N9fwp.pgp
Description: PGP signature