-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[LibOS] Add
O_PATH
support to open
syscall
Signed-off-by: Borys Popławski <[email protected]>
- Loading branch information
1 parent
97d3f69
commit 19f8e65
Showing
19 changed files
with
213 additions
and
77 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
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 @@ | ||
/* SPDX-License-Identifier: LGPL-3.0-or-later */ | ||
/* Copyright (C) 2022 Intel Corporation | ||
* Borys Popławski <[email protected]> | ||
*/ | ||
|
||
#include "shim_fs.h" | ||
|
||
static int hstat(struct shim_handle* handle, struct stat* buf) { | ||
if (!handle->inode) { | ||
return -EINVAL; | ||
} | ||
return generic_inode_hstat(handle, buf); | ||
} | ||
|
||
static struct shim_fs_ops path_fs_ops = { | ||
.hstat = hstat, | ||
}; | ||
|
||
static struct shim_d_ops path_d_ops = {}; | ||
|
||
struct shim_fs path_builtin_fs = { | ||
.name = "path", | ||
.fs_ops = &path_fs_ops, | ||
.d_ops = &path_d_ops, | ||
}; |
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
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 |
---|---|---|
@@ -1,15 +1,35 @@ | ||
/* SPDX-License-Identifier: LGPL-3.0-or-later */ | ||
/* Copyright (C) 2021 Intel Corporation | ||
/* Copyright (C) 2022 Intel Corporation | ||
* Paweł Marczewski <[email protected]> | ||
* Borys Popławski <[email protected]> | ||
*/ | ||
|
||
#ifndef COMMON_H_ | ||
#define COMMON_H_ | ||
|
||
#include <assert.h> | ||
#include <err.h> | ||
|
||
#define OVERFLOWS(type, val) \ | ||
({ \ | ||
type __dummy; \ | ||
__builtin_add_overflow((val), 0, &__dummy); \ | ||
}) | ||
|
||
#define CHECK(x) ({ \ | ||
__typeof__(x) _x = (x); \ | ||
if (_x == -1) { \ | ||
err(1, "error at %s (line %d)", #x, __LINE__); \ | ||
} \ | ||
_x; \ | ||
}) | ||
|
||
#define SAME_TYPE(a, b) __builtin_types_compatible_p(__typeof__(a), __typeof__(b)) | ||
#define IS_STATIC_ARRAY(a) (!SAME_TYPE(a, &*(a))) | ||
|
||
#define ARRAY_LEN(arr) ({ \ | ||
static_assert(IS_STATIC_ARRAY(arr), "not a static array"); \ | ||
sizeof(arr) / sizeof(arr[0]); \ | ||
}) | ||
|
||
#endif /* COMMON_H_ */ |
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
Oops, something went wrong.