Implemented getattr and source_stat.
Now filesystem implements getattr through source_stat, which is a wrapper for an fstatat with `dirfd == handle.root_path`.
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
#define _GNU_SOURCE
|
||||
|
||||
#include "sourcefs.h"
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
static struct source_files_handle {
|
||||
int root_fd;
|
||||
@@ -19,3 +20,9 @@ int source_init(const char *root_path) {
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Currently this literally is a fstatat wrapper.
|
||||
int source_stat(const char *restrict pathname, struct stat *restrict statbuf) {
|
||||
int statret = fstatat(handle.root_fd, pathname, statbuf, 0);
|
||||
return statret;
|
||||
}
|
||||
|
Reference in New Issue
Block a user