1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-18 11:55:07 +00:00
serenity/Userland/Tests/Kernel/pledge-test-failures.cpp
2020-08-02 17:15:36 +02:00

25 lines
456 B
C++

#include <stdio.h>
#include <unistd.h>
int main()
{
int res = pledge("stdio unix rpath", "stdio");
if (res < 0) {
perror("pledge");
return 1;
}
res = pledge("stdio unix", "stdio unix");
if (res >= 0) {
fprintf(stderr, "second pledge should have failed\n");
return 1;
}
res = pledge("stdio rpath", "stdio");
if (res < 0) {
perror("pledge");
return 1;
}
return 0;
}