kboot: Implement mkdir(2)

mkdir() may be needed early in boot to create missing
directories. Provide a syscall wrapper for it.

Sponsored by:		Netflix
This commit is contained in:
Warner Losh 2022-06-30 12:09:26 -06:00
parent bc84de741d
commit a99d47bcaa
4 changed files with 9 additions and 0 deletions

View File

@ -5,6 +5,7 @@
#define SYS_gettimeofday 96
#define SYS_kexec_load 246
#define SYS_lseek 8
#define SYS_mkdirat 258
#define SYS_mmap 9
#define SYS_munmap 11
#define SYS_newfstat 5

View File

@ -6,6 +6,7 @@
#define SYS_gettimeofday 78
#define SYS_kexec_load 268
#define SYS_llseek 140
#define SYS_mkdirat 287
#define SYS_mmap 90
#define SYS_munmap 91
#define SYS_newfstat SYS_fstat

View File

@ -99,6 +99,7 @@ int host_getpid(void);
int host_gettimeofday(struct host_timeval *a, void *b);
int host_kexec_load(uint32_t start, int nsegs, uint32_t segs, uint32_t flags);
ssize_t host_llseek(int fd, int32_t offset_high, int32_t offset_lo, uint64_t *result, int whence);
int host_mkdir(const char *, host_mode_t);
void *host_mmap(void *addr, size_t len, int prot, int flags, int fd, off_t off);
int host_munmap(void *addr, size_t len);
int host_open(const char *path, int flags, int mode);

View File

@ -63,6 +63,12 @@ host_llseek(int fd, int32_t offset_high, int32_t offset_lo, uint64_t *result, in
#endif
}
int
host_mkdir(const char *path, host_mode_t mode)
{
return host_syscall(SYS_mkdirat, HOST_AT_FDCWD, (uintptr_t)path, mode);
}
void *
host_mmap(void *addr, size_t len, int prot, int flags, int fd, off_t off)
{