Fennix  1.0.0
Full Documentation
Loading...
Searching...
No Matches
syscalls.h
Go to the documentation of this file.
1/*
2 This file is part of Fennix Kernel.
3
4 Fennix Kernel is free software: you can redistribute it and/or
5 modify it under the terms of the GNU General Public License as
6 published by the Free Software Foundation, either version 3 of
7 the License, or (at your option) any later version.
8
9 Fennix Kernel is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with Fennix Kernel. If not, see <https://www.gnu.org/licenses/>.
16*/
17
18#ifndef __FENNIX_API_SYSCALLS_LIST_H__
19#define __FENNIX_API_SYSCALLS_LIST_H__
20
21#pragma region Syscall Wrappers
22
23#define scarg __UINTPTR_TYPE__
24
33static inline scarg syscall0(scarg syscall)
34{
35 scarg ret;
36#if defined(__amd64__)
37 __asm__ __volatile__("syscall"
38 : "=a"(ret)
39 : "a"(syscall)
40 : "rcx", "r11", "memory");
41#elif defined(__i386__)
42#warning "i386 syscall wrapper not implemented"
43#elif defined(__arm__)
44#warning "arm syscall wrapper not implemented"
45#elif defined(__aarch64__)
46 register long x8 __asm__("x8") = syscall;
47 register long x0 __asm__("x0");
48 __asm__ __volatile__("svc 0"
49 : "=r"(x0)
50 : "r"(x8)
51 : "memory", "cc");
52#else
53#error "Unsupported architecture"
54#endif
55 return ret;
56}
57
67static inline scarg syscall1(scarg syscall, scarg arg1)
68{
69 scarg ret;
70#if defined(__amd64__)
71 __asm__ __volatile__("syscall"
72 : "=a"(ret)
73 : "a"(syscall), "D"(arg1)
74 : "rcx", "r11", "memory");
75#elif defined(__i386__)
76#warning "i386 syscall wrapper not implemented"
77#elif defined(__arm__)
78#warning "arm syscall wrapper not implemented"
79#elif defined(__aarch64__)
80 register long x8 __asm__("x8") = syscall;
81 register long x0 __asm__("x0") = arg1;
82 __asm__ __volatile__("svc 0"
83 : "=r"(ret)
84 : "r"(x8), "0"(x0)
85 : "memory", "cc");
86#else
87#error "Unsupported architecture"
88#endif
89 return ret;
90}
91
102static inline scarg syscall2(scarg syscall, scarg arg1, scarg arg2)
103{
104 scarg ret;
105#if defined(__amd64__)
106 __asm__ __volatile__("syscall"
107 : "=a"(ret)
108 : "a"(syscall), "D"(arg1), "S"(arg2)
109 : "rcx", "r11", "memory");
110#elif defined(__i386__)
111#warning "i386 syscall wrapper not implemented"
112#elif defined(__arm__)
113#warning "arm syscall wrapper not implemented"
114#elif defined(__aarch64__)
115 register long x8 __asm__("x8") = syscall;
116 register long x0 __asm__("x0") = arg1;
117 register long x1 __asm__("x1") = arg2;
118 __asm__ __volatile__("svc 0"
119 : "=r"(ret)
120 : "r"(x8), "0"(x0), "r"(x1)
121 : "memory", "cc");
122#else
123#error "Unsupported architecture"
124#endif
125 return ret;
126}
127
139static inline scarg syscall3(scarg syscall, scarg arg1, scarg arg2, scarg arg3)
140{
141 scarg ret;
142#if defined(__amd64__)
143 __asm__ __volatile__("syscall"
144 : "=a"(ret)
145 : "a"(syscall), "D"(arg1), "S"(arg2), "d"(arg3)
146 : "rcx", "r11", "memory");
147#elif defined(__i386__)
148#warning "i386 syscall wrapper not implemented"
149#elif defined(__arm__)
150#warning "arm syscall wrapper not implemented"
151#elif defined(__aarch64__)
152 register long x8 __asm__("x8") = syscall;
153 register long x0 __asm__("x0") = arg1;
154 register long x1 __asm__("x1") = arg2;
155 register long x2 __asm__("x2") = arg3;
156 __asm__ __volatile__("svc 0"
157 : "=r"(ret)
158 : "r"(x8), "0"(x0), "r"(x1), "r"(x2)
159 : "memory", "cc");
160#else
161#error "Unsupported architecture"
162#endif
163 return ret;
164}
165
178static inline scarg syscall4(scarg syscall, scarg arg1, scarg arg2, scarg arg3, scarg arg4)
179{
180 scarg ret;
181#if defined(__amd64__)
182 register scarg r10 __asm__("r10") = arg4;
183 __asm__ __volatile__("syscall"
184 : "=a"(ret)
185 : "a"(syscall), "D"(arg1), "S"(arg2), "d"(arg3), "r"(r10)
186 : "rcx", "r11", "memory");
187#elif defined(__i386__)
188#warning "i386 syscall wrapper not implemented"
189#elif defined(__arm__)
190#warning "arm syscall wrapper not implemented"
191#elif defined(__aarch64__)
192 register long x8 __asm__("x8") = syscall;
193 register long x0 __asm__("x0") = arg1;
194 register long x1 __asm__("x1") = arg2;
195 register long x2 __asm__("x2") = arg3;
196 register long x3 __asm__("x3") = arg4;
197 __asm__ __volatile__("svc 0"
198 : "=r"(ret)
199 : "r"(x8), "0"(x0), "r"(x1), "r"(x2), "r"(x3)
200 : "memory", "cc");
201#else
202#error "Unsupported architecture"
203#endif
204 return ret;
205}
206
220static inline scarg syscall5(scarg syscall, scarg arg1, scarg arg2, scarg arg3, scarg arg4, scarg arg5)
221{
222 scarg ret;
223#if defined(__amd64__)
224 register scarg r10 __asm__("r10") = arg4;
225 register scarg r8 __asm__("r8") = arg5;
226 __asm__ __volatile__("syscall"
227 : "=a"(ret)
228 : "a"(syscall), "D"(arg1), "S"(arg2), "d"(arg3), "r"(r10), "r"(r8)
229 : "rcx", "r11", "memory");
230#elif defined(__i386__)
231#warning "i386 syscall wrapper not implemented"
232#elif defined(__arm__)
233#warning "arm syscall wrapper not implemented"
234#elif defined(__aarch64__)
235 register long x8 __asm__("x8") = syscall;
236 register long x0 __asm__("x0") = arg1;
237 register long x1 __asm__("x1") = arg2;
238 register long x2 __asm__("x2") = arg3;
239 register long x3 __asm__("x3") = arg4;
240 register long x4 __asm__("x4") = arg5;
241 __asm__ __volatile__("svc 0"
242 : "=r"(ret)
243 : "r"(x8), "0"(x0), "r"(x1), "r"(x2), "r"(x3), "r"(x4)
244 : "memory", "cc");
245#else
246#error "Unsupported architecture"
247#endif
248 return ret;
249}
250
265static inline scarg syscall6(scarg syscall, scarg arg1, scarg arg2, scarg arg3, scarg arg4, scarg arg5, scarg arg6)
266{
267 scarg ret;
268#if defined(__amd64__)
269 register scarg r10 __asm__("r10") = arg4;
270 register scarg r8 __asm__("r8") = arg5;
271 register scarg r9 __asm__("r9") = arg6;
272 __asm__ __volatile__("syscall"
273 : "=a"(ret)
274 : "a"(syscall), "D"(arg1), "S"(arg2), "d"(arg3), "r"(r10), "r"(r8), "r"(r9)
275 : "rcx", "r11", "memory");
276#elif defined(__i386__)
277#warning "i386 syscall wrapper not implemented"
278#elif defined(__arm__)
279#warning "arm syscall wrapper not implemented"
280#elif defined(__aarch64__)
281 register long x8 __asm__("x8") = syscall;
282 register long x0 __asm__("x0") = arg1;
283 register long x1 __asm__("x1") = arg2;
284 register long x2 __asm__("x2") = arg3;
285 register long x3 __asm__("x3") = arg4;
286 register long x4 __asm__("x4") = arg5;
287 register long x5 __asm__("x5") = arg6;
288 __asm__ __volatile__("svc 0"
289 : "=r"(ret)
290 : "r"(x8), "0"(x0), "r"(x1), "r"(x2), "r"(x3), "r"(x4), "r"(x5)
291 : "memory", "cc");
292#else
293#error "Unsupported architecture"
294#endif
295 return ret;
296}
297
298#pragma endregion Syscall Wrappers
299
307#define __SYS_NULL ((void *)0)
308
322
338
346
354#ifdef __kernel__
355typedef syscall_prctl_options_t prctl_options_t;
356#endif
357
364
365typedef enum
366{
368 /* Process abort signal. */
370 /* Alarm clock. */
372 /* Access to an undefined portion of a memory object. */
374 /* Child process terminated, stopped, or continued. */
376 /* Continue executing, if stopped. */
378 /* Erroneous arithmetic operation. */
380 /* Hangup. */
382 /* Illegal instruction. */
384 /* Terminal interrupt signal. */
386 /* Kill (cannot be caught or ignored). */
388 /* Write on a pipe with no one to read it. */
390 /* Terminal quit signal. */
392 /* Invalid memory reference. */
394 /* Stop executing (cannot be caught or ignored). */
396 /* Termination signal. */
398 /* Terminal stop signal. */
400 /* Background process attempting read. */
402 /* Background process attempting write. */
404 /* User-defined signal 1. */
406 /* User-defined signal 2. */
408 /* Pollable event. */
410 /* Profiling timer expired. */
412 /* Bad system call. */
414 /* Trace/breakpoint trap. */
416 /* High bandwidth data is available at a socket. */
418 /* Virtual timer expired. */
420 /* CPU time limit exceeded. */
422 /* File size limit exceeded. */
424
432
433 /* Real-time signals. */
467
468 /* Maximum signal number. */
471#ifdef __kernel__
472typedef syscall_signal_t signal_t;
473#endif
474
488#ifdef __kernel__
489typedef syscall_signal_disposition_t signal_disposition_t;
490#endif
491
498
509
516
524
525#ifndef __cplusplus
526_Static_assert((int)__SYS_SIG_IGN == (int)___SYS_SIG_IGN, "SIG_IGN values do not match");
527#else
528static_assert((int)__SYS_SIG_IGN == (int)___SYS_SIG_IGN, "SIG_IGN values do not match");
529#endif
530
531typedef int __SYS_clockid_t;
532typedef unsigned int __SYS_socklen_t;
533
1525
1526/* Initialization */
1527
1529#define call_api_version(version) syscall1(SYS_API_VERSION, (scarg)version)
1530
1531/* I/O */
1532
1534#define call_read(fd, buf, count) syscall3(SYS_READ, (scarg)fd, (scarg)buf, (scarg)count)
1535
1537#define call_pread(fd, buf, count, offset) syscall4(SYS_PREAD, (scarg)fd, (scarg)buf, (scarg)count, (scarg)offset)
1538
1540#define call_write(fd, buf, count) syscall3(SYS_WRITE, (scarg)fd, (scarg)buf, (scarg)count)
1541
1543#define call_pwrite(fd, buf, count, offset) syscall4(SYS_PWRITE, (scarg)fd, (scarg)buf, (scarg)count, (scarg)offset)
1544
1546#define call_open(pathname, flags, mode) syscall3(SYS_OPEN, (scarg)pathname, (scarg)flags, (scarg)mode)
1547
1549#define call_close(fd) syscall1(SYS_CLOSE, fd)
1550
1552#define call_ioctl(fd, request, argp) syscall3(SYS_IOCTL, (scarg)fd, (scarg)request, (scarg)argp)
1553
1554/* File Status */
1555
1557#define call_stat(pathname, statbuf) syscall2(SYS_STAT, (scarg)pathname, (scarg)statbuf)
1558
1560#define call_fstat(fd, statbuf) syscall2(SYS_FSTAT, (scarg)fd, (scarg)statbuf)
1561
1563#define call_lstat(pathname, statbuf) syscall2(SYS_LSTAT, (scarg)pathname, (scarg)statbuf)
1564
1566#define call_access(pathname, mode) syscall2(SYS_ACCESS, (scarg)pathname, (scarg)mode)
1567
1569#define call_truncate(pathname, length) syscall2(SYS_TRUNCATE, (scarg)pathname, (scarg)length)
1570
1572#define call_ftruncate(fd, length) syscall2(SYS_FTRUNCATE, (scarg)fd, (scarg)length)
1573
1575#define call_tell(fd) syscall1(SYS_TELL, (scarg)fd)
1576
1578#define call_seek(fd, offset, whence) syscall3(SYS_SEEK, (scarg)fd, (scarg)offset, (scarg)whence)
1579
1580/* Process Control */
1581
1583#define call_exit(status) syscall1(SYS_EXIT, (scarg)status)
1584
1586#define call_fork() syscall0(SYS_FORK)
1587
1589#define call_execve(pathname, argv, envp) syscall3(SYS_EXECVE, (scarg)pathname, (scarg)argv, (scarg)envp)
1590
1592#define call_getpid() syscall0(SYS_GETPID)
1593
1595#define call_getppid() syscall0(SYS_GETPPID)
1596
1598#define call_waitpid(pid, wstatus, options) syscall3(SYS_WAITPID, (scarg)pid, (scarg)wstatus, (scarg)options)
1599
1601#define call_kill(pid, sig) syscall2(SYS_KILL, (scarg)pid, (scarg)sig)
1602
1604#define call_prctl(option, arg1, arg2, arg3, arg4) syscall5(SYS_PRCTL, (scarg)option, (scarg)arg1, (scarg)arg2, (scarg)arg3, (scarg)arg4)
1605
1606/* Memory */
1607
1609#define call_brk(end_data) syscall1(SYS_BRK, (scarg)end_data)
1610
1612#define call_mmap(addr, length, prot, flags, fd, offset) syscall6(SYS_MMAP, (scarg)addr, (scarg)length, (scarg)prot, (scarg)flags, (scarg)fd, (scarg)offset)
1613
1615#define call_munmap(addr, length) syscall2(SYS_MUNMAP, (scarg)addr, (scarg)length)
1616
1618#define call_mprotect(addr, length, prot) syscall3(SYS_MPROTECT, (scarg)addr, (scarg)length, (scarg)prot)
1619
1621#define call_madvise(addr, length, advice) syscall3(SYS_MADVISE, (scarg)addr, (scarg)length, (scarg)advice)
1622
1623/* Communication */
1624
1626#define call_pipe(pipefd) syscall1(SYS_PIPE, (scarg)pipefd)
1627
1629#define call_dup(oldfd) syscall1(SYS_DUP, (scarg)oldfd)
1630
1632#define call_dup2(oldfd, newfd) syscall2(SYS_DUP2, (scarg)oldfd, (scarg)newfd)
1633
1635#define call_socket(domain, type, protocol) syscall3(SYS_SOCKET, (scarg)domain, (scarg)type, (scarg)protocol)
1636
1638#define call_bind(sockfd, addr, addrlen) syscall3(SYS_BIND, (scarg)sockfd, (scarg)addr, (scarg)addrlen)
1639
1641#define call_connect(sockfd, addr, addrlen) syscall3(SYS_CONNECT, (scarg)sockfd, (scarg)addr, (scarg)addrlen)
1642
1644#define call_listen(sockfd, backlog) syscall2(SYS_LISTEN, (scarg)sockfd, (scarg)backlog)
1645
1647#define call_accept(sockfd, addr, addrlen) syscall3(SYS_ACCEPT, (scarg)sockfd, (scarg)addr, (scarg)addrlen)
1648
1650#define call_send(sockfd, buf, len, flags) syscall4(SYS_SEND, (scarg)sockfd, (scarg)buf, (scarg)len, (scarg)flags)
1651
1653#define call_recv(sockfd, buf, len, flags) syscall4(SYS_RECV, (scarg)sockfd, (scarg)buf, (scarg)len, (scarg)flags)
1654
1656#define call_shutdown(sockfd, how) syscall2(SYS_SHUTDOWN, (scarg)sockfd, (scarg)how)
1657
1658/* Time */
1659
1661#define call_time(t) syscall1(SYS_TIME, t)
1662
1664#define call_clock_gettime(clockid, tp) syscall2(SYS_CLOCK_GETTIME, (scarg)clockid, (scarg)tp)
1665
1667#define call_clock_settime(clockid, tp) syscall2(SYS_CLOCK_SETTIME, (scarg)clockid, (scarg)tp)
1668
1670#define call_nanosleep(req, rem) syscall2(SYS_NANOSLEEP, (scarg)req, (scarg)rem)
1671
1672/* Miscellaneous */
1673
1675#define call_getcwd(buf, size) syscall2(SYS_GETCWD, (scarg)buf, (scarg)size)
1676
1678#define call_chdir(path) syscall1(SYS_CHDIR, (scarg)path)
1679
1681#define call_mkdir(path, mode) syscall2(SYS_MKDIR, (scarg)path, (scarg)mode)
1682
1684#define call_rmdir(path) syscall1(SYS_RMDIR, (scarg)path)
1685
1687#define call_unlink(pathname) syscall1(SYS_UNLINK, (scarg)pathname)
1688
1690#define call_rename(oldpath, newpath) syscall2(SYS_RENAME, (scarg)oldpath, (scarg)newpath)
1691
1692#endif // !__FENNIX_API_SYSCALLS_LIST_H__
syscall_signal_t
Definition syscalls.h:366
@ __SYS_SIGRTMAX
Definition syscalls.h:466
@ __SYS_SIGRT_11
Definition syscalls.h:445
@ __SYS_SIGRT_7
Definition syscalls.h:441
@ __SYS_SIGTTIN
Definition syscalls.h:401
@ __SYS_SIGUSR1
Definition syscalls.h:405
@ __SYS_SIGTSTP
Definition syscalls.h:399
@ __SYS_SIGTERM
Definition syscalls.h:397
@ __SYS_SIGPOLL
Definition syscalls.h:409
@ __SYS_SIGFPE
Definition syscalls.h:379
@ __SYS_SIGKILL
Definition syscalls.h:387
@ __SYS_SIGCOMP3
Definition syscalls.h:431
@ __SYS_SIGRT_29
Definition syscalls.h:463
@ __SYS_SIGRT_9
Definition syscalls.h:443
@ __SYS_SIGRT_1
Definition syscalls.h:435
@ __SYS_SIGRT_23
Definition syscalls.h:457
@ __SYS_SIGQUIT
Definition syscalls.h:391
@ __SYS_SIGURG
Definition syscalls.h:417
@ __SYS_SIGRT_15
Definition syscalls.h:449
@ __SYS_SIGBUS
Definition syscalls.h:373
@ __SYS_SIGTRAP
Definition syscalls.h:415
@ __SYS_SIGRT_3
Definition syscalls.h:437
@ __SYS_SIGRT_13
Definition syscalls.h:447
@ __SYS_SIGCOMP1
Definition syscalls.h:429
@ __SYS_SIGRT_4
Definition syscalls.h:438
@ __SYS_SIGRT_24
Definition syscalls.h:458
@ __SYS_SIGRT_17
Definition syscalls.h:451
@ __SYS_SIGNULL
Definition syscalls.h:367
@ __SYS_SIGCOMP2
Definition syscalls.h:430
@ __SYS_SIGABRT
Definition syscalls.h:369
@ __SYS_SIGRT_5
Definition syscalls.h:439
@ __SYS_SIGTTOU
Definition syscalls.h:403
@ __SYS_SIGNAL_MAX
Definition syscalls.h:469
@ __SYS_SIGALRM
Definition syscalls.h:371
@ __SYS_SIGRT_28
Definition syscalls.h:462
@ __SYS_SIGXFSZ
Definition syscalls.h:423
@ __SYS_SIGINT
Definition syscalls.h:385
@ __SYS_SIGSEGV
Definition syscalls.h:393
@ __SYS_SIGVTALRM
Definition syscalls.h:419
@ __SYS_SIGCONT
Definition syscalls.h:377
@ __SYS_SIGRT_30
Definition syscalls.h:464
@ __SYS_SIGSTOP
Definition syscalls.h:395
@ __SYS_SIGRT_25
Definition syscalls.h:459
@ __SYS_SIGRT_12
Definition syscalls.h:446
@ __SYS_SIGHUP
Definition syscalls.h:381
@ __SYS_SIGRTMIN
Definition syscalls.h:434
@ __SYS_SIGPIPE
Definition syscalls.h:389
@ __SYS_SIGXCPU
Definition syscalls.h:421
@ __SYS_SIGRT_20
Definition syscalls.h:454
@ __SYS_SIGRT_10
Definition syscalls.h:444
@ __SYS_SIGRT_26
Definition syscalls.h:460
@ __SYS_SIGRT_31
Definition syscalls.h:465
@ __SYS_SIGRT_16
Definition syscalls.h:450
@ __SYS_SIGRT_14
Definition syscalls.h:448
@ __SYS_SIGRT_18
Definition syscalls.h:452
@ __SYS_SIGRT_8
Definition syscalls.h:442
@ __SYS_SIGRT_2
Definition syscalls.h:436
@ __SYS_SIGSYS
Definition syscalls.h:413
@ __SYS_SIGRT_21
Definition syscalls.h:455
@ __SYS_SIGRT_22
Definition syscalls.h:456
@ __SYS_SIGCHLD
Definition syscalls.h:375
@ __SYS_SIGRT_19
Definition syscalls.h:453
@ __SYS_SIGRT_27
Definition syscalls.h:461
@ __SYS_SIGPROF
Definition syscalls.h:411
@ __SYS_SIGILL
Definition syscalls.h:383
@ __SYS_SIGUSR2
Definition syscalls.h:407
@ __SYS_SIGRT_6
Definition syscalls.h:440
syscall_open_flags_t
Definition syscalls.h:324
@ __SYS_O_RDWR
Definition syscalls.h:327
@ __SYS_O_DSYNC
Definition syscalls.h:330
@ __SYS_O_NONBLOCK
Definition syscalls.h:333
@ __SYS_O_RDONLY
Definition syscalls.h:325
@ __SYS_O_RSYNC
Definition syscalls.h:334
@ __SYS_O_WRONLY
Definition syscalls.h:326
@ __SYS_O_NOCTTY
Definition syscalls.h:332
@ __SYS_O_EXCL
Definition syscalls.h:331
@ __SYS_O_APPEND
Definition syscalls.h:328
@ __SYS_O_SYNC
Definition syscalls.h:335
@ __SYS_O_TRUNC
Definition syscalls.h:336
@ __SYS_O_CREAT
Definition syscalls.h:329
syscall_seek_whence_t
Definition syscalls.h:359
@ __SYS_SEEK_CUR
Definition syscalls.h:361
@ __SYS_SEEK_SET
Definition syscalls.h:360
@ __SYS_SEEK_END
Definition syscalls.h:362
syscall_access_flags_t
Definition syscalls.h:340
@ __SYS_X_OK
Definition syscalls.h:344
@ __SYS_R_OK
Definition syscalls.h:342
@ __SYS_F_OK
Definition syscalls.h:341
@ __SYS_W_OK
Definition syscalls.h:343
unsigned int __SYS_socklen_t
Definition syscalls.h:532
#define scarg
Definition syscalls.h:23
syscall_signal_disposition_t
Definition syscalls.h:476
@ __SYS_SIG_TERM
Definition syscalls.h:478
@ __SYS_SIG_STOP
Definition syscalls.h:484
@ __SYS_SIG_CORE
Definition syscalls.h:486
@ __SYS_SIG_CONT
Definition syscalls.h:482
@ __SYS_SIG_IGN
Definition syscalls.h:480
syscalls_t
List of syscalls.
Definition syscalls.h:541
@ SYS_UNLINK
Remove a file.
Definition syscalls.h:1492
@ SYS_MMAP
Map files or devices into memory.
Definition syscalls.h:1081
@ SYS_SHUTDOWN
Shut down part of a full-duplex connection.
Definition syscalls.h:1334
@ SYS_RECV
Receive data on a socket.
Definition syscalls.h:1317
@ SYS_MAX
Max number of syscalls.
Definition syscalls.h:1523
@ SYS_STAT
Retrieve file status.
Definition syscalls.h:742
@ SYS_WRITE
Write to a file descriptor.
Definition syscalls.h:631
@ SYS_NANOSLEEP
Sleep for a specified time.
Definition syscalls.h:1404
@ SYS_TELL
Get the current file offset.
Definition syscalls.h:858
@ SYS_TRUNCATE
Change the size of a file.
Definition syscalls.h:824
@ SYS_PIPE
Create a pipe.
Definition syscalls.h:1156
@ SYS_RMDIR
Remove an empty directory.
Definition syscalls.h:1475
@ SYS_READ
Read from a file descriptor.
Definition syscalls.h:588
@ SYS_GETPPID
Get the parent process ID.
Definition syscalls.h:962
@ SYS_CLOSE
Close a file descriptor.
Definition syscalls.h:702
@ SYS_MADVISE
Provide advice about memory usage.
Definition syscalls.h:1136
@ SYS_EXECVE
Execute a program.
Definition syscalls.h:936
@ SYS_LISTEN
Listen for incoming connections on a socket.
Definition syscalls.h:1261
@ SYS_WAITPID
Wait for a child process to change state.
Definition syscalls.h:980
@ SYS_BRK
Set the program break.
Definition syscalls.h:1038
@ SYS_MUNMAP
Unmap a mapped memory region.
Definition syscalls.h:1099
@ SYS_EXIT
Terminate the calling process.
Definition syscalls.h:900
@ SYS_OPEN
Open a file.
Definition syscalls.h:686
@ SYS_CONNECT
Connect to a remote address.
Definition syscalls.h:1244
@ SYS_IOCTL
Control a device.
Definition syscalls.h:721
@ SYS_PREAD
Read from a file descriptor.
Definition syscalls.h:610
@ SYS_RENAME
Rename a file or directory.
Definition syscalls.h:1510
@ SYS_GETPID
Get the process ID of the calling process.
Definition syscalls.h:949
@ SYS_FSTAT
Retrieve file status for an open file descriptor.
Definition syscalls.h:760
@ SYS_PWRITE
Write to a file descriptor.
Definition syscalls.h:652
@ SYS_BIND
Bind a socket to a local address.
Definition syscalls.h:1226
@ SYS_TIME
Get the current time.
Definition syscalls.h:1353
@ SYS_DUP
Duplicate a file descriptor.
Definition syscalls.h:1172
@ SYS_SOCKET
Create an endpoint for communication.
Definition syscalls.h:1208
@ SYS_CLOCK_SETTIME
Set the current time of a specific clock.
Definition syscalls.h:1387
@ SYS_API_VERSION
Set syscall version.
Definition syscalls.h:564
@ SYS_FORK
Create a child process.
Definition syscalls.h:916
@ SYS_SEND
Send data on a socket.
Definition syscalls.h:1298
@ SYS_PRCTL
Process/Thread Control.
Definition syscalls.h:1019
@ SYS_LSTAT
Retrieve file status with symbolic link resolution.
Definition syscalls.h:779
@ SYS_DUP2
Duplicate a file descriptor to a specific value.
Definition syscalls.h:1190
@ SYS_KILL
Send a signal to a process.
Definition syscalls.h:998
@ SYS_MPROTECT
Change memory protection.
Definition syscalls.h:1117
@ SYS_MKDIR
Create a new directory.
Definition syscalls.h:1459
@ SYS_CHDIR
Change the current working directory.
Definition syscalls.h:1441
@ SYS_ACCEPT
Accept an incoming connection on a socket.
Definition syscalls.h:1279
@ SYS_FTRUNCATE
Change the size of a file referred by a file descriptor.
Definition syscalls.h:842
@ SYS_SEEK
Set the file offset.
Definition syscalls.h:882
@ SYS_GETCWD
Get the current working directory.
Definition syscalls.h:1424
@ SYS_CLOCK_GETTIME
Get the current time of a specific clock.
Definition syscalls.h:1370
@ SYS_ACCESS
Check a file's accessibility.
Definition syscalls.h:805
static scarg syscall6(scarg syscall, scarg arg1, scarg arg2, scarg arg3, scarg arg4, scarg arg5, scarg arg6)
Syscall wrapper with 6 arguments.
Definition syscalls.h:265
syscall_clockid_t
Definition syscalls.h:518
@ __SYS_CLOCK_PROCESS_CPUTIME_ID
Definition syscalls.h:520
@ __SYS_CLOCK_REALTIME
Definition syscalls.h:521
@ __SYS_CLOCK_THREAD_CPUTIME_ID
Definition syscalls.h:522
@ __SYS_CLOCK_MONOTONIC
Definition syscalls.h:519
syscall_mmap_flags_t
Definition syscalls.h:310
@ __SYS_MAP_ANON
Definition syscalls.h:320
@ __SYS_PROT_NONE
Definition syscalls.h:314
@ __SYS_PROT_READ
Definition syscalls.h:311
@ __SYS_MAP_FIXED
Definition syscalls.h:318
@ __SYS_MAP_SHARED
Definition syscalls.h:316
@ __SYS_PROT_EXEC
Definition syscalls.h:313
@ __SYS_PROT_WRITE
Definition syscalls.h:312
@ __SYS_MAP_PRIVATE
Definition syscalls.h:317
@ __SYS_MAP_ANONYMOUS
Definition syscalls.h:319
syscall_prctl_options_t
Definition syscalls.h:348
@ __SYS_GET_FS
Definition syscalls.h:351
@ __SYS_SET_GS
Definition syscalls.h:350
@ __SYS_GET_GS
Definition syscalls.h:349
@ __SYS_SET_FS
Definition syscalls.h:352
static scarg syscall5(scarg syscall, scarg arg1, scarg arg2, scarg arg3, scarg arg4, scarg arg5)
Syscall wrapper with 5 arguments.
Definition syscalls.h:220
static scarg syscall4(scarg syscall, scarg arg1, scarg arg2, scarg arg3, scarg arg4)
Syscall wrapper with 4 arguments.
Definition syscalls.h:178
static scarg syscall1(scarg syscall, scarg arg1)
Syscall wrapper with 1 argument.
Definition syscalls.h:67
syscall_signal_actions_t
Definition syscalls.h:493
@ __SYS_SIG_UNBLOCK
Definition syscalls.h:495
@ __SYS_SIG_SETMASK
Definition syscalls.h:496
@ __SYS_SIG_BLOCK
Definition syscalls.h:494
static scarg syscall0(scarg syscall)
Syscall wrapper with 0 arguments.
Definition syscalls.h:33
syscall_signal_action_flags_t
Definition syscalls.h:500
@ __SYS_SA_SIGINFO
Definition syscalls.h:505
@ __SYS_SA_RESTART
Definition syscalls.h:504
@ __SYS_SA_RESETHAND
Definition syscalls.h:503
@ __SYS_SA_ONSTACK
Definition syscalls.h:502
@ __SYS_SA_NODEFER
Definition syscalls.h:507
@ __SYS_SA_NOCLDSTOP
Definition syscalls.h:501
@ __SYS_SA_NOCLDWAIT
Definition syscalls.h:506
static scarg syscall2(scarg syscall, scarg arg1, scarg arg2)
Syscall wrapper with 2 arguments.
Definition syscalls.h:102
syscall_signal_action_disposition_t
Definition syscalls.h:511
@ __SYS_SIG_ERR
Definition syscalls.h:512
@ ___SYS_SIG_IGN
Definition syscalls.h:514
@ __SYS_SIG_DFL
Definition syscalls.h:513
static scarg syscall3(scarg syscall, scarg arg1, scarg arg2, scarg arg3)
Syscall wrapper with 3 arguments.
Definition syscalls.h:139
int __SYS_clockid_t
Definition syscalls.h:531