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

OK, that rocks. (was Re: bug maintenance, last comment.



>Nathanael Nerode wrote:
>> My analysis was that it's unreasonable to ask a program
>> written in perl to use fcntl
>
>That's weird, there's
>
>a) POSIX::fcntl
>b) strace perl -e 'flock(1, "/etc/passwd")' 2>&1 |egrep '^flock|^fcntl'
>   fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0
>
>   perl has used fcntl internally for its flock builtin for some time

OK, so I hadn't figured that out.  That's a very good thing, because
it means that my proposed changes to use perl 'flock' correctly would in
actual fact fix the bug.

It's not documented in the perl documenation that it uses fcntl for the
flock builtin, and in fact it's (falsely) documented that it uses flock.

I quote from perlfunc (1):
" Calls flock(2), or an emulation of it, on FILEHANDLE."

I hadn't gone to the effort of strace-ing perl or searching through its
source code to check whether the documentation was wrong!

Perhaps I should file a bug against perl.  :-P

Oh, and POSIX::fcntl isn't documented anywhere I could find; although the
POSIX module is intermittently mentioned, I couldn't actually find any
documentation for it.

So thanks for informing me of these undocumented facts.  :-)  Anyway, that
means that my proposal was even better than I thought it was.  :-)



Reply to: