blob: 4a30a57ad25a0709e304a5148a52030a7097eb34 [file] [log] [blame]
Ian Lance Taylore02ed812012-01-26 20:24:01 +00001/* 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
23typedef signed int off64_t __attribute__ ((mode (DI)));
24#endif
25
26#ifndef HAVE_LOFF_T
27typedef off64_t loff_t;
28#endif
29
30#ifndef HAVE_EPOLL_CREATE1
31int
32epoll_create1 (int flags __attribute__ ((unused)))
33{
Ian Lance Taylor1c69e5e2012-02-02 22:58:54 +000034 errno = ENOSYS;
35 return -1;
Ian Lance Taylore02ed812012-01-26 20:24:01 +000036}
37#endif
38
39#ifndef HAVE_FACCESSAT
40int
41faccessat (int fd __attribute__ ((unused)),
42 const char *pathname __attribute__ ((unused)),
43 int mode __attribute__ ((unused)),
44 int flags __attribute__ ((unused)))
45{
Ian Lance Taylor1c69e5e2012-02-02 22:58:54 +000046 errno = ENOSYS;
47 return -1;
Ian Lance Taylore02ed812012-01-26 20:24:01 +000048}
49#endif
50
Ian Lance Taylor5d46bf02012-02-18 01:22:02 +000051#ifndef HAVE_FALLOCATE
52int
53fallocate (int fd __attribute__ ((unused)),
54 int mode __attribute__ ((unused)),
Ian Lance Taylor2ef7cdf2012-02-25 02:11:29 +000055 off_t offset __attribute__ ((unused)),
Ian Lance Taylor5d46bf02012-02-18 01:22:02 +000056 off_t len __attribute__ ((unused)))
57{
58 errno = ENOSYS;
59 return -1;
60}
61#endif
62
Ian Lance Taylore02ed812012-01-26 20:24:01 +000063#ifndef HAVE_FCHMODAT
64int
65fchmodat (int dirfd __attribute__ ((unused)),
66 const char *pathname __attribute__ ((unused)),
67 mode_t mode __attribute__ ((unused)),
68 int flags __attribute__ ((unused)))
69{
Ian Lance Taylor1c69e5e2012-02-02 22:58:54 +000070 errno = ENOSYS;
71 return -1;
Ian Lance Taylore02ed812012-01-26 20:24:01 +000072}
73#endif
74
75#ifndef HAVE_FCHOWNAT
76int
77fchownat (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{
Ian Lance Taylor1c69e5e2012-02-02 22:58:54 +000083 errno = ENOSYS;
84 return -1;
Ian Lance Taylore02ed812012-01-26 20:24:01 +000085}
86#endif
87
88#ifndef HAVE_FUTIMESAT
89int
90futimesat (int dirfd __attribute__ ((unused)),
91 const char *pathname __attribute__ ((unused)),
92 const struct timeval times[2] __attribute__ ((unused)))
93{
Ian Lance Taylor1c69e5e2012-02-02 22:58:54 +000094 errno = ENOSYS;
95 return -1;
Ian Lance Taylore02ed812012-01-26 20:24:01 +000096}
97#endif
98
99#ifndef HAVE_INOTIFY_ADD_WATCH
100int
101inotify_add_watch (int fd __attribute__ ((unused)),
102 const char* pathname __attribute__ ((unused)),
103 uint32_t mask __attribute__ ((unused)))
104{
Ian Lance Taylor1c69e5e2012-02-02 22:58:54 +0000105 errno = ENOSYS;
106 return -1;
Ian Lance Taylore02ed812012-01-26 20:24:01 +0000107}
108#endif
109
110#ifndef HAVE_INOTIFY_INIT
111int
112inotify_init (void)
113{
Ian Lance Taylor1c69e5e2012-02-02 22:58:54 +0000114 errno = ENOSYS;
115 return -1;
Ian Lance Taylore02ed812012-01-26 20:24:01 +0000116}
117#endif
118
Ian Lance Taylorb65734a2012-02-29 20:02:31 +0000119#ifndef HAVE_INOTIFY_INIT1
120int
121inotify_init1 (int flags __attribute__ ((unused)))
122{
123 errno = ENOSYS;
124 return -1;
125}
126#endif
127
Ian Lance Taylore02ed812012-01-26 20:24:01 +0000128#ifndef HAVE_INOTIFY_RM_WATCH
129int
130inotify_rm_watch (int fd __attribute__ ((unused)),
131 uint32_t wd __attribute__ ((unused)))
132{
Ian Lance Taylor1c69e5e2012-02-02 22:58:54 +0000133 errno = ENOSYS;
134 return -1;
Ian Lance Taylore02ed812012-01-26 20:24:01 +0000135}
136#endif
137
138#ifndef HAVE_MKDIRAT
139int
140mkdirat (int dirfd __attribute__ ((unused)),
141 const char *pathname __attribute__ ((unused)),
142 mode_t mode __attribute__ ((unused)))
143{
Ian Lance Taylor1c69e5e2012-02-02 22:58:54 +0000144 errno = ENOSYS;
145 return -1;
Ian Lance Taylore02ed812012-01-26 20:24:01 +0000146}
147#endif
148
149#ifndef HAVE_MKNODAT
150int
151mknodat (int dirfd __attribute__ ((unused)),
152 const char *pathname __attribute__ ((unused)),
153 mode_t mode __attribute__ ((unused)),
154 dev_t dev __attribute__ ((unused)))
155{
Ian Lance Taylor1c69e5e2012-02-02 22:58:54 +0000156 errno = ENOSYS;
157 return -1;
Ian Lance Taylore02ed812012-01-26 20:24:01 +0000158}
159#endif
160
161#ifndef HAVE_OPENAT
162int
163openat (int dirfd __attribute__ ((unused)),
164 const char *pathname __attribute__ ((unused)),
165 int oflag __attribute__ ((unused)),
166 ...)
167{
Ian Lance Taylor1c69e5e2012-02-02 22:58:54 +0000168 errno = ENOSYS;
169 return -1;
Ian Lance Taylore02ed812012-01-26 20:24:01 +0000170}
171#endif
172
173#ifndef HAVE_RENAMEAT
174int
175renameat (int olddirfd __attribute__ ((unused)),
176 const char *oldpath __attribute__ ((unused)),
177 int newdirfd __attribute__ ((unused)),
178 const char *newpath __attribute__ ((unused)))
179{
Ian Lance Taylor1c69e5e2012-02-02 22:58:54 +0000180 errno = ENOSYS;
181 return -1;
Ian Lance Taylore02ed812012-01-26 20:24:01 +0000182}
183#endif
184
185#ifndef HAVE_SPLICE
186int
187splice (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{
Ian Lance Taylor1c69e5e2012-02-02 22:58:54 +0000194 errno = ENOSYS;
195 return -1;
Ian Lance Taylore02ed812012-01-26 20:24:01 +0000196}
197#endif
198
Ian Lance Taylorb65734a2012-02-29 20:02:31 +0000199#ifndef HAVE_SYNC_FILE_RANGE
200int
201sync_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
Ian Lance Taylore02ed812012-01-26 20:24:01 +0000211#ifndef HAVE_TEE
212int
213tee (int fd_in __attribute__ ((unused)),
214 int fd_out __attribute__ ((unused)),
215 size_t len __attribute__ ((unused)),
216 unsigned int flags __attribute__ ((unused)))
217{
Ian Lance Taylor1c69e5e2012-02-02 22:58:54 +0000218 errno = ENOSYS;
219 return -1;
Ian Lance Taylore02ed812012-01-26 20:24:01 +0000220}
221#endif
222
223#ifndef HAVE_UNLINKAT
224int
225unlinkat (int dirfd __attribute__ ((unused)),
226 const char *pathname __attribute__ ((unused)),
227 int flags __attribute__ ((unused)))
228{
Ian Lance Taylor1c69e5e2012-02-02 22:58:54 +0000229 errno = ENOSYS;
230 return -1;
Ian Lance Taylore02ed812012-01-26 20:24:01 +0000231}
232#endif
233
234#ifndef HAVE_UNSHARE
235int
236unshare (int flags __attribute__ ((unused)))
237{
Ian Lance Taylor1c69e5e2012-02-02 22:58:54 +0000238 errno = ENOSYS;
239 return -1;
Ian Lance Taylore02ed812012-01-26 20:24:01 +0000240}
241#endif