diff --git a/src/kernel/libroot/os/Jamfile b/src/kernel/libroot/os/Jamfile index 666c469228..fcde9d337a 100644 --- a/src/kernel/libroot/os/Jamfile +++ b/src/kernel/libroot/os/Jamfile @@ -7,6 +7,8 @@ KernelMergeObject os_main.o : <$(SOURCE_GRIST)>driver_settings.c <$(SOURCE_GRIST)>fs_attr.c <$(SOURCE_GRIST)>fs_index.c + <$(SOURCE_GRIST)>fs_info.c + <$(SOURCE_GRIST)>fs_query.c <$(SOURCE_GRIST)>image.c <$(SOURCE_GRIST)>port.c <$(SOURCE_GRIST)>sem.c diff --git a/src/kernel/libroot/os/fs_info.c b/src/kernel/libroot/os/fs_info.c new file mode 100644 index 0000000000..a7c0a5c7a2 --- /dev/null +++ b/src/kernel/libroot/os/fs_info.c @@ -0,0 +1,56 @@ +/* +** Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved. +** Distributed under the terms of the Haiku License. +*/ + + +#include + +#include +#include +#include + +#include "syscalls.h" + +// ToDo: implement these for real - the VFS functions are still missing! + +#define RETURN_AND_SET_ERRNO(status) \ + { \ + if (status < 0) { \ + errno = status; \ + return -1; \ + } \ + return status; \ + } + + +dev_t +dev_for_path(const char *path) +{ + struct stat stat; + int status = _kern_read_path_stat(path, false, &stat, sizeof(struct stat)); + if (status == B_OK) + return stat.st_dev; + + RETURN_AND_SET_ERRNO(status); +} + + +dev_t +next_dev(int32 *pos) +{ + status_t status = B_ERROR; + + RETURN_AND_SET_ERRNO(status) +} + + +int +fs_stat_dev(dev_t dev, fs_info *info) +{ + status_t status = B_ERROR; + + RETURN_AND_SET_ERRNO(status) +} + + diff --git a/src/kernel/libroot/os/fs_query.c b/src/kernel/libroot/os/fs_query.c new file mode 100644 index 0000000000..dd7e2114f3 --- /dev/null +++ b/src/kernel/libroot/os/fs_query.c @@ -0,0 +1,64 @@ +/* +** Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved. +** Distributed under the terms of the Haiku License. +*/ + + +#include + +#include +#include +#include + +#include "syscalls.h" + +// ToDo: implement these for real - the VFS functions are still missing! + +#define RETURN_AND_SET_ERRNO(status) \ + { \ + if (status < 0) { \ + errno = status; \ + return -1; \ + } \ + return status; \ + } + +// for the DIR structure +#define BUFFER_SIZE 2048 + + +DIR * +fs_open_query(dev_t device, const char *query, uint32 flags) +{ + return NULL; +} + + +DIR * +fs_open_live_query(dev_t device, const char *query, + uint32 flags, port_id port, int32 token) +{ + return NULL; +} + + +int +fs_close_query(DIR *d) +{ + return 0; +} + + +struct dirent * +fs_read_query(DIR *d) +{ + return NULL; +} + + +status_t +get_path_for_dirent(struct dirent *dent, char *buf, size_t len) +{ + return B_ERROR; +} +