[comp.unix.ultrix] Bug? in open

kent@tifsim.pac.ti.com (Russell Kent) (10/01/90)

In dealing with open() with the O_CREAT flag, I've come across a behavior
that I think is a bug.  The scenario:

    1. The process has already open()-ed OPEN_MAX files.
    2. The process tries to open another file with O_CREAT and O_EXCL
    3. Open returns EMFILE, but the file has been created.
    4. The process selects another file to close to make room.
    5. The process retries the open()
    6. Open returns EEXIST.

I believe that Ultrix should check for an available fd before creating
the file.  I don't have the POSIX guide handy (and I don't know if it
specifies how to deal with this anyway).

What does the POSIX guide say?
What does this do on other machines?
What is your opinion on how this should behave?

[The .ti.com mail gateway has been acting flakey.  If you mail to me and I
 don't respond, please post comp.unix.ultrix or call me directly.]

Russell Kent
-- 
Texas Instruments                   
PO Box 655012  M/S 3635             
Dallas, TX 75265                    TI-MSG: RAK9
Voice: (214) 917-2285               FAX: (214) 917-5112