support kernels with no SYS_open syscall, only SYS_openat
[musl] / src / fcntl / openat.c
index 1a2d953..634c4bf 100644 (file)
@@ -1,21 +1,16 @@
 #include <fcntl.h>
-#include <unistd.h>
 #include <stdarg.h>
 #include "syscall.h"
 #include "libc.h"
 
 int openat(int fd, const char *filename, int flags, ...)
 {
-       int r;
        mode_t mode;
        va_list ap;
        va_start(ap, flags);
        mode = va_arg(ap, mode_t);
        va_end(ap);
-       CANCELPT_BEGIN;
-       r = syscall(SYS_openat, fd, filename, flags|O_LARGEFILE, mode);
-       CANCELPT_END;
-       return r;
+       return syscall_cp(SYS_openat, fd, filename, flags|O_LARGEFILE, mode);
 }
 
 LFS64(openat);