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