/
githubmirror
/
lsof
Обзор
Документация
Войти
/
githubmirror
/
lsof
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
lib/dialects/linux/tests/unbal_parens.c
22 строки
438 B
Jiajie Chen
[linux] fix read_id_stat to handle unbalanced parens in process name
04 май 2026, 06:30
04 май 2026, 06:30
b46fc8f
Код
Авторство
О чём код?
#define _GNU_SOURCE #include <sys/prctl.h> #include <stdio.h> #include <string.h> #include <unistd.h> int main(int argc, char **argv) { const char *name = (argc > 1) ? argv[1] : "test("; if (strcmp(name, "NEWLINE") == 0) { name = "a\nb"; } if (prctl(PR_SET_NAME, name) < 0) { perror("prctl"); return 1; } printf("%d\n", getpid()); fflush(stdout); pause(); return 0; }