Rizin
unix-like reverse engineering framework and cli tools
linux-syscalls.h File Reference
#include <stdint.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/socket.h>

Go to the source code of this file.

Classes

struct  uv__statx_timestamp
 
struct  uv__statx
 

Macros

#define _GNU_SOURCE
 

Functions

ssize_t uv__preadv (int fd, const struct iovec *iov, int iovcnt, int64_t offset)
 
ssize_t uv__pwritev (int fd, const struct iovec *iov, int iovcnt, int64_t offset)
 
int uv__dup3 (int oldfd, int newfd, int flags)
 
ssize_t uv__fs_copy_file_range (int fd_in, ssize_t *off_in, int fd_out, ssize_t *off_out, size_t len, unsigned int flags)
 
int uv__statx (int dirfd, const char *path, int flags, unsigned int mask, struct uv__statx *statxbuf)
 
ssize_t uv__getrandom (void *buf, size_t buflen, unsigned flags)
 

Macro Definition Documentation

◆ _GNU_SOURCE

#define _GNU_SOURCE

Definition at line 26 of file linux-syscalls.h.

Function Documentation

◆ uv__dup3()

int uv__dup3 ( int  oldfd,
int  newfd,
int  flags 
)

Definition at line 214 of file linux-syscalls.c.

214  {
215 #if defined(__NR_dup3)
216  return syscall(__NR_dup3, oldfd, newfd, flags);
217 #else
218  return errno = ENOSYS, -1;
219 #endif
220 }
static static fork const void static count static fd const char static mode const char static pathname const char static path const char static dev const char static group static getpid static getuid void void static data static pause const char static mode static sync const char const char static newpath const char static pathname unsigned long static filedes void static end_data_segment static handler static getegid char static len static pgid const char static path oldfd
Definition: sflib.h:94
#define __NR_dup3
Definition: sfsysnr.h:326
static struct sockaddr static addrlen static backlog const void static flags void flags
Definition: sfsocketcall.h:123
const char * syscall
Definition: internal.h:270

References __NR_dup3, flags, oldfd, and syscall.

◆ uv__fs_copy_file_range()

ssize_t uv__fs_copy_file_range ( int  fd_in,
ssize_t off_in,
int  fd_out,
ssize_t off_out,
size_t  len,
unsigned int  flags 
)

Definition at line 224 of file linux-syscalls.c.

230 {
231 #ifdef __NR_copy_file_range
232  return syscall(__NR_copy_file_range,
233  fd_in,
234  off_in,
235  fd_out,
236  off_out,
237  len,
238  flags);
239 #else
240  return errno = ENOSYS, -1;
241 #endif
242 }
size_t len
Definition: 6502dis.c:15

References flags, len, and syscall.

Referenced by uv__fs_sendfile().

◆ uv__getrandom()

ssize_t uv__getrandom ( void *  buf,
size_t  buflen,
unsigned  flags 
)

Definition at line 261 of file linux-syscalls.c.

261  {
262 #if defined(__NR_getrandom)
263  return syscall(__NR_getrandom, buf, buflen, flags);
264 #else
265  return errno = ENOSYS, -1;
266 #endif
267 }
voidpf void * buf
Definition: ioapi.h:138
ut64 buflen
Definition: core.c:76

References buflen, flags, and syscall.

◆ uv__preadv()

ssize_t uv__preadv ( int  fd,
const struct iovec iov,
int  iovcnt,
int64_t  offset 
)

Definition at line 196 of file linux-syscalls.c.

196  {
197 #if defined(__NR_preadv)
198  return syscall(__NR_preadv, fd, iov, iovcnt, (long)offset, (long)(offset >> 32));
199 #else
200  return errno = ENOSYS, -1;
201 #endif
202 }
#define __NR_preadv
Definition: sfsysnr.h:641
voidpf uLong offset
Definition: ioapi.h:144
static uv_buf_t iov
Definition: main.c:15
static const z80_opcode fd[]
Definition: z80_tab.h:997

References __NR_preadv, fd, iov, and syscall.

Referenced by uv__fs_read().

◆ uv__pwritev()

ssize_t uv__pwritev ( int  fd,
const struct iovec iov,
int  iovcnt,
int64_t  offset 
)

Definition at line 205 of file linux-syscalls.c.

205  {
206 #if defined(__NR_pwritev)
207  return syscall(__NR_pwritev, fd, iov, iovcnt, (long)offset, (long)(offset >> 32));
208 #else
209  return errno = ENOSYS, -1;
210 #endif
211 }
#define __NR_pwritev
Definition: sfsysnr.h:644

References __NR_pwritev, fd, iov, and syscall.

Referenced by uv__fs_write().

◆ uv__statx()

int uv__statx ( int  dirfd,
const char *  path,
int  flags,
unsigned int  mask,
struct uv__statx statxbuf 
)

Definition at line 245 of file linux-syscalls.c.

249  {
250  /* __NR_statx make Android box killed by SIGSYS.
251  * That looks like a seccomp2 sandbox filter rejecting the system call.
252  */
253 #if defined(__NR_statx) && !defined(__ANDROID__)
254  return syscall(__NR_statx, dirfd, path, flags, mask, statxbuf);
255 #else
256  return errno = ENOSYS, -1;
257 #endif
258 }
#define mask()
static static fork const void static count static fd const char const char static newpath const char static path const char path
Definition: sflib.h:35

References flags, mask, path, and syscall.

Referenced by uv__fs_statx().