1. semget(key_t key, int num_sems, int flags) key_t信号量的key,num_sems信号量的值,flags,IPC_CREAE,当信号量不存在时则新建信号量
  2. semctl((key_t key, int num_sems,int command...)信号量控制信息,最后一个参数可以是:

SETVAL:设置一个信号量值

IPC_RMID:删除一个无需使用的信号量标识符