getcwd() and friends.

Kenneth Almquist ka at june.cs.washington.edu
Wed Apr 19 09:51:49 AEST 1989


jfc at athena.mit.edu (John F Carr) writes:
] In article <FLEE.89Apr16010720 at shire.cs.psu.edu> 
]  flee at shire.cs.psu.edu (Felix Lee) writes:
]
]> 2. The open may block.  Kenneth Almquist suggests O_NDELAY, which is
]> fine.  Another alternative is to say that O_TOKEN doesn't block;
]> blocking is only useful if you open for reading or writing.
]
] Suppose you are using NFS over a slow network?  The directory lookups
] may take time, as will the actual open.  The same problem exists with
] slow local media.  You can't guarantee proper error reporting without
] blocking.

The issue is not blocking temporarily while waiting for disk or network
I/O to take place.  The problem is that the open system call, rather than
succeeding or reporting an error, can simply block forever.  The O_NDELAY
flag prevents this under both System V and BSD.  If you run NFS (which is
not part of either System V or BSD UNIX at this point), then the O_NDELAY
flag won't help you.  My suggestion:  don't use NFS.
					Kenneth Almquist



More information about the Comp.unix.wizards mailing list