1 /* go-nosys.c -- functions missing from system.
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. */
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
18 #include <sys/types.h>
24 typedef signed int off64_t __attribute__ ((mode (DI)));
28 typedef off64_t loff_t;
31 #ifndef HAVE_EPOLL_CREATE1
33 epoll_create1 (int flags __attribute__ ((unused)))
40 #ifndef HAVE_FACCESSAT
42 faccessat (int fd __attribute__ ((unused)),
43 const char *pathname __attribute__ ((unused)),
44 int mode __attribute__ ((unused)),
45 int flags __attribute__ ((unused)))
52 #ifndef HAVE_FALLOCATE
54 fallocate (int fd __attribute__ ((unused)),
55 int mode __attribute__ ((unused)),
56 off_t offset __attribute__ ((unused)),
57 off_t len __attribute__ ((unused)))
66 fchmodat (int dirfd __attribute__ ((unused)),
67 const char *pathname __attribute__ ((unused)),
68 mode_t mode __attribute__ ((unused)),
69 int flags __attribute__ ((unused)))
78 fchownat (int dirfd __attribute__ ((unused)),
79 const char *pathname __attribute__ ((unused)),
80 uid_t owner __attribute__ ((unused)),
81 gid_t group __attribute__ ((unused)),
82 int flags __attribute__ ((unused)))
89 #ifndef HAVE_FUTIMESAT
91 futimesat (int dirfd __attribute__ ((unused)),
92 const char *pathname __attribute__ ((unused)),
93 const struct timeval times[2] __attribute__ ((unused)))
100 #ifndef HAVE_INOTIFY_ADD_WATCH
102 inotify_add_watch (int fd __attribute__ ((unused)),
103 const char* pathname __attribute__ ((unused)),
104 uint32_t mask __attribute__ ((unused)))
111 #ifndef HAVE_INOTIFY_INIT
120 #ifndef HAVE_INOTIFY_INIT1
122 inotify_init1 (int flags __attribute__ ((unused)))
129 #ifndef HAVE_INOTIFY_RM_WATCH
131 inotify_rm_watch (int fd __attribute__ ((unused)),
132 uint32_t wd __attribute__ ((unused)))
141 mkdirat (int dirfd __attribute__ ((unused)),
142 const char *pathname __attribute__ ((unused)),
143 mode_t mode __attribute__ ((unused)))
152 mknodat (int dirfd __attribute__ ((unused)),
153 const char *pathname __attribute__ ((unused)),
154 mode_t mode __attribute__ ((unused)),
155 dev_t dev __attribute__ ((unused)))
164 openat (int dirfd __attribute__ ((unused)),
165 const char *pathname __attribute__ ((unused)),
166 int oflag __attribute__ ((unused)),
174 #ifndef HAVE_RENAMEAT
176 renameat (int olddirfd __attribute__ ((unused)),
177 const char *oldpath __attribute__ ((unused)),
178 int newdirfd __attribute__ ((unused)),
179 const char *newpath __attribute__ ((unused)))
188 splice (int fd __attribute__ ((unused)),
189 loff_t *off_in __attribute__ ((unused)),
190 int fd_out __attribute__ ((unused)),
191 loff_t *off_out __attribute__ ((unused)),
192 size_t len __attribute__ ((unused)),
193 unsigned int flags __attribute__ ((unused)))
200 #ifndef HAVE_SYNC_FILE_RANGE
202 sync_file_range (int fd __attribute__ ((unused)),
203 off64_t offset __attribute__ ((unused)),
204 off64_t nbytes __attribute__ ((unused)),
205 unsigned int flags __attribute__ ((unused)))
214 tee (int fd_in __attribute__ ((unused)),
215 int fd_out __attribute__ ((unused)),
216 size_t len __attribute__ ((unused)),
217 unsigned int flags __attribute__ ((unused)))
224 #ifndef HAVE_UNLINKAT
226 unlinkat (int dirfd __attribute__ ((unused)),
227 const char *pathname __attribute__ ((unused)),
228 int flags __attribute__ ((unused)))
237 unshare (int flags __attribute__ ((unused)))
244 /* Long double math functions. These are needed on old i386 systems
245 that don't have them in libm. The compiler translates calls to
246 these functions on float64 to call an 80-bit floating point
247 function instead, because when optimizing that function can be
248 executed as an x87 instructure. However, when not optimizing, this
249 translates into a call to the math function. So on systems that
250 don't provide these functions, we provide a version that just calls
251 the float64 version. */
257 return (long double) cos ((double) a);
265 return (long double) exp ((double) a);
273 return (long double) log ((double) a);
281 return (long double) sin ((double) a);
289 return (long double) tan ((double) a);
295 acosl (long double a)
297 return (long double) acos ((double) a);
303 asinl (long double a)
305 return (long double) asin ((double) a);
311 atanl (long double a)
313 return (long double) atan ((double) a);
319 atan2l (long double a, long double b)
321 return (long double) atan2 ((double) a, (double) b);
327 expm1l (long double a)
329 return (long double) expm1 ((double) a);
335 ldexpl (long double a, int exp)
337 return (long double) ldexp ((double) a, exp);
343 log10l (long double a)
345 return (long double) log10 ((double) a);
351 log1pl (long double a)
353 return (long double) log1p ((double) a);