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: Compile test cat h_fcntl h_sysfile rm_try Setvar Findhdr run i_stdlib
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()'
44 #include <sys/types.h>
64 : check sys/file.h first to get FREAD on Sun
65 if $test `./findhdr sys/file.h` && \
66 set try -DI_SYS_FILE && eval $compile; then
68 echo "<sys/file.h> defines the O_* constants..." >&4
70 echo "and you have the 3 argument form of open()." >&4
73 echo "but not the 3 argument form of open(). Oh, well." >&4
76 elif $test `./findhdr fcntl.h` && \
77 set try -DI_FCNTL && eval $compile; then
79 echo "<fcntl.h> defines the O_* constants..." >&4
81 echo "and you have the 3 argument form of open()." >&4
84 echo "but not the 3 argument form of open(). Oh, well." >&4
89 echo "I can't find the O_* constant definitions! You got problems." >&4