Fennix  1.0.0
Full Documentation
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 
33 static inline scarg syscall0(scarg syscall)
34 {
35  scarg ret;
36  __asm__ __volatile__("syscall"
37  : "=a"(ret)
38  : "a"(syscall)
39  : "rcx", "r11", "memory");
40  return ret;
41 }
42 
52 static inline scarg syscall1(scarg syscall, scarg arg1)
53 {
54  scarg ret;
55  __asm__ __volatile__("syscall"
56  : "=a"(ret)
57  : "a"(syscall), "D"(arg1)
58  : "rcx", "r11", "memory");
59  return ret;
60 }
61 
72 static inline scarg syscall2(scarg syscall, scarg arg1, scarg arg2)
73 {
74  scarg ret;
75  __asm__ __volatile__("syscall"
76  : "=a"(ret)
77  : "a"(syscall), "D"(arg1), "S"(arg2)
78  : "rcx", "r11", "memory");
79  return ret;
80 }
81 
93 static inline scarg syscall3(scarg syscall, scarg arg1, scarg arg2, scarg arg3)
94 {
95  scarg ret;
96  __asm__ __volatile__("syscall"
97  : "=a"(ret)
98  : "a"(syscall), "D"(arg1), "S"(arg2), "d"(arg3)
99  : "rcx", "r11", "memory");
100  return ret;
101 }
102 
115 static inline scarg syscall4(scarg syscall, scarg arg1, scarg arg2, scarg arg3, scarg arg4)
116 {
117  scarg ret;
118  register scarg r10 __asm__("r10") = arg4;
119  __asm__ __volatile__("syscall"
120  : "=a"(ret)
121  : "a"(syscall), "D"(arg1), "S"(arg2), "d"(arg3), "r"(r10)
122  : "rcx", "r11", "memory");
123  return ret;
124 }
125 
139 static inline scarg syscall5(scarg syscall, scarg arg1, scarg arg2, scarg arg3, scarg arg4, scarg arg5)
140 {
141  scarg ret;
142  register scarg r10 __asm__("r10") = arg4;
143  register scarg r8 __asm__("r8") = arg5;
144  __asm__ __volatile__("syscall"
145  : "=a"(ret)
146  : "a"(syscall), "D"(arg1), "S"(arg2), "d"(arg3), "r"(r10), "r"(r8)
147  : "rcx", "r11", "memory");
148  return ret;
149 }
150 
165 static inline scarg syscall6(scarg syscall, scarg arg1, scarg arg2, scarg arg3, scarg arg4, scarg arg5, scarg arg6)
166 {
167  scarg ret;
168  register scarg r10 __asm__("r10") = arg4;
169  register scarg r8 __asm__("r8") = arg5;
170  register scarg r9 __asm__("r9") = arg6;
171  __asm__ __volatile__("syscall"
172  : "=a"(ret)
173  : "a"(syscall), "D"(arg1), "S"(arg2), "d"(arg3), "r"(r10), "r"(r8), "r"(r9)
174  : "rcx", "r11", "memory");
175  return ret;
176 }
177 
178 #pragma endregion Syscall Wrappers
179 
187 #define __SYS_NULL ((void *)0)
188 
189 typedef enum
190 {
195 
202 
203 typedef enum
204 {
211  __SYS_O_EXCL = 0x20,
214  __SYS_O_RSYNC = 0x100,
215  __SYS_O_SYNC = 0x200,
216  __SYS_O_TRUNC = 0x400
218 
219 typedef enum
220 {
224  __SYS_X_OK = 3
226 
227 typedef enum
228 {
234 #ifdef __kernel__
235 typedef syscall_prctl_options_t prctl_options_t;
236 #endif
237 
238 typedef enum
239 {
242  __SYS_SEEK_END = 2
244 
245 typedef enum
246 {
248  /* Process abort signal. */
250  /* Alarm clock. */
252  /* Access to an undefined portion of a memory object. */
254  /* Child process terminated, stopped, or continued. */
256  /* Continue executing, if stopped. */
258  /* Erroneous arithmetic operation. */
260  /* Hangup. */
262  /* Illegal instruction. */
264  /* Terminal interrupt signal. */
266  /* Kill (cannot be caught or ignored). */
268  /* Write on a pipe with no one to read it. */
270  /* Terminal quit signal. */
272  /* Invalid memory reference. */
274  /* Stop executing (cannot be caught or ignored). */
276  /* Termination signal. */
278  /* Terminal stop signal. */
280  /* Background process attempting read. */
282  /* Background process attempting write. */
284  /* User-defined signal 1. */
286  /* User-defined signal 2. */
288  /* Pollable event. */
290  /* Profiling timer expired. */
292  /* Bad system call. */
294  /* Trace/breakpoint trap. */
296  /* High bandwidth data is available at a socket. */
298  /* Virtual timer expired. */
300  /* CPU time limit exceeded. */
302  /* File size limit exceeded. */
304 
312 
313  /* Real-time signals. */
347 
348  /* Maximum signal number. */
351 #ifdef __kernel__
352 typedef syscall_signal_t signal_t;
353 #endif
354 
355 typedef enum
356 {
366  __SYS_SIG_CORE = 4
368 #ifdef __kernel__
369 typedef syscall_signal_disposition_t signal_disposition_t;
370 #endif
371 
372 typedef enum
373 {
378 
379 typedef enum
380 {
382  __SYS_SA_ONSTACK = 0x08000000,
383  __SYS_SA_RESETHAND = 0x80000000,
384  __SYS_SA_RESTART = 0x10000000,
387  __SYS_SA_NODEFER = 0x40000000,
389 
390 typedef enum
391 {
394  ___SYS_SIG_IGN = 1
396 
397 typedef enum
398 {
404 
405 #ifndef __cplusplus
406 _Static_assert((int)__SYS_SIG_IGN == (int)___SYS_SIG_IGN, "SIG_IGN values do not match");
407 #else
408 static_assert((int)__SYS_SIG_IGN == (int)___SYS_SIG_IGN, "SIG_IGN values do not match");
409 #endif
410 
411 typedef int __SYS_clockid_t;
412 typedef unsigned int __SYS_socklen_t;
413 
420 typedef enum
421 {
422  /* Initialization */
423 
445 
446  /* I/O */
447 
468  SYS_READ = 100,
602 
603  /* File Status */
604 
622  SYS_STAT = 200,
763 
764  /* Process Control */
765 
780  SYS_EXIT = 300,
900 
901  /* Memory */
902 
918  SYS_BRK = 400,
1017 
1018  /* Communication */
1019 
1036  SYS_PIPE = 500,
1215 
1216  /* Time */
1217 
1233  SYS_TIME = 600,
1285 
1286  /* Miscellaneous */
1287 
1304  SYS_GETCWD = 700,
1391 
1403  SYS_MAX
1405 
1406 /* Initialization */
1407 
1409 #define call_api_version(version) syscall1(SYS_API_VERSION, (scarg)version)
1410 
1411 /* I/O */
1412 
1414 #define call_read(fd, buf, count) syscall3(SYS_READ, (scarg)fd, (scarg)buf, (scarg)count)
1415 
1417 #define call_pread(fd, buf, count, offset) syscall4(SYS_PREAD, (scarg)fd, (scarg)buf, (scarg)count, (scarg)offset)
1418 
1420 #define call_write(fd, buf, count) syscall3(SYS_WRITE, (scarg)fd, (scarg)buf, (scarg)count)
1421 
1423 #define call_pwrite(fd, buf, count, offset) syscall4(SYS_PWRITE, (scarg)fd, (scarg)buf, (scarg)count, (scarg)offset)
1424 
1426 #define call_open(pathname, flags, mode) syscall3(SYS_OPEN, (scarg)pathname, (scarg)flags, (scarg)mode)
1427 
1429 #define call_close(fd) syscall1(SYS_CLOSE, fd)
1430 
1432 #define call_ioctl(fd, request, argp) syscall3(SYS_IOCTL, (scarg)fd, (scarg)request, (scarg)argp)
1433 
1434 /* File Status */
1435 
1437 #define call_stat(pathname, statbuf) syscall2(SYS_STAT, (scarg)pathname, (scarg)statbuf)
1438 
1440 #define call_fstat(fd, statbuf) syscall2(SYS_FSTAT, (scarg)fd, (scarg)statbuf)
1441 
1443 #define call_lstat(pathname, statbuf) syscall2(SYS_LSTAT, (scarg)pathname, (scarg)statbuf)
1444 
1446 #define call_access(pathname, mode) syscall2(SYS_ACCESS, (scarg)pathname, (scarg)mode)
1447 
1449 #define call_truncate(pathname, length) syscall2(SYS_TRUNCATE, (scarg)pathname, (scarg)length)
1450 
1452 #define call_ftruncate(fd, length) syscall2(SYS_FTRUNCATE, (scarg)fd, (scarg)length)
1453 
1455 #define call_tell(fd) syscall1(SYS_TELL, (scarg)fd)
1456 
1458 #define call_seek(fd, offset, whence) syscall3(SYS_SEEK, (scarg)fd, (scarg)offset, (scarg)whence)
1459 
1460 /* Process Control */
1461 
1463 #define call_exit(status) syscall1(SYS_EXIT, (scarg)status)
1464 
1466 #define call_fork() syscall0(SYS_FORK)
1467 
1469 #define call_execve(pathname, argv, envp) syscall3(SYS_EXECVE, (scarg)pathname, (scarg)argv, (scarg)envp)
1470 
1472 #define call_getpid() syscall0(SYS_GETPID)
1473 
1475 #define call_getppid() syscall0(SYS_GETPPID)
1476 
1478 #define call_waitpid(pid, wstatus, options) syscall3(SYS_WAITPID, (scarg)pid, (scarg)wstatus, (scarg)options)
1479 
1481 #define call_kill(pid, sig) syscall2(SYS_KILL, (scarg)pid, (scarg)sig)
1482 
1484 #define call_prctl(option, arg1, arg2, arg3, arg4) syscall5(SYS_PRCTL, (scarg)option, (scarg)arg1, (scarg)arg2, (scarg)arg3, (scarg)arg4)
1485 
1486 /* Memory */
1487 
1489 #define call_brk(end_data) syscall1(SYS_BRK, (scarg)end_data)
1490 
1492 #define call_mmap(addr, length, prot, flags, fd, offset) syscall6(SYS_MMAP, (scarg)addr, (scarg)length, (scarg)prot, (scarg)flags, (scarg)fd, (scarg)offset)
1493 
1495 #define call_munmap(addr, length) syscall2(SYS_MUNMAP, (scarg)addr, (scarg)length)
1496 
1498 #define call_mprotect(addr, length, prot) syscall3(SYS_MPROTECT, (scarg)addr, (scarg)length, (scarg)prot)
1499 
1501 #define call_madvise(addr, length, advice) syscall3(SYS_MADVISE, (scarg)addr, (scarg)length, (scarg)advice)
1502 
1503 /* Communication */
1504 
1506 #define call_pipe(pipefd) syscall1(SYS_PIPE, (scarg)pipefd)
1507 
1509 #define call_dup(oldfd) syscall1(SYS_DUP, (scarg)oldfd)
1510 
1512 #define call_dup2(oldfd, newfd) syscall2(SYS_DUP2, (scarg)oldfd, (scarg)newfd)
1513 
1515 #define call_socket(domain, type, protocol) syscall3(SYS_SOCKET, (scarg)domain, (scarg)type, (scarg)protocol)
1516 
1518 #define call_bind(sockfd, addr, addrlen) syscall3(SYS_BIND, (scarg)sockfd, (scarg)addr, (scarg)addrlen)
1519 
1521 #define call_connect(sockfd, addr, addrlen) syscall3(SYS_CONNECT, (scarg)sockfd, (scarg)addr, (scarg)addrlen)
1522 
1524 #define call_listen(sockfd, backlog) syscall2(SYS_LISTEN, (scarg)sockfd, (scarg)backlog)
1525 
1527 #define call_accept(sockfd, addr, addrlen) syscall3(SYS_ACCEPT, (scarg)sockfd, (scarg)addr, (scarg)addrlen)
1528 
1530 #define call_send(sockfd, buf, len, flags) syscall4(SYS_SEND, (scarg)sockfd, (scarg)buf, (scarg)len, (scarg)flags)
1531 
1533 #define call_recv(sockfd, buf, len, flags) syscall4(SYS_RECV, (scarg)sockfd, (scarg)buf, (scarg)len, (scarg)flags)
1534 
1536 #define call_shutdown(sockfd, how) syscall2(SYS_SHUTDOWN, (scarg)sockfd, (scarg)how)
1537 
1538 /* Time */
1539 
1541 #define call_time(t) syscall1(SYS_TIME, t)
1542 
1544 #define call_clock_gettime(clockid, tp) syscall2(SYS_CLOCK_GETTIME, (scarg)clockid, (scarg)tp)
1545 
1547 #define call_clock_settime(clockid, tp) syscall2(SYS_CLOCK_SETTIME, (scarg)clockid, (scarg)tp)
1548 
1550 #define call_nanosleep(req, rem) syscall2(SYS_NANOSLEEP, (scarg)req, (scarg)rem)
1551 
1552 /* Miscellaneous */
1553 
1555 #define call_getcwd(buf, size) syscall2(SYS_GETCWD, (scarg)buf, (scarg)size)
1556 
1558 #define call_chdir(path) syscall1(SYS_CHDIR, (scarg)path)
1559 
1561 #define call_mkdir(path, mode) syscall2(SYS_MKDIR, (scarg)path, (scarg)mode)
1562 
1564 #define call_rmdir(path) syscall1(SYS_RMDIR, (scarg)path)
1565 
1567 #define call_unlink(pathname) syscall1(SYS_UNLINK, (scarg)pathname)
1568 
1570 #define call_rename(oldpath, newpath) syscall2(SYS_RENAME, (scarg)oldpath, (scarg)newpath)
1571 
1572 #endif // !__FENNIX_API_SYSCALLS_LIST_H__
#define static_assert
Definition: fs.h:132
_Static_assert((int) __SYS_SIG_IGN==(int) ___SYS_SIG_IGN, "SIG_IGN values do not match")
syscall_signal_t
Definition: syscalls.h:246
@ __SYS_SIGRTMAX
Definition: syscalls.h:346
@ __SYS_SIGRT_11
Definition: syscalls.h:325
@ __SYS_SIGRT_7
Definition: syscalls.h:321
@ __SYS_SIGTTIN
Definition: syscalls.h:281
@ __SYS_SIGUSR1
Definition: syscalls.h:285
@ __SYS_SIGTSTP
Definition: syscalls.h:279
@ __SYS_SIGTERM
Definition: syscalls.h:277
@ __SYS_SIGPOLL
Definition: syscalls.h:289
@ __SYS_SIGFPE
Definition: syscalls.h:259
@ __SYS_SIGKILL
Definition: syscalls.h:267
@ __SYS_SIGCOMP3
Definition: syscalls.h:311
@ __SYS_SIGRT_29
Definition: syscalls.h:343
@ __SYS_SIGRT_9
Definition: syscalls.h:323
@ __SYS_SIGRT_1
Definition: syscalls.h:315
@ __SYS_SIGRT_23
Definition: syscalls.h:337
@ __SYS_SIGQUIT
Definition: syscalls.h:271
@ __SYS_SIGURG
Definition: syscalls.h:297
@ __SYS_SIGRT_15
Definition: syscalls.h:329
@ __SYS_SIGBUS
Definition: syscalls.h:253
@ __SYS_SIGTRAP
Definition: syscalls.h:295
@ __SYS_SIGRT_3
Definition: syscalls.h:317
@ __SYS_SIGRT_13
Definition: syscalls.h:327
@ __SYS_SIGCOMP1
Definition: syscalls.h:309
@ __SYS_SIGRT_4
Definition: syscalls.h:318
@ __SYS_SIGRT_24
Definition: syscalls.h:338
@ __SYS_SIGRT_17
Definition: syscalls.h:331
@ __SYS_SIGNULL
Definition: syscalls.h:247
@ __SYS_SIGCOMP2
Definition: syscalls.h:310
@ __SYS_SIGABRT
Definition: syscalls.h:249
@ __SYS_SIGRT_5
Definition: syscalls.h:319
@ __SYS_SIGTTOU
Definition: syscalls.h:283
@ __SYS_SIGNAL_MAX
Definition: syscalls.h:349
@ __SYS_SIGALRM
Definition: syscalls.h:251
@ __SYS_SIGRT_28
Definition: syscalls.h:342
@ __SYS_SIGXFSZ
Definition: syscalls.h:303
@ __SYS_SIGINT
Definition: syscalls.h:265
@ __SYS_SIGSEGV
Definition: syscalls.h:273
@ __SYS_SIGVTALRM
Definition: syscalls.h:299
@ __SYS_SIGCONT
Definition: syscalls.h:257
@ __SYS_SIGRT_30
Definition: syscalls.h:344
@ __SYS_SIGSTOP
Definition: syscalls.h:275
@ __SYS_SIGRT_25
Definition: syscalls.h:339
@ __SYS_SIGRT_12
Definition: syscalls.h:326
@ __SYS_SIGHUP
Definition: syscalls.h:261
@ __SYS_SIGRTMIN
Definition: syscalls.h:314
@ __SYS_SIGPIPE
Definition: syscalls.h:269
@ __SYS_SIGXCPU
Definition: syscalls.h:301
@ __SYS_SIGRT_20
Definition: syscalls.h:334
@ __SYS_SIGRT_10
Definition: syscalls.h:324
@ __SYS_SIGRT_26
Definition: syscalls.h:340
@ __SYS_SIGRT_31
Definition: syscalls.h:345
@ __SYS_SIGRT_16
Definition: syscalls.h:330
@ __SYS_SIGRT_14
Definition: syscalls.h:328
@ __SYS_SIGRT_18
Definition: syscalls.h:332
@ __SYS_SIGRT_8
Definition: syscalls.h:322
@ __SYS_SIGRT_2
Definition: syscalls.h:316
@ __SYS_SIGSYS
Definition: syscalls.h:293
@ __SYS_SIGRT_21
Definition: syscalls.h:335
@ __SYS_SIGRT_22
Definition: syscalls.h:336
@ __SYS_SIGCHLD
Definition: syscalls.h:255
@ __SYS_SIGRT_19
Definition: syscalls.h:333
@ __SYS_SIGRT_27
Definition: syscalls.h:341
@ __SYS_SIGPROF
Definition: syscalls.h:291
@ __SYS_SIGILL
Definition: syscalls.h:263
@ __SYS_SIGUSR2
Definition: syscalls.h:287
@ __SYS_SIGRT_6
Definition: syscalls.h:320
syscall_open_flags_t
Definition: syscalls.h:204
@ __SYS_O_RDWR
Definition: syscalls.h:207
@ __SYS_O_DSYNC
Definition: syscalls.h:210
@ __SYS_O_NONBLOCK
Definition: syscalls.h:213
@ __SYS_O_RDONLY
Definition: syscalls.h:205
@ __SYS_O_RSYNC
Definition: syscalls.h:214
@ __SYS_O_WRONLY
Definition: syscalls.h:206
@ __SYS_O_NOCTTY
Definition: syscalls.h:212
@ __SYS_O_EXCL
Definition: syscalls.h:211
@ __SYS_O_APPEND
Definition: syscalls.h:208
@ __SYS_O_SYNC
Definition: syscalls.h:215
@ __SYS_O_TRUNC
Definition: syscalls.h:216
@ __SYS_O_CREAT
Definition: syscalls.h:209
syscall_seek_whence_t
Definition: syscalls.h:239
@ __SYS_SEEK_CUR
Definition: syscalls.h:241
@ __SYS_SEEK_SET
Definition: syscalls.h:240
@ __SYS_SEEK_END
Definition: syscalls.h:242
syscall_access_flags_t
Definition: syscalls.h:220
@ __SYS_X_OK
Definition: syscalls.h:224
@ __SYS_R_OK
Definition: syscalls.h:222
@ __SYS_F_OK
Definition: syscalls.h:221
@ __SYS_W_OK
Definition: syscalls.h:223
unsigned int __SYS_socklen_t
Definition: syscalls.h:412
#define scarg
Definition: syscalls.h:23
syscall_signal_disposition_t
Definition: syscalls.h:356
@ __SYS_SIG_TERM
Definition: syscalls.h:358
@ __SYS_SIG_STOP
Definition: syscalls.h:364
@ __SYS_SIG_CORE
Definition: syscalls.h:366
@ __SYS_SIG_CONT
Definition: syscalls.h:362
@ __SYS_SIG_IGN
Definition: syscalls.h:360
syscalls_t
List of syscalls.
Definition: syscalls.h:421
@ SYS_UNLINK
Remove a file.
Definition: syscalls.h:1372
@ SYS_MMAP
Map files or devices into memory.
Definition: syscalls.h:961
@ SYS_SHUTDOWN
Shut down part of a full-duplex connection.
Definition: syscalls.h:1214
@ SYS_RECV
Receive data on a socket.
Definition: syscalls.h:1197
@ SYS_MAX
Max number of syscalls.
Definition: syscalls.h:1403
@ SYS_STAT
Retrieve file status.
Definition: syscalls.h:622
@ SYS_WRITE
Write to a file descriptor.
Definition: syscalls.h:511
@ SYS_NANOSLEEP
Sleep for a specified time.
Definition: syscalls.h:1284
@ SYS_TELL
Get the current file offset.
Definition: syscalls.h:738
@ SYS_TRUNCATE
Change the size of a file.
Definition: syscalls.h:704
@ SYS_PIPE
Create a pipe.
Definition: syscalls.h:1036
@ SYS_RMDIR
Remove an empty directory.
Definition: syscalls.h:1355
@ SYS_READ
Read from a file descriptor.
Definition: syscalls.h:468
@ SYS_GETPPID
Get the parent process ID.
Definition: syscalls.h:842
@ SYS_CLOSE
Close a file descriptor.
Definition: syscalls.h:582
@ SYS_MADVISE
Provide advice about memory usage.
Definition: syscalls.h:1016
@ SYS_EXECVE
Execute a program.
Definition: syscalls.h:816
@ SYS_LISTEN
Listen for incoming connections on a socket.
Definition: syscalls.h:1141
@ SYS_WAITPID
Wait for a child process to change state.
Definition: syscalls.h:860
@ SYS_BRK
Set the program break.
Definition: syscalls.h:918
@ SYS_MUNMAP
Unmap a mapped memory region.
Definition: syscalls.h:979
@ SYS_EXIT
Terminate the calling process.
Definition: syscalls.h:780
@ SYS_OPEN
Open a file.
Definition: syscalls.h:566
@ SYS_CONNECT
Connect to a remote address.
Definition: syscalls.h:1124
@ SYS_IOCTL
Control a device.
Definition: syscalls.h:601
@ SYS_PREAD
Read from a file descriptor.
Definition: syscalls.h:490
@ SYS_RENAME
Rename a file or directory.
Definition: syscalls.h:1390
@ SYS_GETPID
Get the process ID of the calling process.
Definition: syscalls.h:829
@ SYS_FSTAT
Retrieve file status for an open file descriptor.
Definition: syscalls.h:640
@ SYS_PWRITE
Write to a file descriptor.
Definition: syscalls.h:532
@ SYS_BIND
Bind a socket to a local address.
Definition: syscalls.h:1106
@ SYS_TIME
Get the current time.
Definition: syscalls.h:1233
@ SYS_DUP
Duplicate a file descriptor.
Definition: syscalls.h:1052
@ SYS_SOCKET
Create an endpoint for communication.
Definition: syscalls.h:1088
@ SYS_CLOCK_SETTIME
Set the current time of a specific clock.
Definition: syscalls.h:1267
@ SYS_API_VERSION
Set syscall version.
Definition: syscalls.h:444
@ SYS_FORK
Create a child process.
Definition: syscalls.h:796
@ SYS_SEND
Send data on a socket.
Definition: syscalls.h:1178
@ SYS_PRCTL
Process/Thread Control.
Definition: syscalls.h:899
@ SYS_LSTAT
Retrieve file status with symbolic link resolution.
Definition: syscalls.h:659
@ SYS_DUP2
Duplicate a file descriptor to a specific value.
Definition: syscalls.h:1070
@ SYS_KILL
Send a signal to a process.
Definition: syscalls.h:878
@ SYS_MPROTECT
Change memory protection.
Definition: syscalls.h:997
@ SYS_MKDIR
Create a new directory.
Definition: syscalls.h:1339
@ SYS_CHDIR
Change the current working directory.
Definition: syscalls.h:1321
@ SYS_ACCEPT
Accept an incoming connection on a socket.
Definition: syscalls.h:1159
@ SYS_FTRUNCATE
Change the size of a file referred by a file descriptor.
Definition: syscalls.h:722
@ SYS_SEEK
Set the file offset.
Definition: syscalls.h:762
@ SYS_GETCWD
Get the current working directory.
Definition: syscalls.h:1304
@ SYS_CLOCK_GETTIME
Get the current time of a specific clock.
Definition: syscalls.h:1250
@ SYS_ACCESS
Check a file's accessibility.
Definition: syscalls.h:685
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:165
syscall_clockid_t
Definition: syscalls.h:398
@ __SYS_CLOCK_PROCESS_CPUTIME_ID
Definition: syscalls.h:400
@ __SYS_CLOCK_REALTIME
Definition: syscalls.h:401
@ __SYS_CLOCK_THREAD_CPUTIME_ID
Definition: syscalls.h:402
@ __SYS_CLOCK_MONOTONIC
Definition: syscalls.h:399
syscall_mmap_flags_t
Definition: syscalls.h:190
@ __SYS_MAP_ANON
Definition: syscalls.h:200
@ __SYS_PROT_NONE
Definition: syscalls.h:194
@ __SYS_PROT_READ
Definition: syscalls.h:191
@ __SYS_MAP_FIXED
Definition: syscalls.h:198
@ __SYS_MAP_SHARED
Definition: syscalls.h:196
@ __SYS_PROT_EXEC
Definition: syscalls.h:193
@ __SYS_PROT_WRITE
Definition: syscalls.h:192
@ __SYS_MAP_PRIVATE
Definition: syscalls.h:197
@ __SYS_MAP_ANONYMOUS
Definition: syscalls.h:199
syscall_prctl_options_t
Definition: syscalls.h:228
@ __SYS_GET_FS
Definition: syscalls.h:231
@ __SYS_SET_GS
Definition: syscalls.h:230
@ __SYS_GET_GS
Definition: syscalls.h:229
@ __SYS_SET_FS
Definition: syscalls.h:232
static scarg syscall5(scarg syscall, scarg arg1, scarg arg2, scarg arg3, scarg arg4, scarg arg5)
Syscall wrapper with 5 arguments.
Definition: syscalls.h:139
static scarg syscall4(scarg syscall, scarg arg1, scarg arg2, scarg arg3, scarg arg4)
Syscall wrapper with 4 arguments.
Definition: syscalls.h:115
static scarg syscall1(scarg syscall, scarg arg1)
Syscall wrapper with 1 argument.
Definition: syscalls.h:52
syscall_signal_actions_t
Definition: syscalls.h:373
@ __SYS_SIG_UNBLOCK
Definition: syscalls.h:375
@ __SYS_SIG_SETMASK
Definition: syscalls.h:376
@ __SYS_SIG_BLOCK
Definition: syscalls.h:374
static scarg syscall0(scarg syscall)
Syscall wrapper with 0 arguments.
Definition: syscalls.h:33
syscall_signal_action_flags_t
Definition: syscalls.h:380
@ __SYS_SA_SIGINFO
Definition: syscalls.h:385
@ __SYS_SA_RESTART
Definition: syscalls.h:384
@ __SYS_SA_RESETHAND
Definition: syscalls.h:383
@ __SYS_SA_ONSTACK
Definition: syscalls.h:382
@ __SYS_SA_NODEFER
Definition: syscalls.h:387
@ __SYS_SA_NOCLDSTOP
Definition: syscalls.h:381
@ __SYS_SA_NOCLDWAIT
Definition: syscalls.h:386
static scarg syscall2(scarg syscall, scarg arg1, scarg arg2)
Syscall wrapper with 2 arguments.
Definition: syscalls.h:72
syscall_signal_action_disposition_t
Definition: syscalls.h:391
@ __SYS_SIG_ERR
Definition: syscalls.h:392
@ ___SYS_SIG_IGN
Definition: syscalls.h:394
@ __SYS_SIG_DFL
Definition: syscalls.h:393
static scarg syscall3(scarg syscall, scarg arg1, scarg arg2, scarg arg3)
Syscall wrapper with 3 arguments.
Definition: syscalls.h:93
int __SYS_clockid_t
Definition: syscalls.h:411