Re: On file locking - Mailing list pgsql-hackers

From Antti Haapala
Subject Re: On file locking
Date
Msg-id Pine.GSO.4.44.0302031225580.8837-100000@paju.oulu.fi
Whole thread Raw
In response to Re: On file locking  (Kevin Brown <kevin@sysexperts.com>)
List pgsql-hackers
> That same documentation mentions that locks acquired using flock()
> will *not* invoke the mandatory lock semantics even if on a file
> marked for it, so I guess flock() isn't implemented on top of fcntl()
> in Linux.

They're not. And there's another difference between fcntl and flock in
Linux: although fork(2) states that file locks are not inherited, locks
made by flock are inherited to children and they keep the lock even when
the parent process is killed with SIGKILL. Tested this.

Just see man syscall, there exists bothflock(2)
andfcntl(2)



-- 
Antti Haapala
+358 50 369 3535
ICQ: #177673735



pgsql-hackers by date:

Previous
From: Þórhallur Hálfdánarson
Date:
Subject: psql: Prompt change
Next
From: "Igor Georgiev"
Date:
Subject: Re: [mail] Re: Windows Build System