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
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
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
{
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 */