github.com/afumu/libc@v0.0.6/musl/src/fcntl/openat.c (about)

     1  #include <fcntl.h>
     2  #include <stdarg.h>
     3  #include "syscall.h"
     4  
     5  int openat(int fd, const char *filename, int flags, ...)
     6  {
     7  	mode_t mode = 0;
     8  
     9  	if ((flags & O_CREAT) || (flags & O_TMPFILE) == O_TMPFILE) {
    10  		va_list ap;
    11  		va_start(ap, flags);
    12  		mode = va_arg(ap, mode_t);
    13  		va_end(ap);
    14  	}
    15  
    16  	return syscall_cp(SYS_openat, fd, filename, flags|O_LARGEFILE, mode);
    17  }
    18  
    19  weak_alias(openat, openat64);