# Re: \[PATCHv4 man-pages 3/3\] open.2: describe O\_BENEATH flag

- List: linux-api
- 1 message, 1 author
- Page: https://ratatoskr.run/linux-api/2015/08/98606/t

## Re: \[PATCHv4 man-pages 3/3\] open.2: describe O\_BENEATH flag

- From: David Drysdale \<hidden\>
- Date: 2015-08-14 15:30:37 
- Message: https://ratatoskr.run/linux-api/2015/08/98606.md

```text
On Fri, Aug 14, 2015 at 3:17 PM, Andy Lutomirski [ref] wrote:
> On Fri, Aug 14, 2015 at 2:29 AM, David Drysdale [ref] wrote:
>> On Fri, Aug 14, 2015 at 6:33 AM, Michael Kerrisk (man-pages)
>> [ref] wrote:
>>> On 13 August 2015 at 19:38, Andy Lutomirski [ref] wrote:
>>>> On Thu, Aug 13, 2015 at 2:32 AM, David Drysdale [ref] wrote:
>>>>> Signed-off-by: David Drysdale <redacted>
>>>>
>>>> What's the behavior wrt fcntl(F_GETFL, etc)?
>>>
>>> I would presume that O_BENEATH is one of the so-called "file creation
>>> flags". See this paragraph of the DESCRIPTION:
>>>
>>>        In addition, zero or more file creation  flags  and  file  status
>>>        flags  can be bitwise-or'd in flags.  The file creation flags are
>>>        O_CLOEXEC, O_CREAT, O_DIRECTORY,  O_EXCL,  O_NOCTTY,  O_NOFOLLOW,
>>>        O_TMPFILE,  O_TRUNC,  and  O_TTY_INIT.  The file status flags are
>>>        all of the remaining flags listed below.  The distinction between
>>>        these  two  groups  of flags is that the file status flags can be
>>>        retrieved and (in some cases) modified; see fcntl(2) for details.
>>>
>>> David, presuming this is correct (I can't see how O_BENEATH could be a
>>> "file *status* flag"), your patch should also add O_BENEATH to the
>>> list in that paragraph.
>>
>> Yeah, O_BENEATH makes sense as a file creation flag; I'll add it
>> to that list -- thanks for spotting.
>
> Should there be a test that you can't clear O_BENEATH with F_SETFL?
>
> --Andy

I'll add a test that fcntl(F_SETFL) silently ignores the file creation flags,
including O_BENEATH.
```
