xref: /netbsd-src/external/mit/libuv/dist/src/unix/linux-syscalls.h (revision 82d56013d7b633d116a93943de88e08335357a7c)
1 /* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
2  *
3  * Permission is hereby granted, free of charge, to any person obtaining a copy
4  * of this software and associated documentation files (the "Software"), to
5  * deal in the Software without restriction, including without limitation the
6  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7  * sell copies of the Software, and to permit persons to whom the Software is
8  * furnished to do so, subject to the following conditions:
9  *
10  * The above copyright notice and this permission notice shall be included in
11  * all copies or substantial portions of the Software.
12  *
13  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
19  * IN THE SOFTWARE.
20  */
21 
22 #ifndef UV_LINUX_SYSCALL_H_
23 #define UV_LINUX_SYSCALL_H_
24 
25 #undef  _GNU_SOURCE
26 #define _GNU_SOURCE
27 
28 #include <stdint.h>
29 #include <signal.h>
30 #include <sys/types.h>
31 #include <sys/time.h>
32 #include <sys/socket.h>
33 
34 struct uv__statx_timestamp {
35   int64_t tv_sec;
36   uint32_t tv_nsec;
37   int32_t unused0;
38 };
39 
40 struct uv__statx {
41   uint32_t stx_mask;
42   uint32_t stx_blksize;
43   uint64_t stx_attributes;
44   uint32_t stx_nlink;
45   uint32_t stx_uid;
46   uint32_t stx_gid;
47   uint16_t stx_mode;
48   uint16_t unused0;
49   uint64_t stx_ino;
50   uint64_t stx_size;
51   uint64_t stx_blocks;
52   uint64_t stx_attributes_mask;
53   struct uv__statx_timestamp stx_atime;
54   struct uv__statx_timestamp stx_btime;
55   struct uv__statx_timestamp stx_ctime;
56   struct uv__statx_timestamp stx_mtime;
57   uint32_t stx_rdev_major;
58   uint32_t stx_rdev_minor;
59   uint32_t stx_dev_major;
60   uint32_t stx_dev_minor;
61   uint64_t unused1[14];
62 };
63 
64 ssize_t uv__preadv(int fd, const struct iovec *iov, int iovcnt, int64_t offset);
65 ssize_t uv__pwritev(int fd, const struct iovec *iov, int iovcnt, int64_t offset);
66 int uv__dup3(int oldfd, int newfd, int flags);
67 int uv__statx(int dirfd,
68               const char* path,
69               int flags,
70               unsigned int mask,
71               struct uv__statx* statxbuf);
72 ssize_t uv__getrandom(void* buf, size_t buflen, unsigned flags);
73 
74 #endif /* UV_LINUX_SYSCALL_H_ */
75