#include <fcntl.h> #include <sys/syat.h> #include <mqueue.h> mqd_t mq_open(const char *name, int oflag); mqd_t mq_open(const char *name, int oflag, mode_t mode, struct mq_attr *attr); -lrt 링크 필요.
Copyrights © - Joinc, All Rights Reserved. Inherited From - Yundream Rebranded By - Joonphil
mq_open
사용 법
#include <fcntl.h> #include <sys/syat.h> #include <mqueue.h> mqd_t mq_open(const char *name, int oflag); mqd_t mq_open(const char *name, int oflag, mode_t mode, struct mq_attr *attr); -lrt 링크 필요.설명
- O_RDONLY
단지 읽기 위해서만 연다.- O_WRONLY
쓰기 전용으로 연다.- O_RDWR
읽기와 쓰기 모두를 위해서 연다.- O_NONBLOCK
비봉쇄 모드로 연다.- O_CREAT
메시지 큐가 존재하지 않으면 새로 생성한다. 프로세스를 실행한 유저가 메시지 큐의 소유자가 된다.- O_EXCL
O_CREAT와 함께 사용한다. 만약 메시지 큐가 존재하면 에러를 리턴한다. errno는 EEXIST가 설정된다.반환 값
예제
Recent Posts
Archive Posts
Tags