On 16 August 2012 14:11, Corey Bryant <[email protected]> wrote: > > > On 08/16/2012 07:15 AM, Peter Maydell wrote: >> >> Fix compilation failure on BSD systems (which don't have >> O_DIRECT or O_NOATIME: >> osdep.c:116: error: ‘O_DIRECT’ undeclared (first use in this function) >> osdep.c:116: error: (Each undeclared identifier is reported only once >> osdep.c:116: error: for each function it appears in.) >> osdep.c:116: error: ‘O_NOATIME’ undeclared (first use in this function) >> >> Signed-off-by: Peter Maydell <[email protected]> >> --- >> PS: Do we care about O_DSYNC, O_RSYNC, O_SYNC? POSIX says those can be >> used via fcntl() too... > > > Thanks very much Peter. The patch looks good to me. > > Could you point me to the reference you saw the fcntl description in? I > didn't notice any flags mentioned here: > http://pubs.opengroup.org/onlinepubs/009695399/functions/fcntl.html > > The choice of flags was based on the Linux man page for fcntl() which says > F_SETFL can change only the O_APPEND, O_ASYNC, O_DIRECT, O_NOATIME, and > O_NONBLOCK flags.
The posix spec for fcntl.h http://pubs.opengroup.org/onlinepubs/007908799/xsh/fcntl.h.html describes all of O_APPEND O_DSYNC O_NONBLOCK O_RSYNC O_SYNC as "File status flags used for open() and fcntl()". (However the MacOS fcntl manpage lists only O_APPEND, O_ASYNC and O_NONBLOCK for F_GETFL/F_SETFL flags.) -- PMM
