aaron.m has asked for the wisdom of the Perl Monks concerning the following question:

At my code review, today, someone asked if sysopen() is re-entrant. I just did a google search but didn't find a definitive answer. I did read that sysopen() is just tied to the underlying OS's open() call, which would suggest the man page is the place to search, but is there anything that Perl would add on top of the actual system call that would alter its status as re-entrant? Thanks, guys...

Replies are listed 'Best First'.
Re: sysopen() re-entrant?
by ikegami (Patriarch) on Feb 23, 2010 at 05:00 UTC
    It should be. If a builtin isn't re-entrant, it's buggy.
Re: sysopen() re-entrant?
by locked_user sundialsvc4 (Abbot) on Feb 23, 2010 at 04:01 UTC

    I, for one, am quite confident that such a call would be re-entrant.

    But at the same time I am very reluctant to write any code that might actually depend on assumptions. If I'm planning to assign a file-handle to a common variable, then you can be sure-as-heck that I'm gonna protect that variable. It doesn't matter to me whether I intend to assign a file-handle to it or the integer "5." If it's a common (shared...) variable, or any other type of shared resource, then I'm gonna protect it. I don't give a hoot about “efficiency,” and I don't care about “what (coincidentally... happens to...) work(s).”