mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:07:34 +00:00
Implement utime() along with a naive /bin/touch.
This synchronous approach to inodes is silly, obviously. I need to rework it so that the in-memory CoreInode object is the canonical inode, and then we just need a sync() that flushes pending changes to disk.
This commit is contained in:
parent
e03d341615
commit
038d8641f9
22 changed files with 122 additions and 22 deletions
|
@ -32,6 +32,7 @@ LIBC_OBJS = \
|
|||
qsort.o \
|
||||
ioctl.o \
|
||||
math.o \
|
||||
utime.o \
|
||||
entry.o
|
||||
|
||||
OBJS = $(AK_OBJS) $(LIBC_OBJS)
|
||||
|
|
14
LibC/utime.cpp
Normal file
14
LibC/utime.cpp
Normal file
|
@ -0,0 +1,14 @@
|
|||
#include <utime.h>
|
||||
#include <errno.h>
|
||||
#include <Kernel/Syscall.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
int utime(const char* pathname, const struct utimbuf* buf)
|
||||
{
|
||||
int rc = Syscall::invoke(Syscall::SC_utime, (dword)pathname, (dword)buf);
|
||||
__RETURN_WITH_ERRNO(rc, rc, -1);
|
||||
}
|
||||
|
||||
}
|
||||
|
10
LibC/utime.h
10
LibC/utime.h
|
@ -0,0 +1,10 @@
|
|||
#pragma once
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
int utime(const char* pathname, const struct utimbuf*);
|
||||
|
||||
__END_DECLS
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue