unix without locking? cannot imagine ;-)
Here you go.

flock() - POSIX locking
fcntl(filedes, command, ...)
   - where command could be F_SETLK, etc (man fcntl)
flockfile() - threaded applns

HTH
Sai

> 
> Is there any lock function (in C) to lock files on a linux machine
> Does the kernel provide such system calls at all?
> This should prevent other processes from accessing the same file.
> 
> abhay
> 
> 

--
May you live all the days of your life. 
 
 --Jonathan Swift


--------------------------------------------------------------------------
LI is all for free speech, but this list was created for a purpose --
to help popularise Linux in India. If your messages are counterproductive
to that purpose, your privileges to submit messages can and will be revoked.

Reply via email to