mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:28:11 +00:00
Kernel: Support open() with O_CREAT.
It's now possible to create zero-length files! :^) Also hook up the new functionality in /bin/touch.
This commit is contained in:
parent
a47f33bed3
commit
f70136a324
9 changed files with 108 additions and 39 deletions
|
@ -7,6 +7,7 @@
|
|||
#include <pwd.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/types.h>
|
||||
#include <Kernel/Syscall.h>
|
||||
|
||||
extern "C" {
|
||||
|
@ -91,7 +92,7 @@ int open(const char* path, int options, ...)
|
|||
{
|
||||
va_list ap;
|
||||
va_start(ap, options);
|
||||
int rc = syscall(SC_open, path, options, ap);
|
||||
int rc = syscall(SC_open, path, options, va_arg(ap, mode_t));
|
||||
va_end(ap);
|
||||
__RETURN_WITH_ERRNO(rc, rc, -1);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue