open is handled specially because it is used from so many places, in so many variants (2 or 3 arguments, setting errno or not, and cancellable or not). trying to do it as a function would not only increase bloat, but would also risk subtle breakage. this is the first step towards supporting "new" archs where linux lacks "old" syscalls.
17 lines
278 B
C
17 lines
278 B
C
#include <fcntl.h>
|
|
#include <stdarg.h>
|
|
#include "syscall.h"
|
|
#include "libc.h"
|
|
|
|
int open(const char *filename, int flags, ...)
|
|
{
|
|
mode_t mode;
|
|
va_list ap;
|
|
va_start(ap, flags);
|
|
mode = va_arg(ap, mode_t);
|
|
va_end(ap);
|
|
return sys_open_cp(filename, flags, mode);
|
|
}
|
|
|
|
LFS64(open);
|