Skip to content

Commit

Permalink
main: Actually include prctl.h on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
obiwac committed Sep 4, 2024
1 parent f4bbd37 commit 580eaf6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion main.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
#include <string.h>
#include <sys/stat.h>

#if defined(__linux__)
# include <prctl.h>
#endif

static char const* init_name = "flamingo";

static void usage(void) {
Expand All @@ -20,7 +24,7 @@ static void usage(void) {
char progname[16] = init_name;

if (prctl(PR_GET_NAME, progname, NULL, NULL, NULL) < 0) {
fprintf(stderr, "prctl(PR_GET_NAME): %s", strerror(errno))
fprintf(stderr, "prctl(PR_GET_NAME): %s", strerror(errno));
}
#else
char const* const progname = init_name;
Expand Down

0 comments on commit 580eaf6

Please sign in to comment.