annotate liboctave/wrappers/fcntl-wrappers.c @ 33527:d10bed2b2cb4 bytecode-interpreter tip

maint: Merge default to bytecode interpreter.
author Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
date Fri, 03 May 2024 02:01:58 -0400
parents 2e484f9f1f18
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
1 ////////////////////////////////////////////////////////////////////////
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
2 //
32632
2e484f9f1f18 maint: update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents: 31706
diff changeset
3 // Copyright (C) 2016-2024 The Octave Project Developers
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
4 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
5 // See the file COPYRIGHT.md in the top-level directory of this
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
6 // distribution or <https://octave.org/copyright/>.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
7 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
8 // This file is part of Octave.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
9 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
10 // Octave is free software: you can redistribute it and/or modify it
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
11 // under the terms of the GNU General Public License as published by
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
12 // the Free Software Foundation, either version 3 of the License, or
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
13 // (at your option) any later version.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
14 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
15 // Octave is distributed in the hope that it will be useful, but
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
18 // GNU General Public License for more details.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
19 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
20 // You should have received a copy of the GNU General Public License
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
21 // along with Octave; see the file COPYING. If not, see
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
22 // <https://www.gnu.org/licenses/>.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
23 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
24 ////////////////////////////////////////////////////////////////////////
21911
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
25
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
26 // These functions may be provided by gnulib. We don't include gnulib
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
27 // headers directly in Octave's C++ source files to avoid problems that
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
28 // may be caused by the way that gnulib overrides standard library
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
29 // functions.
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
30
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
31 #if defined (HAVE_CONFIG_H)
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
32 # include "config.h"
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
33 #endif
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
34
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
35 #include <fcntl.h>
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
36
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
37 #include "fcntl-wrappers.h"
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
38
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
39 int
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
40 octave_fcntl_wrapper (int fd, int cmd, int arg)
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
41 {
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
42 return fcntl (fd, cmd, arg);
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
43 }
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
44
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
45 int
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
46 octave_open_wrapper (const char *nm, int flags, mode_t mode)
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
47 {
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
48 return open (nm, flags, mode);
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
49 }
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
50
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
51 int
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
52 octave_f_dupfd_wrapper (void)
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
53 {
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
54 #if defined (F_DUPFD)
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
55 return F_DUPFD;
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
56 #else
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
57 return -1;
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
58 #endif
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
59 }
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
60
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
61 int
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
62 octave_f_getfd_wrapper (void)
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
63 {
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
64 #if defined (F_GETFD)
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
65 return F_GETFD;
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
66 #else
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
67 return -1;
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
68 #endif
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
69 }
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
70
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
71 int
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
72 octave_f_getfl_wrapper (void)
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
73 {
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
74 #if defined (F_GETFL)
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
75 return F_GETFL;
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
76 #else
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
77 return -1;
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
78 #endif
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
79 }
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
80
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
81 int
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
82 octave_f_setfd_wrapper (void)
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
83 {
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
84 #if defined (F_SETFD)
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
85 return F_SETFD;
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
86 #else
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
87 return -1;
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
88 #endif
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
89 }
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
90
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
91 int
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
92 octave_f_setfl_wrapper (void)
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
93 {
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
94 #if defined (F_SETFL)
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
95 return F_SETFL;
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
96 #else
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
97 return -1;
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
98 #endif
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
99 }
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
100
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
101 int
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
102 octave_o_append_wrapper (void)
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
103 {
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
104 #if defined (O_APPEND)
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
105 return O_APPEND;
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
106 #else
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
107 return -1;
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
108 #endif
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
109 }
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
110
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
111 int
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
112 octave_o_async_wrapper (void)
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
113 {
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
114 #if defined (O_ASYNC)
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
115 return O_ASYNC;
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
116 #else
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
117 return -1;
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
118 #endif
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
119 }
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
120
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
121 int
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
122 octave_o_creat_wrapper (void)
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
123 {
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
124 #if defined (O_CREAT)
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
125 return O_CREAT;
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
126 #else
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
127 return -1;
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
128 #endif
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
129 }
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
130
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
131 int
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
132 octave_o_excl_wrapper (void)
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
133 {
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
134 #if defined (O_EXCL)
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
135 return O_EXCL;
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
136 #else
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
137 return -1;
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
138 #endif
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
139 }
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
140
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
141 int
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
142 octave_o_nonblock_wrapper (void)
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
143 {
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
144 #if defined (O_NONBLOCK)
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
145 return O_NONBLOCK;
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
146 #else
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
147 return -1;
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
148 #endif
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
149 }
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
150
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
151 int
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
152 octave_o_rdonly_wrapper (void)
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
153 {
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
154 #if defined (O_RDONLY)
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
155 return O_RDONLY;
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
156 #else
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
157 return -1;
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
158 #endif
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
159 }
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
160
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
161 int
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
162 octave_o_rdwr_wrapper (void)
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
163 {
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
164 #if defined (O_RDWR)
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
165 return O_RDWR;
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
166 #else
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
167 return -1;
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
168 #endif
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
169 }
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
170
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
171 int
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
172 octave_o_sync_wrapper (void)
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
173 {
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
174 #if defined (O_SYNC)
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
175 return O_SYNC;
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
176 #else
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
177 return -1;
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
178 #endif
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
179 }
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
180
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
181 int
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
182 octave_o_trunc_wrapper (void)
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
183 {
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
184 #if defined (O_TRUNC)
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
185 return O_TRUNC;
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
186 #else
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
187 return -1;
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
188 #endif
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
189 }
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
190
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
191 int
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
192 octave_o_wronly_wrapper (void)
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
193 {
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
194 #if defined (O_WRONLY)
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
195 return O_WRONLY;
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
196 #else
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
197 return -1;
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
198 #endif
c66c156e1d1d hide fcntl.h header
John W. Eaton <jwe@octave.org>
parents:
diff changeset
199 }