qctl.c
来自「基于网络编程的例子」· C语言 代码 · 共 33 行
C
33 行
/* * qctl.c - Remove a message queue */#include <sys/types.h>#include <sys/ipc.h>#include <sys/msg.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <unistd.h>int main(int argc, char *argv[]){ int qid; if(argc != 2) { puts("USAGE: qctl <qid>"); exit(EXIT_FAILURE); } qid = atoi(argv[1]); if((msgctl(qid, IPC_RMID, NULL)) < 0) { perror("msgctl"); exit(EXIT_FAILURE); } printf("queue %d removed\n", qid); exit(EXIT_SUCCESS);}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?