From ade223c09cba5f3d8f633e5f451a8412ecd8917b Mon Sep 17 00:00:00 2001 From: Jerry Jelinek Date: Wed, 18 Feb 2015 19:52:21 +0000 Subject: OS-2868 Need a proper flock() implementation --- usr/src/uts/common/sys/file.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'usr/src/uts/common/sys/file.h') 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) /* -- cgit v1.2.3