[LIP] problem with fcntl while locking file on NFS
Gaurav Varshney <gkvarshney-/[email protected]>
| Newsgroups | gmane.user-groups.linux.india.programmers |
|---|---|
| Message-ID | <[email protected]> |
Hello,
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);
while (1)
{
unless (fcntl($fh, F_SETLKW, $buf))
{
next if ($! =~ /^Interrupted/);
$msg = "Could not lock file $!";
$err++;
last;
}
else
{
$msg = "File locked";
last;
}
}
thanks and regards,
Gaurav
Cheers,
Gaurav Varshney
__________________________________
Yahoo! Mail Mobile
Take Yahoo! Mail with you! Check email on your mobile phone.
http://mobile.yahoo.com/learn/mail
-------------------------------------------------------
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