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>
19 #include <sys/socket.h>
26 typedef signed int off64_t
__attribute__ ((mode (DI
)));
30 typedef off64_t loff_t
;
36 accept4 (int sockfd
__attribute__ ((unused
)),
37 struct sockaddr
*addr
__attribute__ ((unused
)),
38 socklen_t
*addrlen
__attribute__ ((unused
)),
39 int flags
__attribute__ ((unused
)))
46 #ifndef HAVE_EPOLL_CREATE1
48 epoll_create1 (int flags
__attribute__ ((unused
)))
55 #ifndef HAVE_FACCESSAT
57 faccessat (int fd
__attribute__ ((unused
)),
58 const char *pathname
__attribute__ ((unused
)),
59 int mode
__attribute__ ((unused
)),
60 int flags
__attribute__ ((unused
)))
67 #ifndef HAVE_FALLOCATE
69 fallocate (int fd
__attribute__ ((unused
)),
70 int mode
__attribute__ ((unused
)),
71 off_t offset
__attribute__ ((unused
)),
72 off_t len
__attribute__ ((unused
)))
81 fchmodat (int dirfd
__attribute__ ((unused
)),
82 const char *pathname
__attribute__ ((unused
)),
83 mode_t mode
__attribute__ ((unused
)),
84 int flags
__attribute__ ((unused
)))
93 fchownat (int dirfd
__attribute__ ((unused
)),
94 const char *pathname
__attribute__ ((unused
)),
95 uid_t owner
__attribute__ ((unused
)),
96 gid_t group
__attribute__ ((unused
)),
97 int flags
__attribute__ ((unused
)))
104 #ifndef HAVE_FUTIMESAT
106 futimesat (int dirfd
__attribute__ ((unused
)),
107 const char *pathname
__attribute__ ((unused
)),
108 const struct timeval times
[2] __attribute__ ((unused
)))
115 #ifndef HAVE_INOTIFY_ADD_WATCH
117 inotify_add_watch (int fd
__attribute__ ((unused
)),
118 const char* pathname
__attribute__ ((unused
)),
119 uint32_t mask
__attribute__ ((unused
)))
126 #ifndef HAVE_INOTIFY_INIT
135 #ifndef HAVE_INOTIFY_INIT1
137 inotify_init1 (int flags
__attribute__ ((unused
)))
144 #ifndef HAVE_INOTIFY_RM_WATCH
146 inotify_rm_watch (int fd
__attribute__ ((unused
)),
147 uint32_t wd
__attribute__ ((unused
)))
156 mkdirat (int dirfd
__attribute__ ((unused
)),
157 const char *pathname
__attribute__ ((unused
)),
158 mode_t mode
__attribute__ ((unused
)))
167 mknodat (int dirfd
__attribute__ ((unused
)),
168 const char *pathname
__attribute__ ((unused
)),
169 mode_t mode
__attribute__ ((unused
)),
170 dev_t dev
__attribute__ ((unused
)))
179 openat (int dirfd
__attribute__ ((unused
)),
180 const char *pathname
__attribute__ ((unused
)),
181 int oflag
__attribute__ ((unused
)),
191 pipe2 (int pipefd
[2] __attribute__ ((unused
)),
192 int flags
__attribute__ ((unused
)))
199 #ifndef HAVE_RENAMEAT
201 renameat (int olddirfd
__attribute__ ((unused
)),
202 const char *oldpath
__attribute__ ((unused
)),
203 int newdirfd
__attribute__ ((unused
)),
204 const char *newpath
__attribute__ ((unused
)))
213 splice (int fd
__attribute__ ((unused
)),
214 loff_t
*off_in
__attribute__ ((unused
)),
215 int fd_out
__attribute__ ((unused
)),
216 loff_t
*off_out
__attribute__ ((unused
)),
217 size_t len
__attribute__ ((unused
)),
218 unsigned int flags
__attribute__ ((unused
)))
225 #ifndef HAVE_SYNC_FILE_RANGE
227 sync_file_range (int fd
__attribute__ ((unused
)),
228 off64_t offset
__attribute__ ((unused
)),
229 off64_t nbytes
__attribute__ ((unused
)),
230 unsigned int flags
__attribute__ ((unused
)))
239 tee (int fd_in
__attribute__ ((unused
)),
240 int fd_out
__attribute__ ((unused
)),
241 size_t len
__attribute__ ((unused
)),
242 unsigned int flags
__attribute__ ((unused
)))
249 #ifndef HAVE_UNLINKAT
251 unlinkat (int dirfd
__attribute__ ((unused
)),
252 const char *pathname
__attribute__ ((unused
)),
253 int flags
__attribute__ ((unused
)))
262 unshare (int flags
__attribute__ ((unused
)))
269 #ifndef HAVE_UTIMENSAT
272 utimensat(int dirfd
__attribute__ ((unused
)),
273 const char *pathname
__attribute__ ((unused
)),
274 const struct timespec times
[2] __attribute__ ((unused
)),
275 int flags
__attribute__ ((unused
)))
282 /* Long double math functions. These are needed on old i386 systems
283 that don't have them in libm. The compiler translates calls to
284 these functions on float64 to call an 80-bit floating point
285 function instead, because when optimizing that function can be
286 executed as an x87 instructure. However, when not optimizing, this
287 translates into a call to the math function. So on systems that
288 don't provide these functions, we provide a version that just calls
289 the float64 version. */
295 return (long double) cos ((double) a
);
303 return (long double) exp ((double) a
);
311 return (long double) log ((double) a
);
319 return (long double) sin ((double) a
);
327 return (long double) tan ((double) a
);
333 acosl (long double a
)
335 return (long double) acos ((double) a
);
341 asinl (long double a
)
343 return (long double) asin ((double) a
);
349 atanl (long double a
)
351 return (long double) atan ((double) a
);
357 atan2l (long double a
, long double b
)
359 return (long double) atan2 ((double) a
, (double) b
);
365 expm1l (long double a
)
367 return (long double) expm1 ((double) a
);
373 ldexpl (long double a
, int exp
)
375 return (long double) ldexp ((double) a
, exp
);
381 log10l (long double a
)
383 return (long double) log10 ((double) a
);
389 log1pl (long double a
)
391 return (long double) log1p ((double) a
);