[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RFC: [PATCH hurd 4/6] Add file record locking support: libnetfs_file_rec
From: |
Svante Signell |
Subject: |
RFC: [PATCH hurd 4/6] Add file record locking support: libnetfs_file_record_lock.patch |
Date: |
Mon, 08 Feb 2016 12:54:51 +0100 |
Note: Until all recent changes in libnetfs have settled: this patch relates to
the changes before Flavios patches starting with the refcount_t usage for
peropen references.
Implementation of libnetfs is added to the original patches.
Test cases: ftpfs and dh_gencontrol via fakeroot.
ftpfs (F_RDLCK):
settrans -c ftp: /hurd/hostmux /hurd/ftpfs /
cat ftp://ftp.gnu.org/README
./set-fcntl ftp://ftp.gnu.org/README O_READ F_SETLK F_RDLCK
<ok>
fakeroot (LOCK_EX/F_WRLCK):
dh_gencontrol -> dpkg-gencontrol -> /usr/share/perl5/Dpkg/File.pm
sub file_lock($$) {
if ($@) {
warning(g_('File::FcntlLock not available; using flock which is not NFS-
safe'));
flock($fh, LOCK_EX)
or syserr(g_('failed to get a write lock on %s'), $filename);
} else {
eval q{
my $fs = File::FcntlLock->new(l_type => F_WRLCK);
$fs->lock($fh, F_SETLKW)
or syserr(g_('failed to get a write lock on %s'), $filename);
}
}
libnetfs_file_record_lock.patch
Description: Text Data
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- RFC: [PATCH hurd 4/6] Add file record locking support: libnetfs_file_record_lock.patch,
Svante Signell <=