1/*
2** Copyright 2004, Axel D��rfler, axeld@pinc-software.de. All rights reserved.
3** Distributed under the terms of the MIT License.
4*/
5
6
7#include <fs_info.h>
8
9#include <stdlib.h>
10#include <fcntl.h>
11#include <errno.h>
12
13#include <errno_private.h>
14#include <syscalls.h>
15#include <syscall_utils.h>
16
17
18dev_t
19dev_for_path(const char *path)
20{
21	struct stat stat;
22	int status = _kern_read_stat(-1, path, true, &stat, sizeof(struct stat));
23	if (status == B_OK)
24		return stat.st_dev;
25
26	RETURN_AND_SET_ERRNO(status);
27}
28
29
30dev_t
31next_dev(int32 *_cookie)
32{
33	return _kern_next_device(_cookie);
34		// For some reason, this one returns its error code directly
35}
36
37
38int
39fs_stat_dev(dev_t device, fs_info *info)
40{
41	status_t status = _kern_read_fs_info(device, info);
42
43	RETURN_AND_SET_ERRNO(status);
44}
45
46
47