apio
d93a4062a2
That function is meant more for user programs, and should still be rarely used, since it's not portable. Instead, we already know the number of arguments. We just call __lc_fast_syscallN, which also sets errno.
26 lines
609 B
C++
26 lines
609 B
C++
#include <fcntl.h>
|
|
#include <luna/syscall.h>
|
|
#include <stdarg.h>
|
|
#include <stdint.h>
|
|
#include <sys/syscall.h>
|
|
|
|
extern "C"
|
|
{
|
|
int open(const char* pathname, int flags, ...)
|
|
{
|
|
va_list ap;
|
|
va_start(ap, flags);
|
|
long result = __lc_fast_syscall3(SYS_open, pathname, flags, va_arg(ap, unsigned int));
|
|
va_end(ap);
|
|
return (int)result;
|
|
}
|
|
|
|
int fcntl(int fd, int cmd, ...)
|
|
{
|
|
va_list ap;
|
|
va_start(ap, cmd);
|
|
long result = __lc_fast_syscall3(SYS_fcntl, fd, cmd, va_arg(ap, uintptr_t));
|
|
va_end(ap);
|
|
return (int)result;
|
|
}
|
|
} |