GNU Octave  4.4.1
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-2018 John W. Eaton
4 
5 This file is part of Octave.
6 
7 Octave is free software: you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11 
12 Octave is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with Octave; see the file COPYING. If not, see
19 <https://www.gnu.org/licenses/>.
20 
21 */
22 
23 // These functions may be provided by gnulib. We don't include gnulib
24 // headers directly in Octave's C++ source files to avoid problems that
25 // may be caused by the way that gnulib overrides standard library
26 // functions.
27 
28 #if defined (HAVE_CONFIG_H)
29 # include "config.h"
30 #endif
31 
32 #include <fcntl.h>
33 
34 #include "fcntl-wrappers.h"
35 
36 int
37 octave_fcntl_wrapper (int fd, int cmd, int arg)
38 {
39  return fcntl (fd, cmd, arg);
40 }
41 
42 int
43 octave_open_wrapper (const char *nm, int flags, mode_t mode)
44 {
45  return open (nm, flags, mode);
46 }
47 
48 int
50 {
51 #if defined (F_DUPFD)
52  return F_DUPFD;
53 #else
54  return -1;
55 #endif
56 }
57 
58 int
60 {
61 #if defined (F_GETFD)
62  return F_GETFD;
63 #else
64  return -1;
65 #endif
66 }
67 
68 int
70 {
71 #if defined (F_GETFL)
72  return F_GETFL;
73 #else
74  return -1;
75 #endif
76 }
77 
78 int
80 {
81 #if defined (F_SETFD)
82  return F_SETFD;
83 #else
84  return -1;
85 #endif
86 }
87 
88 int
90 {
91 #if defined (F_SETFL)
92  return F_SETFL;
93 #else
94  return -1;
95 #endif
96 }
97 
98 int
100 {
101 #if defined (O_APPEND)
102  return O_APPEND;
103 #else
104  return -1;
105 #endif
106 }
107 
108 int
110 {
111 #if defined (O_ASYNC)
112  return O_ASYNC;
113 #else
114  return -1;
115 #endif
116 }
117 
118 int
120 {
121 #if defined (O_CREAT)
122  return O_CREAT;
123 #else
124  return -1;
125 #endif
126 }
127 
128 int
130 {
131 #if defined (O_EXCL)
132  return O_EXCL;
133 #else
134  return -1;
135 #endif
136 }
137 
138 int
140 {
141 #if defined (O_NONBLOCK)
142  return O_NONBLOCK;
143 #else
144  return -1;
145 #endif
146 }
147 
148 int
150 {
151 #if defined (O_RDONLY)
152  return O_RDONLY;
153 #else
154  return -1;
155 #endif
156 }
157 
158 int
160 {
161 #if defined (O_RDWR)
162  return O_RDWR;
163 #else
164  return -1;
165 #endif
166 }
167 
168 int
170 {
171 #if defined (O_SYNC)
172  return O_SYNC;
173 #else
174  return -1;
175 #endif
176 }
177 
178 int
180 {
181 #if defined (O_TRUNC)
182  return O_TRUNC;
183 #else
184  return -1;
185 #endif
186 }
187 
188 int
190 {
191 #if defined (O_WRONLY)
192  return O_WRONLY;
193 #else
194  return -1;
195 #endif
196 }
int fcntl(int fd, int cmd, long arg)
int octave_o_creat_wrapper(void)
Return the CPU time used by your Octave session The first output is the total time spent executing your process and is equal to the sum of second and third which are the number of CPU seconds spent executing in user mode and the number of CPU seconds spent executing in system mode
Definition: data.cc:6348
int octave_o_append_wrapper(void)
int octave_f_getfd_wrapper(void)
int octave_f_setfl_wrapper(void)
int octave_fcntl_wrapper(int fd, int cmd, int arg)
octave_value arg
Definition: pr-output.cc:3244
int octave_f_dupfd_wrapper(void)
int octave_f_getfl_wrapper(void)
OCTAVE_EXPORT octave_value_list isdir nd deftypefn *std::string nm
Definition: utils.cc:975
int octave_open_wrapper(const char *nm, int flags, mode_t mode)
int octave_o_rdonly_wrapper(void)
int octave_o_async_wrapper(void)
int octave_o_nonblock_wrapper(void)
int octave_o_trunc_wrapper(void)
int octave_o_sync_wrapper(void)
int octave_o_wronly_wrapper(void)
int octave_o_rdwr_wrapper(void)
int octave_o_excl_wrapper(void)
int octave_f_setfd_wrapper(void)