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:
+1
-1
@@ -4,7 +4,7 @@
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
creat("dup.out", 0777);
|
||||
int fd1 = open("dup.out", 0, 0);
|
||||
int fd1 = open("dup.out", 0);
|
||||
int fd2 = dup(fd1);
|
||||
printf("fd %d duped into fd %d\n", fd1, fd2);
|
||||
close(fd1);
|
||||
|
||||
Reference in New Issue
Block a user