kernel: handle O_EXCL

This commit is contained in:
K. Lange 2018-11-22 16:35:18 +09:00
parent a2f7396e26
commit a663722b34

View File

@ -153,6 +153,11 @@ static int sys_open(const char * file, int flags, int mode) {
}
}
if (node && (flags & O_CREAT) && (flags & O_EXCL)) {
close_fs(node);
return -EEXIST;
}
if (!node && (flags & O_CREAT)) {
/* TODO check directory permissions */
debug_print(NOTICE, "- file does not exist and create was requested.");