mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:37:35 +00:00
cat: Use pledge()
This commit is contained in:
parent
1934a1ec0b
commit
e131a401e8
1 changed files with 11 additions and 0 deletions
|
@ -9,6 +9,11 @@
|
|||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
if (pledge("stdio rpath", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
return 1;
|
||||
}
|
||||
|
||||
Vector<int> fds;
|
||||
if (argc > 1) {
|
||||
for (int i = 1; i < argc; i++) {
|
||||
|
@ -22,6 +27,12 @@ int main(int argc, char** argv)
|
|||
} else {
|
||||
fds.append(0);
|
||||
}
|
||||
|
||||
if (pledge("stdio", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
return 1;
|
||||
}
|
||||
|
||||
for (auto& fd : fds) {
|
||||
for (;;) {
|
||||
char buf[32768];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue