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.
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user