Re: [LIP] problem with fcntl while locking file on NFS
| Newsgroups | gmane.user-groups.linux.india.programmers |
|---|---|
| Message-ID | <[email protected]> |
Gaurav Varshney posted in linux-india-programmers:
> I am using fcntl for locking the file on linux (flock
> doesn't work properly on NFS), and facing problem.
> Following code works most of the time but fails
> sometime with the error message "Invalid argument"
> (EINVAL). What could be the reason for this error
> message and how it can be handled ?
>
>
> $buf = pack("ssLL", F_WRLCK ,0,0,0);
Shouldn't that be "ssll"? man fcntl seems to think so.
I think file locking over NFS is dicey, whatever the locking method you
use. Is your NFS server Linux too? Are you dealing with big files (> 2GB)?
Binand
--
Hanlon's Razor: Never attribute to malice that which can be adequately
explained by stupidity.
Bruce's Razor: Never attribute to stupidity that which can be adequately
explained by Microsoft funding.
-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click