strace/flock.h
Dmitry V. Levin 6250e6c5ed fcntl.c: use <linux/fcntl.h> instead of <fcntl.h>
Include <linux/fcntl.h> for proper definitions of F_* constants
and flock structures.

* configure.ac (AC_CHECK_TYPES): Check for struct flock, struct flock64,
struct __kernel_flock, and struct __kernel_flock64 in <linux/fcntl.h>.
* flock.h: New file.
* Makefile.am (strace_SOURCES): Add it.
* fcntl.c: Include it instead of <fcntl.h>.
(struct flock64): Remove.
(printflock): Use struct_kernel_flock instead of struct flock.
(printflock64): Use struct_kernel_flock64 instead of struct flock64.
2015-11-26 01:37:34 +00:00

18 lines
517 B
C

#include <linux/fcntl.h>
#if defined HAVE_STRUCT_FLOCK
typedef struct flock struct_kernel_flock;
#elif defined HAVE_STRUCT___KERNEL_FLOCK
typedef struct __kernel_flock struct_kernel_flock;
#else
# error struct flock definition not found in <linux/fcntl.h>
#endif
#if defined HAVE_STRUCT_FLOCK64
typedef struct flock64 struct_kernel_flock64;
#elif defined HAVE_STRUCT___KERNEL_FLOCK64
typedef struct __kernel_flock64 struct_kernel_flock64;
#else
# error struct flock64 definition not found in <linux/fcntl.h>
#endif