feat(kernel/syscalls): add fcntl() syscall

Signed-off-by: EnderIce2 <enderice2@protonmail.com>
This commit is contained in:
2025-03-21 01:58:14 +00:00
parent b05a6a14e8
commit 2080d1f2b7
2 changed files with 24 additions and 0 deletions

View File

@ -830,6 +830,25 @@ typedef enum
* - #EINVAL if the request is invalid
*/
SYS_IOCTL,
/**
* @brief Function control
*
* @code
* int fcntl(int fd, int cmd, void *arg);
* @endcode
*
* @details Manipulates the underlying parameters of a device.
*
* @param fd File descriptor referring to the device
* @param cmd Device-specific request code
* @param arg Argument for the request
*
* @return
* - #EOK on success
* - #EBADF if `fd` is not valid
* - #EINVAL if the request is invalid
*/
SYS_FCNTL,
/* File Status */
@ -1678,6 +1697,9 @@ typedef enum
/** @copydoc SYS_IOCTL */
#define call_ioctl(fd, request, argp) syscall3(SYS_IOCTL, (scarg)fd, (scarg)request, (scarg)argp)
/** @copydoc SYS_FCNTL */
#define call_fcntl(fd, cmd, arg) syscall3(SYS_FCNTL, (scarg)fd, (scarg)cmd, (scarg)arg)
/* File Status */
/** @copydoc SYS_STAT */