annotate lib/sys_file.in.h @ 16229:daac1ca4c436

inttypes: Modernize. * lib/inttypes.in.h (strtoimax, strtoumax): Use the C++ safe idioms. * modules/inttypes-incomplete (Depends-on): Add snippet/c++defs. (Makefile.am): Update inttypes.h rule.
author Bruno Haible <bruno@clisp.org>
date Thu, 05 Jan 2012 18:42:08 +0100
parents 8250f2777afc
children bb182ee4a09d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10598
6c19e205b6b8 flock: new module
Richard W.M. Jones <rjones@redhat.com>
parents:
diff changeset
1 /* Provide a more complete sys/file.h.
6c19e205b6b8 flock: new module
Richard W.M. Jones <rjones@redhat.com>
parents:
diff changeset
2
16201
8250f2777afc maint: update all copyright year number ranges
Jim Meyering <meyering@redhat.com>
parents: 14840
diff changeset
3 Copyright (C) 2007-2012 Free Software Foundation, Inc.
10598
6c19e205b6b8 flock: new module
Richard W.M. Jones <rjones@redhat.com>
parents:
diff changeset
4
6c19e205b6b8 flock: new module
Richard W.M. Jones <rjones@redhat.com>
parents:
diff changeset
5 This program is free software; you can redistribute it and/or modify
6c19e205b6b8 flock: new module
Richard W.M. Jones <rjones@redhat.com>
parents:
diff changeset
6 it under the terms of the GNU General Public License as published by
6c19e205b6b8 flock: new module
Richard W.M. Jones <rjones@redhat.com>
parents:
diff changeset
7 the Free Software Foundation; either version 2, or (at your option)
6c19e205b6b8 flock: new module
Richard W.M. Jones <rjones@redhat.com>
parents:
diff changeset
8 any later version.
6c19e205b6b8 flock: new module
Richard W.M. Jones <rjones@redhat.com>
parents:
diff changeset
9
6c19e205b6b8 flock: new module
Richard W.M. Jones <rjones@redhat.com>
parents:
diff changeset
10 This program is distributed in the hope that it will be useful,
6c19e205b6b8 flock: new module
Richard W.M. Jones <rjones@redhat.com>
parents:
diff changeset
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
6c19e205b6b8 flock: new module
Richard W.M. Jones <rjones@redhat.com>
parents:
diff changeset
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
6c19e205b6b8 flock: new module
Richard W.M. Jones <rjones@redhat.com>
parents:
diff changeset
13 GNU General Public License for more details.
6c19e205b6b8 flock: new module
Richard W.M. Jones <rjones@redhat.com>
parents:
diff changeset
14
6c19e205b6b8 flock: new module
Richard W.M. Jones <rjones@redhat.com>
parents:
diff changeset
15 You should have received a copy of the GNU General Public License
6c19e205b6b8 flock: new module
Richard W.M. Jones <rjones@redhat.com>
parents:
diff changeset
16 along with this program; if not, write to the Free Software Foundation,
6c19e205b6b8 flock: new module
Richard W.M. Jones <rjones@redhat.com>
parents:
diff changeset
17 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
6c19e205b6b8 flock: new module
Richard W.M. Jones <rjones@redhat.com>
parents:
diff changeset
18
6c19e205b6b8 flock: new module
Richard W.M. Jones <rjones@redhat.com>
parents:
diff changeset
19 /* Written by Richard W.M. Jones. */
6c19e205b6b8 flock: new module
Richard W.M. Jones <rjones@redhat.com>
parents:
diff changeset
20
14840
5f709022a256 Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents: 14079
diff changeset
21 #ifndef _@GUARD_PREFIX@_SYS_FILE_H
13055
c7be8484e434 maint: use pragma consistently across replacement headers
Eric Blake <eblake@redhat.com>
parents: 12766
diff changeset
22
13094
2ed0fc659db8 Emit #pragma system_header after the inclusion guard, not before.
Bruno Haible <bruno@clisp.org>
parents: 13055
diff changeset
23 #if __GNUC__ >= 3
2ed0fc659db8 Emit #pragma system_header after the inclusion guard, not before.
Bruno Haible <bruno@clisp.org>
parents: 13055
diff changeset
24 @PRAGMA_SYSTEM_HEADER@
2ed0fc659db8 Emit #pragma system_header after the inclusion guard, not before.
Bruno Haible <bruno@clisp.org>
parents: 13055
diff changeset
25 #endif
13761
a19ace3ba849 Avoid line length limitation from HP NonStop system header files.
Bruno Haible <bruno@clisp.org>
parents: 13094
diff changeset
26 @PRAGMA_COLUMNS@
13094
2ed0fc659db8 Emit #pragma system_header after the inclusion guard, not before.
Bruno Haible <bruno@clisp.org>
parents: 13055
diff changeset
27
10598
6c19e205b6b8 flock: new module
Richard W.M. Jones <rjones@redhat.com>
parents:
diff changeset
28 /* The include_next requires a split double-inclusion guard. */
13094
2ed0fc659db8 Emit #pragma system_header after the inclusion guard, not before.
Bruno Haible <bruno@clisp.org>
parents: 13055
diff changeset
29 #if @HAVE_SYS_FILE_H@
2ed0fc659db8 Emit #pragma system_header after the inclusion guard, not before.
Bruno Haible <bruno@clisp.org>
parents: 13055
diff changeset
30 # @INCLUDE_NEXT@ @NEXT_SYS_FILE_H@
2ed0fc659db8 Emit #pragma system_header after the inclusion guard, not before.
Bruno Haible <bruno@clisp.org>
parents: 13055
diff changeset
31 #endif
10598
6c19e205b6b8 flock: new module
Richard W.M. Jones <rjones@redhat.com>
parents:
diff changeset
32
14840
5f709022a256 Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents: 14079
diff changeset
33 #ifndef _@GUARD_PREFIX@_SYS_FILE_H
5f709022a256 Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents: 14079
diff changeset
34 #define _@GUARD_PREFIX@_SYS_FILE_H
10598
6c19e205b6b8 flock: new module
Richard W.M. Jones <rjones@redhat.com>
parents:
diff changeset
35
12522
9c72e4d90613 tests: test more substitute headers
Eric Blake <ebb9@byu.net>
parents: 12518
diff changeset
36 #ifndef LOCK_SH
9c72e4d90613 tests: test more substitute headers
Eric Blake <ebb9@byu.net>
parents: 12518
diff changeset
37 /* 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
38 # define LOCK_SH 1 /* Shared lock. */
9c72e4d90613 tests: test more substitute headers
Eric Blake <ebb9@byu.net>
parents: 12518
diff changeset
39 # define LOCK_EX 2 /* Exclusive lock. */
9c72e4d90613 tests: test more substitute headers
Eric Blake <ebb9@byu.net>
parents: 12518
diff changeset
40 # define LOCK_UN 8 /* Unlock. */
9c72e4d90613 tests: test more substitute headers
Eric Blake <ebb9@byu.net>
parents: 12518
diff changeset
41
9c72e4d90613 tests: test more substitute headers
Eric Blake <ebb9@byu.net>
parents: 12518
diff changeset
42 /* 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
43 # define LOCK_NB 4 /* Don't block when locking. */
9c72e4d90613 tests: test more substitute headers
Eric Blake <ebb9@byu.net>
parents: 12518
diff changeset
44 #endif
10598
6c19e205b6b8 flock: new module
Richard W.M. Jones <rjones@redhat.com>
parents:
diff changeset
45
12766
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
46 /* 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
47
10598
6c19e205b6b8 flock: new module
Richard W.M. Jones <rjones@redhat.com>
parents:
diff changeset
48 #if @GNULIB_FLOCK@
6c19e205b6b8 flock: new module
Richard W.M. Jones <rjones@redhat.com>
parents:
diff changeset
49 /* Apply or remove advisory locks on an open file.
6c19e205b6b8 flock: new module
Richard W.M. Jones <rjones@redhat.com>
parents:
diff changeset
50 Return 0 if successful, otherwise -1 and errno set. */
6c19e205b6b8 flock: new module
Richard W.M. Jones <rjones@redhat.com>
parents:
diff changeset
51 # if !@HAVE_FLOCK@
6c19e205b6b8 flock: new module
Richard W.M. Jones <rjones@redhat.com>
parents:
diff changeset
52 extern int flock (int fd, int operation);
6c19e205b6b8 flock: new module
Richard W.M. Jones <rjones@redhat.com>
parents:
diff changeset
53 # endif
6c19e205b6b8 flock: new module
Richard W.M. Jones <rjones@redhat.com>
parents:
diff changeset
54 #elif defined GNULIB_POSIXCHECK
6c19e205b6b8 flock: new module
Richard W.M. Jones <rjones@redhat.com>
parents:
diff changeset
55 # undef flock
12766
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
56 # if HAVE_RAW_DECL_FLOCK
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
57 _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
58 "use gnulib module flock for portability");
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12559
diff changeset
59 # endif
10598
6c19e205b6b8 flock: new module
Richard W.M. Jones <rjones@redhat.com>
parents:
diff changeset
60 #endif
6c19e205b6b8 flock: new module
Richard W.M. Jones <rjones@redhat.com>
parents:
diff changeset
61
6c19e205b6b8 flock: new module
Richard W.M. Jones <rjones@redhat.com>
parents:
diff changeset
62
14840
5f709022a256 Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents: 14079
diff changeset
63 #endif /* _@GUARD_PREFIX@_SYS_FILE_H */
5f709022a256 Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents: 14079
diff changeset
64 #endif /* _@GUARD_PREFIX@_SYS_FILE_H */