1 ?RCS: $Id: d_open3.U,v 3.0.1.2 1997/02/28 15:37:12 ram Exp $
3 ?RCS: Copyright (c) 1991-1993, Raphael Manfredi
5 ?RCS: You may redistribute only under the terms of the Artistic Licence,
6 ?RCS: as specified in the README file that comes with the distribution.
7 ?RCS: You may reuse parts of this distribution only within the terms of
8 ?RCS: that same Artistic Licence; a copy of which may be found at the root
9 ?RCS: of the source tree for dist 3.0.
11 ?RCS: $Log: d_open3.U,v $
12 ?RCS: Revision 3.0.1.2 1997/02/28 15:37:12 ram
13 ?RCS: patch61: added ?F: metalint hint
15 ?RCS: Revision 3.0.1.1 1995/07/25 13:58:26 ram
16 ?RCS: patch56: added knowledge of the O_NONBLOCK symbol
18 ?RCS: Revision 3.0 1993/08/18 12:06:44 ram
19 ?RCS: Baseline for dist 3.0 netwide release.
21 ?MAKE:d_open3: test +cc cat +cppflags h_fcntl h_sysfile rm Setvar Findhdr
22 ?MAKE: -pick add $@ %<
23 ?X: It would be easy to separate the h_O_stuff from this.
24 ?X: Is there a reason to do so? -- HMS
26 ?S: This variable conditionally defines the HAS_OPEN3 manifest constant,
27 ?S: which indicates to the C program that the 3 argument version of
28 ?S: the open(2) function is available.
31 ?C: This manifest constant lets the C program know that the three
32 ?C: argument form of open(2) is available.
34 ?H:#$d_open3 HAS_OPEN3 /**/
36 ?W:%<:O_RDONLY O_WRONLY O_RDWR O_NDELAY O_APPEND O_SYNC O_CREAT O_TRUNC
37 ?W:%<:O_EXCL O_NONBLOCK
40 ?LINT:change h_fcntl h_sysfile
41 : Locate the flags for 'open()'
43 $cat >open3.c <<'EOCP'
44 #include <sys/types.h>
60 : check sys/file.h first to get FREAD on Sun
61 if $test `./findhdr sys/file.h` && \
62 $cc $cppflags "-DI_SYS_FILE" -o open3 open3.c >/dev/null 2>&1 ; then
64 echo "<sys/file.h> defines the O_* constants..." >&4
66 echo "and you have the 3 argument form of open()." >&4
69 echo "but not the 3 argument form of open(). Oh, well." >&4
72 elif $test `./findhdr fcntl.h` && \
73 $cc "-DI_FCNTL" -o open3 open3.c >/dev/null 2>&1 ; then
75 echo "<fcntl.h> defines the O_* constants..." >&4
77 echo "and you have the 3 argument form of open()." >&4
80 echo "but not the 3 argument form of open(). Oh, well." >&4
85 echo "I can't find the O_* constant definitions! You got problems." >&4