📄 unlink.c
字号:
#include <stdio.h>#include <stdlib.h>#include <semaphore.h>#include <string.h>#include <errno.h>int main(int argc, char **argv){ if (argc < 2) { fprintf(stderr, "Usage: %s <name>\n", argv[0]); exit(1); } //Upon successful completion, the sem_unlink() function shall return a value of 0. Otherwise, the //semaphore shall not be changed and the function shall return a value of -1 and set errno to indicate the //error. if (sem_unlink(argv[1]) < 0) { fprintf(stderr, "sem_unlink() failed: %s\n", strerror(errno)); exit(1); } fprintf(stdout, "sem_unlink() successed.\n"); return 0;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -