fcntl.cpp 328 B

123456789101112131415161718
  1. #include <errno.h>
  2. #include <fcntl.h>
  3. #include <stdarg.h>
  4. #include <stdio.h>
  5. #include <Kernel/Syscall.h>
  6. extern "C" {
  7. int fcntl(int fd, int cmd, ...)
  8. {
  9. va_list ap;
  10. va_start(ap, cmd);
  11. dword extra_arg = va_arg(ap, dword);
  12. int rc = syscall(SC_fcntl, fd, cmd, extra_arg);
  13. __RETURN_WITH_ERRNO(rc, rc, -1);
  14. }
  15. }