diff options
author | Jerry Jelinek <jerry.jelinek@joyent.com> | 2015-02-18 19:52:21 +0000 |
---|---|---|
committer | Jerry Jelinek <jerry.jelinek@joyent.com> | 2015-02-18 19:52:21 +0000 |
commit | ade223c09cba5f3d8f633e5f451a8412ecd8917b (patch) | |
tree | f4076aaea4aaed50d3406b6a2168ac3079179dd8 /usr/src/uts/common/sys/file.h | |
parent | 3f8d3031925da0b8a20186fff1da8a615aaf4470 (diff) | |
download | illumos-joyent-ade223c09cba5f3d8f633e5f451a8412ecd8917b.tar.gz |
OS-2868 Need a proper flock() implementation
Diffstat (limited to 'usr/src/uts/common/sys/file.h')
-rw-r--r-- | usr/src/uts/common/sys/file.h | 17 |
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 03acc088c2..db38f08241 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; /* @@ -168,6 +170,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) /* |