diff options
author | Michael I. Bushnell <mib@gnu.org> | 1994-02-17 22:27:03 +0000 |
---|---|---|
committer | Michael I. Bushnell <mib@gnu.org> | 1994-02-17 22:27:03 +0000 |
commit | 57ba1724bc0d47a29b10a4f458d2f70720348c39 (patch) | |
tree | 66deb3c06ac17265756374813dcff09dc5a17228 /libtrivfs | |
parent | d0c07b278beb17745fef3410993a95b08bd8deb9 (diff) |
Formerly file-lock.c.~2~
Diffstat (limited to 'libtrivfs')
-rw-r--r-- | libtrivfs/file-lock.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libtrivfs/file-lock.c b/libtrivfs/file-lock.c index 70e65c7e..6829c47c 100644 --- a/libtrivfs/file-lock.c +++ b/libtrivfs/file-lock.c @@ -26,6 +26,9 @@ trivfs_S_file_lock (struct protid *cred, int flags) { error_t err; + if (!cred) + return EOPNOTSUPP; + mutex_lock (&lock); if (!inited) { @@ -37,3 +40,16 @@ trivfs_S_file_lock (struct protid *cred, int flags) return err; } +error_t +trivfs_S_file_lock_stat (struct protid *cred, int *mystatus, int *otherstat) +{ + if (!cred) + return EOPNOTSUPP; + + mutex_lock (&lock); + *mystatus = cred->po->lock_status; + *otherstat = lockbox.type; + mutex_unlock (&lock); + return 0; +} + |