-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide a public interface to preopened directory lookups. (#10)
* Provide a public interface to preopened directory lookups. For users of especially non-C compilers, provide an API for looking up preopened directories. This is used internally in WASI libc to translate from eg. `open` to `openat`, but it can now also be used by user code.
- Loading branch information
1 parent
320054e
commit 685d014
Showing
6 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#ifndef __wasi_libc_find_relpath_h | ||
#define __wasi_libc_find_relpath_h | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/** | ||
* Look up the given path in the preopened directory map. If a suitable | ||
* entry is found, return its directory file descriptor, and store the | ||
* computed relative path in *relative_path. Ignore preopened directories | ||
* which don't provide the specified rights. | ||
* | ||
* Returns -1 if no directories were suitable. | ||
*/ | ||
int __wasilibc_find_relpath(const char *path, | ||
__wasi_rights_t rights_base, | ||
__wasi_rights_t rights_inheriting, | ||
const char **relative_path); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters