[ale] flock

cfowler cfowler at outpostsentinel.com
Mon Mar 26 08:45:11 EDT 2007


On Mon, 2007-03-26 at 08:35 -0400, cfowler wrote:
> Isn't flock advisory locking?  Maybe vipw uses it?  In order for it to
> work both programs must use flock.

vipw does not use flock

open("/etc/ptmptmp", O_WRONLY|O_CREAT|O_LARGEFILE, 0600) = 3
link("/etc/ptmptmp", "/etc/ptmp")       = 0
unlink("/etc/ptmptmp")                  = 0
open("/etc/passwd", O_RDONLY|O_LARGEFILE) = 4
read(4, "root:x:0:0:root:/root:/bin/bash\n"..., 8192) = 1414
write(3, "root:x:0:0:root:/root:/bin/bash\n"..., 1414) = 1414
read(4, "", 8192)                       = 0
close(4)                                = 0
close(3)                                = 0
stat64("/etc/ptmp", {st_mode=S_IFREG|0600, st_size=1414, ...}) = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|
SIGCHLD, child_tidptr=0xf70f5b08) = 4651

Instead it creates a temp file and if it exists that is the "lock".






More information about the Ale mailing list