summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/sys/file.h
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2015-02-19 09:05:18 -0800
committerRobert Mustacchi <rm@joyent.com>2015-11-24 16:26:22 -0800
commit7a5aac98bc37534537d4896efd4efd30627d221e (patch)
tree952057632cf0d7aa29610276f7b1df251d564a43 /usr/src/uts/common/sys/file.h
parent8c6ffd5964f28b15919c0a4ad3d120f84cedbc3d (diff)
downloadillumos-joyent-7a5aac98bc37534537d4896efd4efd30627d221e.tar.gz
3252 Need a proper flock() implementation
Reviewed by: Robert Mustacchi <rm@joyent.com> Reviewed by: Gordon Ross <gordon.ross@nexenta.com> Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net> Reviewed by: Jason King <jason.brian.king@gmail.com> Approved by: Garrett D'Amore <garrett@damore.org>
Diffstat (limited to 'usr/src/uts/common/sys/file.h')
-rw-r--r--usr/src/uts/common/sys/file.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/usr/src/uts/common/sys/file.h b/usr/src/uts/common/sys/file.h
index 1f736d3d01..7e297042af 100644
--- a/usr/src/uts/common/sys/file.h
+++ b/usr/src/uts/common/sys/file.h
@@ -27,6 +27,7 @@
/* All Rights Reserved */
/* Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved. */
+/* Copyright 2015 Joyent, Inc. */
#ifndef _SYS_FILE_H
#define _SYS_FILE_H
@@ -54,7 +55,7 @@ extern "C" {
*/
/*
* One file structure is allocated for each open/creat/pipe call.
- * Main use is to hold the read/write pointer associated with
+ * Main use is to hold the read/write pointer (and OFD locks) associated with
* each open file.
*/
typedef struct file {
@@ -66,6 +67,7 @@ typedef struct file {
struct cred *f_cred; /* credentials of user who opened it */
struct f_audit_data *f_audit_data; /* file audit data */
int f_count; /* reference count */
+ struct filock *f_filock; /* ptr to single lock_descriptor_t */
} file_t;
/*
@@ -173,6 +175,19 @@ typedef struct fpollinfo {
#define L_SET 0 /* for lseek */
#endif /* L_SET */
+/*
+ * For flock(3C). These really don't belong here but for historical reasons
+ * the interface defines them to be here.
+ */
+#define LOCK_SH 1
+#define LOCK_EX 2
+#define LOCK_NB 4
+#define LOCK_UN 8
+
+#if !defined(_STRICT_SYMBOLS)
+extern int flock(int, int);
+#endif
+
#if defined(_KERNEL)
/*