NetBSD-Users archive

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

Re: procfs difference between NetBSD and Linux





On 2/06/21 5:49 am, Robert Elz wrote:
And while doing that, ask them what they're possibly trying to achieve
with the O_CREAT flag - if /proc/$$/fd/N doesn't exist, how is creating
(what would be a normal file, if procfs allowed it) going to possibly
do anything useful?   It is hard to believe that they're intending that
creating a file there will magically cause the fd to open (open to
what underlying object?)   If they know the fd is open (which they
seem to do here) then they know that /proc/$$/fd/N already exists, in
which case O_CREAT is useless (in the best of cases).

I think that is because after they set the path to /proc/self/fd/N they pass it back to their generic open routines to do the actual open.
see reopen_from_procfd() in source3/smbd/open.c

cheers
mark


Home | Main Index | Thread Index | Old Index