O_EXCL flag on open of character tty device.

Guy Harris guy at auspex.UUCP
Wed Nov 9 04:19:08 AEST 1988


>	My understanding from the manuals is that the O_EXCL flag can
>be used to exclusively open a device.

That's not what its original intent was; it was an "exclusive create"
flag, not an "exclusive-use" open flag - it said that if

	1) O_CREAT was also set

and

	2) the file already existed

the "open" should fail, returning -1 and setting "errno" to EEXIST.

Some vendors may have made some of their device drivers interpret it as
an exclusive-use "open", but this is not guaranteed to work everywhere.



More information about the Comp.bugs.sys5 mailing list