summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/gen/lockf.c2
-rw-r--r--lib/libc/sys/Symbol.map1
-rw-r--r--lib/libc/sys/fcntl.29
3 files changed, 9 insertions, 3 deletions
diff --git a/lib/libc/gen/lockf.c b/lib/libc/gen/lockf.c
index c448f18..e79e162 100644
--- a/lib/libc/gen/lockf.c
+++ b/lib/libc/gen/lockf.c
@@ -74,7 +74,7 @@ lockf(filedes, function, size)
fl.l_type = F_WRLCK;
if (_fcntl(filedes, F_GETLK, &fl) == -1)
return (-1);
- if (fl.l_type == F_UNLCK || fl.l_pid == getpid())
+ if (fl.l_type == F_UNLCK || (fl.l_sysid == 0 && fl.l_pid == getpid()))
return (0);
errno = EAGAIN;
return (-1);
diff --git a/lib/libc/sys/Symbol.map b/lib/libc/sys/Symbol.map
index 6c4eb40..5697403 100644
--- a/lib/libc/sys/Symbol.map
+++ b/lib/libc/sys/Symbol.map
@@ -960,4 +960,5 @@ FBSDprivate_1.0 {
_writev;
__sys_writev;
__error_unthreaded;
+ nlm_syscall;
};
diff --git a/lib/libc/sys/fcntl.2 b/lib/libc/sys/fcntl.2
index aef53e2..a16724c 100644
--- a/lib/libc/sys/fcntl.2
+++ b/lib/libc/sys/fcntl.2
@@ -189,6 +189,7 @@ struct flock {
pid_t l_pid; /* lock owner */
short l_type; /* lock type: read/write, etc. */
short l_whence; /* type of l_start */
+ int l_sysid; /* remote system id or zero for local */
};
.Ed
The commands available for advisory record locking are as follows:
@@ -276,9 +277,13 @@ is negative,
means end edge of the region.
The
.Fa l_pid
-field is only used with
+and
+.Fa l_sysid
+fields are only used with
.Dv F_GETLK
-to return the process ID of the process holding a blocking lock.
+to return the process ID of the process holding a blocking lock and
+the system ID of the system that owns that process.
+Locks created by the local system will have a system ID of zero.
After a successful
.Dv F_GETLK
request, the value of
OpenPOWER on IntegriCloud