lib: fs: add library for implementing a filesystem service
This commit is contained in:
21
lib/libfs/interface/open.c
Normal file
21
lib/libfs/interface/open.c
Normal file
@@ -0,0 +1,21 @@
|
||||
#include <errno.h>
|
||||
#include <fs/context.h>
|
||||
|
||||
extern kern_status_t fs_msg_open(
|
||||
const struct msg_endpoint *sender,
|
||||
const char *path,
|
||||
int flags,
|
||||
int *out_err,
|
||||
void *arg)
|
||||
{
|
||||
struct fs_context *ctx = arg;
|
||||
|
||||
struct fs_dentry *dent = fs_context_resolve_path(ctx, path);
|
||||
if (!dent) {
|
||||
*out_err = ENOENT;
|
||||
return KERN_OK;
|
||||
}
|
||||
|
||||
*out_err = SUCCESS;
|
||||
return KERN_OK;
|
||||
}
|
||||
Reference in New Issue
Block a user