lockf and the SVID, (Was "Re: Wanted: lockf system call source")

Daniel R. Levy levy at ttrdc.UUCP
Wed Dec 3 15:50:31 AEST 1986


In article <1860 at utah-gr.UUCP>, thomas at utah-gr.UUCP writes:
>
>Why would you require a file open for write to set a write lock?
>Consider the following scenario:
>	fd = open( "/etc/passwd", 0 );	/* this is ok */
>	lock_for_write( fd );		/* Not so good, eh? */
>	sleep( 1000000000 );		/* Now try to change your password */

I guess not!

However, this kind of situation (one program shutting off another's access to
a file because the first program is reading it) can happen in the supposedly
modern operating system VMS.  This has some rather bizarre consequences.

I can see no harm from ADVISORY locks on a file open for read only, however.
-- 
 -------------------------------    Disclaimer:  The views contained herein are
|       dan levy | yvel nad      |  my own and are not at all those of my em-
|         an engihacker @        |  ployer or the administrator of any computer
| at&t computer systems division |  upon which I may hack.
|        skokie, illinois        |
 --------------------------------   Path: ..!{akgua,homxb,ihnp4,ltuxa,mvuxa,
	   go for it!  			allegra,ulysses,vax135}!ttrdc!levy



More information about the Comp.unix.wizards mailing list