summaryrefslogtreecommitdiff
path: root/security/opencryptoki/files/patch-usr-lib-pkcs11-tpm_stdll-utility.c
blob: db9dc344854e49980f4552d17a36c4ee954ed2a7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
--- usr/lib/pkcs11/tpm_stdll/utility.c.orig	2010-07-29 21:28:41.000000000 +0900
+++ usr/lib/pkcs11/tpm_stdll/utility.c	2010-10-20 00:33:02.810983787 +0900
@@ -44,6 +44,27 @@
 #include "tok_spec_struct.h"
 #include "pkcs32.h"
 
+#include <fcntl.h>
+
+#ifdef __sun
+#define	LOCK_EX	F_LOCK
+#define	LOCK_UN	F_ULOCK
+#define	flock(fd, func)	lockf(fd, func, 0)
+#endif
+
+#ifndef	LOCK_SH
+#define	LOCK_SH	1	/* shared lock */
+#endif
+#ifndef	LOCK_EX
+#define	LOCK_EX	2	/* exclusive lock */
+#endif
+#ifndef	LOCK_NB
+#define	LOCK_NB	4	/* don't block when locking */
+#endif
+#ifndef	LOCK_UN
+#define	LOCK_UN	8	/* unlock */
+#endif
+
 #if (SPINXPL)
 #include <sys/file.h>
 #endif