⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 unlink.c

📁 这个是学习嵌入式开发的重要例子
💻 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 + -