/
githubmirror
/
lsof
Обзор
Документация
Войти
/
githubmirror
/
lsof
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
lib/dialects/linux/tests/mq_open.c
24 строки
561 B
Jiajie Chen
Change folder structure for library changes:
27 мар 2023, 14:44
27 мар 2023, 14:44
439f90c
Код
Авторство
О чём код?
#include <fcntl.h> /* For O_* constants */ #include <sys/stat.h> /* For mode constants */ #include <mqueue.h> #include <unistd.h> #include <stdio.h> #include <signal.h> #define NAME "/xxx" static void do_nothing(int n) { signal(SIGCONT, do_nothing); } int main(void) { mqd_t t = mq_open(NAME, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, NULL); if ((mqd_t)t == -1) { perror("open[" NAME "]"); return 1; } printf("pid: %d / fd: %d\n", getpid(), t); fflush(stdout); signal(SIGCONT, do_nothing); pause(); return 0; }