Mercurial > hg > octave-lojdl > gnulib-hg
annotate lib/sys_file.in.h @ 13055:c7be8484e434
maint: use pragma consistently across replacement headers
Several headers set #pragma GCC system_header prior to checking
any multiple inclusion guards; maintenance is easiest if all
replacement headers follow the same paradigm.
* lib/ctype.in.h (system_header): Hoist for consistent placement.
* lib/dirent.in.h (system_header): Likewise.
* lib/errno.in.h (system_header): Likewise.
* lib/float.in.h (system_header): Likewise.
* lib/getopt.in.h (system_header): Likewise.
* lib/iconv.in.h (system_header): Likewise.
* lib/inttypes.in.h (system_header): Likewise.
* lib/langinfo.in.h (system_header): Likewise.
* lib/locale.in.h (system_header): Likewise.
* lib/math.in.h (system_header): Likewise.
* lib/netdb.in.h (system_header): Likewise.
* lib/netinet_in.in.h (system_header): Likewise.
* lib/pty.in.h (system_header): Likewise.
* lib/sched.in.h (system_header): Likewise.
* lib/se-selinux.in.h (system_header): Likewise.
* lib/search.in.h (system_header): Likewise.
* lib/spawn.in.h (system_header): Likewise.
* lib/stdarg.in.h (system_header): Likewise.
* lib/stdint.in.h (system_header): Likewise.
* lib/string.in.h (system_header): Likewise.
* lib/strings.in.h (system_header): Likewise.
* lib/sys_file.in.h (system_header): Likewise.
* lib/sys_ioctl.in.h (system_header): Likewise.
* lib/sys_socket.in.h (system_header): Likewise.
* lib/sys_times.in.h (system_header): Likewise.
* lib/sys_utsname.in.h (system_header): Likewise.
* lib/sys_wait.in.h (system_header): Likewise.
* lib/sysexits.in.h (system_header): Likewise.
* lib/unistd.in.h (system_header): Likewise.
* lib/wctype.in.h (system_header): Likewise.
Signed-off-by: Eric Blake <eblake@redhat.com>
author | Eric Blake <eblake@redhat.com> |
---|---|
date | Thu, 25 Mar 2010 16:28:02 -0600 |
parents | 2c14f1e449e5 |
children | 2ed0fc659db8 |
rev | line source |
---|---|
10598 | 1 /* Provide a more complete sys/file.h. |
2 | |
12559
c2cbabec01dd
update nearly all FSF copyright year lists to include 2010
Jim Meyering <meyering@redhat.com>
parents:
12524
diff
changeset
|
3 Copyright (C) 2007-2010 Free Software Foundation, Inc. |
10598 | 4 |
5 This program is free software; you can redistribute it and/or modify | |
6 it under the terms of the GNU 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 General Public License for more details. | |
14 | |
15 You should have received a copy of the GNU 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 | |
10655
8668b19a7032
Avoid gcc warnings because of #pragma GCC system_header on older gcc.
Bruno Haible <bruno@clisp.org>
parents:
10598
diff
changeset
|
21 # if __GNUC__ >= 3 |
10598 | 22 @PRAGMA_SYSTEM_HEADER@ |
10655
8668b19a7032
Avoid gcc warnings because of #pragma GCC system_header on older gcc.
Bruno Haible <bruno@clisp.org>
parents:
10598
diff
changeset
|
23 # endif |
10598 | 24 |
13055
c7be8484e434
maint: use pragma consistently across replacement headers
Eric Blake <eblake@redhat.com>
parents:
12766
diff
changeset
|
25 #ifndef _GL_SYS_FILE_H |
c7be8484e434
maint: use pragma consistently across replacement headers
Eric Blake <eblake@redhat.com>
parents:
12766
diff
changeset
|
26 |
10598 | 27 /* The include_next requires a split double-inclusion guard. */ |
28 # if @HAVE_SYS_FILE_H@ | |
29 # @INCLUDE_NEXT@ @NEXT_SYS_FILE_H@ | |
30 # endif | |
31 | |
32 #ifndef _GL_SYS_FILE_H | |
33 #define _GL_SYS_FILE_H | |
34 | |
12522
9c72e4d90613
tests: test more substitute headers
Eric Blake <ebb9@byu.net>
parents:
12518
diff
changeset
|
35 #ifndef LOCK_SH |
9c72e4d90613
tests: test more substitute headers
Eric Blake <ebb9@byu.net>
parents:
12518
diff
changeset
|
36 /* Operations for the 'flock' call (same as Linux kernel constants). */ |
9c72e4d90613
tests: test more substitute headers
Eric Blake <ebb9@byu.net>
parents:
12518
diff
changeset
|
37 # define LOCK_SH 1 /* Shared lock. */ |
9c72e4d90613
tests: test more substitute headers
Eric Blake <ebb9@byu.net>
parents:
12518
diff
changeset
|
38 # define LOCK_EX 2 /* Exclusive lock. */ |
9c72e4d90613
tests: test more substitute headers
Eric Blake <ebb9@byu.net>
parents:
12518
diff
changeset
|
39 # define LOCK_UN 8 /* Unlock. */ |
9c72e4d90613
tests: test more substitute headers
Eric Blake <ebb9@byu.net>
parents:
12518
diff
changeset
|
40 |
9c72e4d90613
tests: test more substitute headers
Eric Blake <ebb9@byu.net>
parents:
12518
diff
changeset
|
41 /* Can be OR'd in to one of the above. */ |
9c72e4d90613
tests: test more substitute headers
Eric Blake <ebb9@byu.net>
parents:
12518
diff
changeset
|
42 # define LOCK_NB 4 /* Don't block when locking. */ |
9c72e4d90613
tests: test more substitute headers
Eric Blake <ebb9@byu.net>
parents:
12518
diff
changeset
|
43 #endif |
10598 | 44 |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
45 /* The definition of _GL_WARN_ON_USE is copied here. */ |
12524
8db404cb2e51
link-warning: make usage consistent
Eric Blake <ebb9@byu.net>
parents:
12522
diff
changeset
|
46 |
10598 | 47 #if @GNULIB_FLOCK@ |
48 /* Apply or remove advisory locks on an open file. | |
49 Return 0 if successful, otherwise -1 and errno set. */ | |
50 # if !@HAVE_FLOCK@ | |
51 extern int flock (int fd, int operation); | |
52 # endif | |
53 #elif defined GNULIB_POSIXCHECK | |
54 # undef flock | |
12766
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
55 # if HAVE_RAW_DECL_FLOCK |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
56 _GL_WARN_ON_USE (flock, "flock is unportable - " |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
57 "use gnulib module flock for portability"); |
2c14f1e449e5
warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents:
12559
diff
changeset
|
58 # endif |
10598 | 59 #endif |
60 | |
61 | |
62 #endif /* _GL_SYS_FILE_H */ | |
63 #endif /* _GL_SYS_FILE_H */ |