annotate tests/test-fcntl-h.c @ 12559:c2cbabec01dd

update nearly all FSF copyright year lists to include 2010 Use the same procedure as for 2009, outlined in http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/20081
author Jim Meyering <meyering@redhat.com>
date Fri, 01 Jan 2010 10:31:12 +0100
parents e8d2c6fc33ad
children 97fc9a21a8fb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11876
cc0527e5d2f4 fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff changeset
1 /* Test of <fcntl.h> substitute.
12559
c2cbabec01dd update nearly all FSF copyright year lists to include 2010
Jim Meyering <meyering@redhat.com>
parents: 12421
diff changeset
2 Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
11876
cc0527e5d2f4 fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff changeset
3
cc0527e5d2f4 fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff changeset
4 This program is free software: you can redistribute it and/or modify
cc0527e5d2f4 fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff changeset
5 it under the terms of the GNU General Public License as published by
cc0527e5d2f4 fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff changeset
6 the Free Software Foundation; either version 3 of the License, or
cc0527e5d2f4 fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff changeset
7 (at your option) any later version.
cc0527e5d2f4 fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff changeset
8
cc0527e5d2f4 fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff changeset
9 This program is distributed in the hope that it will be useful,
cc0527e5d2f4 fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff changeset
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
cc0527e5d2f4 fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff changeset
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
cc0527e5d2f4 fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff changeset
12 GNU General Public License for more details.
cc0527e5d2f4 fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff changeset
13
cc0527e5d2f4 fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff changeset
14 You should have received a copy of the GNU General Public License
cc0527e5d2f4 fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff changeset
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */
cc0527e5d2f4 fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff changeset
16
cc0527e5d2f4 fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff changeset
17 /* Written by Bruno Haible <bruno@clisp.org>, 2007. */
cc0527e5d2f4 fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff changeset
18
cc0527e5d2f4 fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff changeset
19 #include <config.h>
cc0527e5d2f4 fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff changeset
20
cc0527e5d2f4 fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff changeset
21 #include <fcntl.h>
cc0527e5d2f4 fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff changeset
22
cc0527e5d2f4 fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff changeset
23 /* Check that the various O_* macros are defined. */
cc0527e5d2f4 fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff changeset
24 int o = O_DIRECT | O_DIRECTORY | O_DSYNC | O_NDELAY | O_NOATIME | O_NONBLOCK
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 12197
diff changeset
25 | O_NOCTTY | O_NOFOLLOW | O_NOLINKS | O_RSYNC | O_SYNC | O_TTY_INIT
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 12197
diff changeset
26 | O_BINARY | O_TEXT;
11876
cc0527e5d2f4 fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff changeset
27
cc0527e5d2f4 fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff changeset
28 /* Check that the various SEEK_* macros are defined. */
cc0527e5d2f4 fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff changeset
29 int sk[] = { SEEK_CUR, SEEK_END, SEEK_SET };
cc0527e5d2f4 fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff changeset
30
cc0527e5d2f4 fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff changeset
31 /* Check that the FD_* macros are defined. */
cc0527e5d2f4 fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff changeset
32 int fd = FD_CLOEXEC;
cc0527e5d2f4 fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff changeset
33
cc0527e5d2f4 fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff changeset
34 int
12197
e45d9bb2233e tests: avoid several compiler warnings
Eric Blake <ebb9@byu.net>
parents: 11877
diff changeset
35 main (void)
11876
cc0527e5d2f4 fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff changeset
36 {
cc0527e5d2f4 fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff changeset
37 return 0;
cc0527e5d2f4 fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff changeset
38 }