blob: 6b328544f0d446ef553057db3f2ee6f6a7198bce [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
51#ifndef HAVE_FCHMODAT
52int
53fchmodat (int dirfd __attribute__ ((unused)),
54 const char *pathname __attribute__ ((unused)),
55 mode_t mode __attribute__ ((unused)),
56 int flags __attribute__ ((unused)))
57{
Ian Lance Taylor1c69e5e2012-02-02 22:58:54 +000058 errno = ENOSYS;
59 return -1;
Ian Lance Taylore02ed812012-01-26 20:24:01 +000060}
61#endif
62
63#ifndef HAVE_FCHOWNAT
64int
65fchownat (int dirfd __attribute__ ((unused)),
66 const char *pathname __attribute__ ((unused)),
67 uid_t owner __attribute__ ((unused)),
68 gid_t group __attribute__ ((unused)),
69 int flags __attribute__ ((unused)))
70{
Ian Lance Taylor1c69e5e2012-02-02 22:58:54 +000071 errno = ENOSYS;
72 return -1;
Ian Lance Taylore02ed812012-01-26 20:24:01 +000073}
74#endif
75
76#ifndef HAVE_FUTIMESAT
77int
78futimesat (int dirfd __attribute__ ((unused)),
79 const char *pathname __attribute__ ((unused)),
80 const struct timeval times[2] __attribute__ ((unused)))
81{
Ian Lance Taylor1c69e5e2012-02-02 22:58:54 +000082 errno = ENOSYS;
83 return -1;
Ian Lance Taylore02ed812012-01-26 20:24:01 +000084}
85#endif
86
87#ifndef HAVE_INOTIFY_ADD_WATCH
88int
89inotify_add_watch (int fd __attribute__ ((unused)),
90 const char* pathname __attribute__ ((unused)),
91 uint32_t mask __attribute__ ((unused)))
92{
Ian Lance Taylor1c69e5e2012-02-02 22:58:54 +000093 errno = ENOSYS;
94 return -1;
Ian Lance Taylore02ed812012-01-26 20:24:01 +000095}
96#endif
97
98#ifndef HAVE_INOTIFY_INIT
99int
100inotify_init (void)
101{
Ian Lance Taylor1c69e5e2012-02-02 22:58:54 +0000102 errno = ENOSYS;
103 return -1;
Ian Lance Taylore02ed812012-01-26 20:24:01 +0000104}
105#endif
106
107#ifndef HAVE_INOTIFY_RM_WATCH
108int
109inotify_rm_watch (int fd __attribute__ ((unused)),
110 uint32_t wd __attribute__ ((unused)))
111{
Ian Lance Taylor1c69e5e2012-02-02 22:58:54 +0000112 errno = ENOSYS;
113 return -1;
Ian Lance Taylore02ed812012-01-26 20:24:01 +0000114}
115#endif
116
117#ifndef HAVE_MKDIRAT
118int
119mkdirat (int dirfd __attribute__ ((unused)),
120 const char *pathname __attribute__ ((unused)),
121 mode_t mode __attribute__ ((unused)))
122{
Ian Lance Taylor1c69e5e2012-02-02 22:58:54 +0000123 errno = ENOSYS;
124 return -1;
Ian Lance Taylore02ed812012-01-26 20:24:01 +0000125}
126#endif
127
128#ifndef HAVE_MKNODAT
129int
130mknodat (int dirfd __attribute__ ((unused)),
131 const char *pathname __attribute__ ((unused)),
132 mode_t mode __attribute__ ((unused)),
133 dev_t dev __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_OPENAT
141int
142openat (int dirfd __attribute__ ((unused)),
143 const char *pathname __attribute__ ((unused)),
144 int oflag __attribute__ ((unused)),
145 ...)
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_RENAMEAT
153int
154renameat (int olddirfd __attribute__ ((unused)),
155 const char *oldpath __attribute__ ((unused)),
156 int newdirfd __attribute__ ((unused)),
157 const char *newpath __attribute__ ((unused)))
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_SPLICE
165int
166splice (int fd __attribute__ ((unused)),
167 loff_t *off_in __attribute__ ((unused)),
168 int fd_out __attribute__ ((unused)),
169 loff_t *off_out __attribute__ ((unused)),
170 size_t len __attribute__ ((unused)),
171 unsigned int flags __attribute__ ((unused)))
172{
Ian Lance Taylor1c69e5e2012-02-02 22:58:54 +0000173 errno = ENOSYS;
174 return -1;
Ian Lance Taylore02ed812012-01-26 20:24:01 +0000175}
176#endif
177
178#ifndef HAVE_TEE
179int
180tee (int fd_in __attribute__ ((unused)),
181 int fd_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_UNLINKAT
191int
192unlinkat (int dirfd __attribute__ ((unused)),
193 const char *pathname __attribute__ ((unused)),
194 int flags __attribute__ ((unused)))
195{
Ian Lance Taylor1c69e5e2012-02-02 22:58:54 +0000196 errno = ENOSYS;
197 return -1;
Ian Lance Taylore02ed812012-01-26 20:24:01 +0000198}
199#endif
200
201#ifndef HAVE_UNSHARE
202int
203unshare (int flags __attribute__ ((unused)))
204{
Ian Lance Taylor1c69e5e2012-02-02 22:58:54 +0000205 errno = ENOSYS;
206 return -1;
Ian Lance Taylore02ed812012-01-26 20:24:01 +0000207}
208#endif