mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 04:17:34 +00:00
uname: Use pledge()
This commit is contained in:
parent
feb4c683eb
commit
f67f70302b
1 changed files with 6 additions and 0 deletions
|
@ -26,9 +26,15 @@
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <sys/utsname.h>
|
#include <sys/utsname.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
|
if (pledge("stdio", nullptr) < 0) {
|
||||||
|
perror("pledge");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
utsname uts;
|
utsname uts;
|
||||||
int rc = uname(&uts);
|
int rc = uname(&uts);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue