summaryrefslogtreecommitdiff
path: root/LibC/fcntl.cpp
blob: dd28a65cb639af47f76470313ed381ed5e9c0727 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <errno.h>
#include <fcntl.h>
#include <stdarg.h>
#include <stdio.h>
#include <Kernel/Syscall.h>

extern "C" {

int fcntl(int fd, int cmd, ...)
{
    va_list ap;
    va_start(ap, cmd);
    dword extra_arg = va_arg(ap, dword);
    int rc = syscall(SC_fcntl, fd, cmd, extra_arg);
    __RETURN_WITH_ERRNO(rc, rc, -1);
}

}