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

📄 sem_func.h

📁 这是自己写的一个关于经典ipc问题-读者写者的实现。(用信号量实现)
💻 H
字号:
#include <sys/types.h>#include <sys/ipc.h>#include <sys/sem.h>#include <sys/stat.h>#include <errno.h>#include <unistd.h>#include <stdlib.h>#include <fcntl.h>#include <stdio.h>union semun {	int val;                            	struct semid_ds *buf;              	ushort *array;  };#define LOCKFILE_DB     "/tmp/b02006_db"#define LOCKFILE_RC     "/tmp/b02006_rc"#define LOCKFILE_MUTEX  "/tmp/b02006_mutex"#define SVSEM_MODE      (S_IRUSR | S_IWUSR | S_IRUSR>>3 | S_IRUSR>>6)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -