2 * Copyright 2004-2008, Axel Dörfler, axeld@pinc-software.de.
3 * Distributed under the terms of the MIT License.
15 #include <dirent_private.h>
16 #include <errno_private.h>
18 #include <syscall_utils.h>
22 open_query_etc(dev_t device
, const char *query
,
23 uint32 flags
, port_id port
, int32 token
)
25 if (device
< 0 || query
== NULL
|| query
[0] == '\0') {
26 __set_errno(B_BAD_VALUE
);
31 int fd
= _kern_open_query(device
, query
, strlen(query
), flags
, port
, token
);
37 // allocate the DIR structure
38 DIR *dir
= __create_dir_struct(fd
);
49 fs_open_query(dev_t device
, const char *query
, uint32 flags
)
51 return open_query_etc(device
, query
, flags
, -1, -1);
56 fs_open_live_query(dev_t device
, const char *query
,
57 uint32 flags
, port_id port
, int32 token
)
61 __set_errno(B_BAD_VALUE
);
65 return open_query_etc(device
, query
, flags
| B_LIVE_QUERY
, port
, token
);
70 fs_close_query(DIR *dir
)
77 fs_read_query(DIR *dir
)
84 get_path_for_dirent(struct dirent
*dent
, char *buffer
, size_t length
)
86 if (dent
== NULL
|| buffer
== NULL
)
89 return _kern_entry_ref_to_path(dent
->d_pdev
, dent
->d_pino
, dent
->d_name
,