bbc551a821e46c1702bc15b098678dc5180e9a7a
[bpt/guile.git] / lib / sys_file.in.h
1 /* Provide a more complete sys/file.h.
2
3 Copyright (C) 2007-2012 Free Software Foundation, Inc.
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation; either version 2, or (at your option)
8 any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public License
16 along with this program; if not, write to the Free Software Foundation,
17 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
18
19 /* Written by Richard W.M. Jones. */
20
21 #ifndef _@GUARD_PREFIX@_SYS_FILE_H
22
23 #if __GNUC__ >= 3
24 @PRAGMA_SYSTEM_HEADER@
25 #endif
26 @PRAGMA_COLUMNS@
27
28 /* The include_next requires a split double-inclusion guard. */
29 #if @HAVE_SYS_FILE_H@
30 # @INCLUDE_NEXT@ @NEXT_SYS_FILE_H@
31 #endif
32
33 #ifndef _@GUARD_PREFIX@_SYS_FILE_H
34 #define _@GUARD_PREFIX@_SYS_FILE_H
35
36 #ifndef LOCK_SH
37 /* Operations for the 'flock' call (same as Linux kernel constants). */
38 # define LOCK_SH 1 /* Shared lock. */
39 # define LOCK_EX 2 /* Exclusive lock. */
40 # define LOCK_UN 8 /* Unlock. */
41
42 /* Can be OR'd in to one of the above. */
43 # define LOCK_NB 4 /* Don't block when locking. */
44 #endif
45
46 /* The definition of _GL_WARN_ON_USE is copied here. */
47
48 #if @GNULIB_FLOCK@
49 /* Apply or remove advisory locks on an open file.
50 Return 0 if successful, otherwise -1 and errno set. */
51 # if !@HAVE_FLOCK@
52 extern int flock (int fd, int operation);
53 # endif
54 #elif defined GNULIB_POSIXCHECK
55 # undef flock
56 # if HAVE_RAW_DECL_FLOCK
57 _GL_WARN_ON_USE (flock, "flock is unportable - "
58 "use gnulib module flock for portability");
59 # endif
60 #endif
61
62
63 #endif /* _@GUARD_PREFIX@_SYS_FILE_H */
64 #endif /* _@GUARD_PREFIX@_SYS_FILE_H */