summaryrefslogtreecommitdiff
path: root/misc/comm.c
blob: 989325e71a54f58da2cf4a4bfb9ddcde660d9727 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#define _GNU_SOURCE
#include <stdio.h>
#include <string.h>
#include <sys/prctl.h>
#include <unistd.h>

int main(void) {
    char new_name[] = "notcomm";

    if (prctl(PR_SET_NAME, (unsigned long)new_name, 0, 0, 0) != 0) {
        perror("prctl");
        return 1;
    }

    printf("Changed comm to: %s\n", new_name);
    sleep(1);
    return 0;
}