re PR libstdc++/52591 ([C++0x] [4.7 Regression] moving std::vector relies on movable...
[gcc.git] / libgo / runtime / go-nosys.c
1 /* go-nosys.c -- functions missing from system.
2
3 Copyright 2012 The Go Authors. All rights reserved.
4 Use of this source code is governed by a BSD-style
5 license that can be found in the LICENSE file. */
6
7 /* This file exists to provide definitions for functions that are
8 missing from libc, according to the configure script. This permits
9 the Go syscall package to not worry about whether the functions
10 exist or not. */
11
12 #include "config.h"
13
14 #include <errno.h>
15 #include <fcntl.h>
16 #include <stdint.h>
17 #include <sys/types.h>
18 #include <sys/stat.h>
19 #include <sys/time.h>
20 #include <unistd.h>
21
22 #ifndef HAVE_OFF64_T
23 typedef signed int off64_t __attribute__ ((mode (DI)));
24 #endif
25
26 #ifndef HAVE_LOFF_T
27 typedef off64_t loff_t;
28 #endif
29
30 #ifndef HAVE_EPOLL_CREATE1
31 int
32 epoll_create1 (int flags __attribute__ ((unused)))
33 {
34 errno = ENOSYS;
35 return -1;
36 }
37 #endif
38
39 #ifndef HAVE_FACCESSAT
40 int
41 faccessat (int fd __attribute__ ((unused)),
42 const char *pathname __attribute__ ((unused)),
43 int mode __attribute__ ((unused)),
44 int flags __attribute__ ((unused)))
45 {
46 errno = ENOSYS;
47 return -1;
48 }
49 #endif
50
51 #ifndef HAVE_FALLOCATE
52 int
53 fallocate (int fd __attribute__ ((unused)),
54 int mode __attribute__ ((unused)),
55 off_t offset __attribute__ ((unused)),
56 off_t len __attribute__ ((unused)))
57 {
58 errno = ENOSYS;
59 return -1;
60 }
61 #endif
62
63 #ifndef HAVE_FCHMODAT
64 int
65 fchmodat (int dirfd __attribute__ ((unused)),
66 const char *pathname __attribute__ ((unused)),
67 mode_t mode __attribute__ ((unused)),
68 int flags __attribute__ ((unused)))
69 {
70 errno = ENOSYS;
71 return -1;
72 }
73 #endif
74
75 #ifndef HAVE_FCHOWNAT
76 int
77 fchownat (int dirfd __attribute__ ((unused)),
78 const char *pathname __attribute__ ((unused)),
79 uid_t owner __attribute__ ((unused)),
80 gid_t group __attribute__ ((unused)),
81 int flags __attribute__ ((unused)))
82 {
83 errno = ENOSYS;
84 return -1;
85 }
86 #endif
87
88 #ifndef HAVE_FUTIMESAT
89 int
90 futimesat (int dirfd __attribute__ ((unused)),
91 const char *pathname __attribute__ ((unused)),
92 const struct timeval times[2] __attribute__ ((unused)))
93 {
94 errno = ENOSYS;
95 return -1;
96 }
97 #endif
98
99 #ifndef HAVE_INOTIFY_ADD_WATCH
100 int
101 inotify_add_watch (int fd __attribute__ ((unused)),
102 const char* pathname __attribute__ ((unused)),
103 uint32_t mask __attribute__ ((unused)))
104 {
105 errno = ENOSYS;
106 return -1;
107 }
108 #endif
109
110 #ifndef HAVE_INOTIFY_INIT
111 int
112 inotify_init (void)
113 {
114 errno = ENOSYS;
115 return -1;
116 }
117 #endif
118
119 #ifndef HAVE_INOTIFY_INIT1
120 int
121 inotify_init1 (int flags __attribute__ ((unused)))
122 {
123 errno = ENOSYS;
124 return -1;
125 }
126 #endif
127
128 #ifndef HAVE_INOTIFY_RM_WATCH
129 int
130 inotify_rm_watch (int fd __attribute__ ((unused)),
131 uint32_t wd __attribute__ ((unused)))
132 {
133 errno = ENOSYS;
134 return -1;
135 }
136 #endif
137
138 #ifndef HAVE_MKDIRAT
139 int
140 mkdirat (int dirfd __attribute__ ((unused)),
141 const char *pathname __attribute__ ((unused)),
142 mode_t mode __attribute__ ((unused)))
143 {
144 errno = ENOSYS;
145 return -1;
146 }
147 #endif
148
149 #ifndef HAVE_MKNODAT
150 int
151 mknodat (int dirfd __attribute__ ((unused)),
152 const char *pathname __attribute__ ((unused)),
153 mode_t mode __attribute__ ((unused)),
154 dev_t dev __attribute__ ((unused)))
155 {
156 errno = ENOSYS;
157 return -1;
158 }
159 #endif
160
161 #ifndef HAVE_OPENAT
162 int
163 openat (int dirfd __attribute__ ((unused)),
164 const char *pathname __attribute__ ((unused)),
165 int oflag __attribute__ ((unused)),
166 ...)
167 {
168 errno = ENOSYS;
169 return -1;
170 }
171 #endif
172
173 #ifndef HAVE_RENAMEAT
174 int
175 renameat (int olddirfd __attribute__ ((unused)),
176 const char *oldpath __attribute__ ((unused)),
177 int newdirfd __attribute__ ((unused)),
178 const char *newpath __attribute__ ((unused)))
179 {
180 errno = ENOSYS;
181 return -1;
182 }
183 #endif
184
185 #ifndef HAVE_SPLICE
186 int
187 splice (int fd __attribute__ ((unused)),
188 loff_t *off_in __attribute__ ((unused)),
189 int fd_out __attribute__ ((unused)),
190 loff_t *off_out __attribute__ ((unused)),
191 size_t len __attribute__ ((unused)),
192 unsigned int flags __attribute__ ((unused)))
193 {
194 errno = ENOSYS;
195 return -1;
196 }
197 #endif
198
199 #ifndef HAVE_SYNC_FILE_RANGE
200 int
201 sync_file_range (int fd __attribute__ ((unused)),
202 off64_t offset __attribute__ ((unused)),
203 off64_t nbytes __attribute__ ((unused)),
204 unsigned int flags __attribute__ ((unused)))
205 {
206 errno = ENOSYS;
207 return -1;
208 }
209 #endif
210
211 #ifndef HAVE_TEE
212 int
213 tee (int fd_in __attribute__ ((unused)),
214 int fd_out __attribute__ ((unused)),
215 size_t len __attribute__ ((unused)),
216 unsigned int flags __attribute__ ((unused)))
217 {
218 errno = ENOSYS;
219 return -1;
220 }
221 #endif
222
223 #ifndef HAVE_UNLINKAT
224 int
225 unlinkat (int dirfd __attribute__ ((unused)),
226 const char *pathname __attribute__ ((unused)),
227 int flags __attribute__ ((unused)))
228 {
229 errno = ENOSYS;
230 return -1;
231 }
232 #endif
233
234 #ifndef HAVE_UNSHARE
235 int
236 unshare (int flags __attribute__ ((unused)))
237 {
238 errno = ENOSYS;
239 return -1;
240 }
241 #endif