Files
RedBear-OS/include/bits/fcntl.h
T
Dan Robertson e306e3f855 fcntl: open should use a va_list
The current implementation of open requires the user to pass all three
args to the function. It should use a va_list and allow a user to
provide only the filename and flags.
2018-03-09 02:24:25 +00:00

14 lines
248 B
C

#ifndef _BITS_FCNTL_H
#define _BITS_FCNTL_H
int open(const char* filename, int flags, ...) {
mode_t mode = 0;
va_list ap;
va_start(ap, flags);
mode = va_arg(ap, mode_t);
va_end(ap);
return sys_open(filename, flags, mode);
}
#endif