dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / usr / src / test / os-tests / tests / file-locking / util.h
blobb6d2b57d8a333443e5382f2f1da46f5b1e7d8c97
1 /*
2 * This file and its contents are supplied under the terms of the
3 * Common Development and Distribution License ("CDDL"), version 1.0.
4 * You may only use this file in accordance with the terms of version
5 * 1.0 of the CDDL.
7 * A full copy of the text of the CDDL should have accompanied this
8 * source. A copy of the CDDL is also available via the Internet at
9 * http://www.illumos.org/license/CDDL.
13 * Copyright 2016 Joyent, Inc.
16 #ifndef FLOCK_TEST_UTIL_H
17 #define FLOCK_TEST_UTIL_H
19 #include <fcntl.h>
20 #include <sys/types.h>
22 #define BAD_ARGS_MESSAGE "Expected to receive 3 arguments, but found %d."
23 #define BAD_MODE_MESSAGE "Lock mode must be one of " \
24 "\"shared\" or \"exclusive\""
25 #define BAD_LOCK_MESSAGE "Lock style must be one of " \
26 "\"posix\", \"ofd\", or \"exclusive\""
28 typedef enum lock_style {
29 LSTYLE_POSIX,
30 LSTYLE_OFD,
31 LSTYLE_FLOCK,
32 LSTYLE_LAST
33 } lock_style_t;
35 extern boolean_t LOG;
37 extern boolean_t flock_nodata(int);
39 extern void flock_block(int);
40 extern void flock_alert(int);
41 extern void flock_log(const char *, ...);
42 extern void flock_reinit(struct flock *, int);
44 extern char *flock_cmdname(int);
45 extern char *flock_stylename(lock_style_t);
46 extern char *flock_stylestr(lock_style_t);
47 extern lock_style_t flock_styleenum(char *);
49 #endif /* FLOCK_TEST_UTIL_H */