env: Use pledge()

This commit is contained in:
Andreas Kling 2020-02-18 13:19:10 +01:00
parent b2f9a60bdb
commit 4b0e0bd9b8
Notes: sideshowbarker 2024-07-19 09:14:08 +09:00

View File

@ -29,6 +29,11 @@
int main(int, char**)
{
if (pledge("stdio", nullptr) < 0) {
perror("pledge");
return 1;
}
for (size_t i = 0; environ[i]; ++i)
printf("%s\n", environ[i]);
return 0;