blob: deacec50127fb0dad365e824138131e46e223cc0 [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
119#ifndef HAVE_INOTIFY_RM_WATCH
120int
121inotify_rm_watch (int fd __attribute__ ((unused)),
122 uint32_t wd __attribute__ ((unused)))
123{
Ian Lance Taylor1c69e5e2012-02-02 22:58:54 +0000124 errno = ENOSYS;
125 return -1;
Ian Lance Taylore02ed812012-01-26 20:24:01 +0000126}
127#endif
128
129#ifndef HAVE_MKDIRAT
130int
131mkdirat (int dirfd __attribute__ ((unused)),
132 const char *pathname __attribute__ ((unused)),
133 mode_t mode __attribute__ ((unused)))
134{
Ian Lance Taylor1c69e5e2012-02-02 22:58:54 +0000135 errno = ENOSYS;
136 return -1;
Ian Lance Taylore02ed812012-01-26 20:24:01 +0000137}
138#endif
139
140#ifndef HAVE_MKNODAT
141int
142mknodat (int dirfd __attribute__ ((unused)),
143 const char *pathname __attribute__ ((unused)),
144 mode_t mode __attribute__ ((unused)),
145 dev_t dev __attribute__ ((unused)))
146{
Ian Lance Taylor1c69e5e2012-02-02 22:58:54 +0000147 errno = ENOSYS;
148 return -1;
Ian Lance Taylore02ed812012-01-26 20:24:01 +0000149}
150#endif
151
152#ifndef HAVE_OPENAT
153int
154openat (int dirfd __attribute__ ((unused)),
155 const char *pathname __attribute__ ((unused)),
156 int oflag __attribute__ ((unused)),
157 ...)
158{
Ian Lance Taylor1c69e5e2012-02-02 22:58:54 +0000159 errno = ENOSYS;
160 return -1;
Ian Lance Taylore02ed812012-01-26 20:24:01 +0000161}
162#endif
163
164#ifndef HAVE_RENAMEAT
165int
166renameat (int olddirfd __attribute__ ((unused)),
167 const char *oldpath __attribute__ ((unused)),
168 int newdirfd __attribute__ ((unused)),
169 const char *newpath __attribute__ ((unused)))
170{
Ian Lance Taylor1c69e5e2012-02-02 22:58:54 +0000171 errno = ENOSYS;
172 return -1;
Ian Lance Taylore02ed812012-01-26 20:24:01 +0000173}
174#endif
175
176#ifndef HAVE_SPLICE
177int
178splice (int fd __attribute__ ((unused)),
179 loff_t *off_in __attribute__ ((unused)),
180 int fd_out __attribute__ ((unused)),
181 loff_t *off_out __attribute__ ((unused)),
182 size_t len __attribute__ ((unused)),
183 unsigned int flags __attribute__ ((unused)))
184{
Ian Lance Taylor1c69e5e2012-02-02 22:58:54 +0000185 errno = ENOSYS;
186 return -1;
Ian Lance Taylore02ed812012-01-26 20:24:01 +0000187}
188#endif
189
190#ifndef HAVE_TEE
191int
192tee (int fd_in __attribute__ ((unused)),
193 int fd_out __attribute__ ((unused)),
194 size_t len __attribute__ ((unused)),
195 unsigned int flags __attribute__ ((unused)))
196{
Ian Lance Taylor1c69e5e2012-02-02 22:58:54 +0000197 errno = ENOSYS;
198 return -1;
Ian Lance Taylore02ed812012-01-26 20:24:01 +0000199}
200#endif
201
202#ifndef HAVE_UNLINKAT
203int
204unlinkat (int dirfd __attribute__ ((unused)),
205 const char *pathname __attribute__ ((unused)),
206 int flags __attribute__ ((unused)))
207{
Ian Lance Taylor1c69e5e2012-02-02 22:58:54 +0000208 errno = ENOSYS;
209 return -1;
Ian Lance Taylore02ed812012-01-26 20:24:01 +0000210}
211#endif
212
213#ifndef HAVE_UNSHARE
214int
215unshare (int flags __attribute__ ((unused)))
216{
Ian Lance Taylor1c69e5e2012-02-02 22:58:54 +0000217 errno = ENOSYS;
218 return -1;
Ian Lance Taylore02ed812012-01-26 20:24:01 +0000219}
220#endif