mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 05:37:34 +00:00
top: Use pledge() and unveil()
This commit is contained in:
parent
a7dbb3cf96
commit
16d5b1d4ca
1 changed files with 17 additions and 0 deletions
|
@ -133,6 +133,23 @@ static Snapshot get_snapshot()
|
||||||
|
|
||||||
int main(int, char**)
|
int main(int, char**)
|
||||||
{
|
{
|
||||||
|
if (pledge("stdio rpath", nullptr) < 0) {
|
||||||
|
perror("pledge");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (unveil("/proc/all", "r") < 0) {
|
||||||
|
perror("unveil");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (unveil("/etc/passwd", "r") < 0) {
|
||||||
|
perror("unveil");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
unveil(nullptr, nullptr);
|
||||||
|
|
||||||
Vector<ThreadData*> threads;
|
Vector<ThreadData*> threads;
|
||||||
auto prev = get_snapshot();
|
auto prev = get_snapshot();
|
||||||
usleep(10000);
|
usleep(10000);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue