[Linux] shared memory 생성 연결, 해제 방법 shm_open
·
💙 OS: 운영체제/💙 Linux
SYNOPSIS #include #include /* For mode constants */ #include /* For O_* constants */ int shm_open(const char *name, int oflag, mode_t mode); int shm_unlink(const char *name); Link with -lrt. shm_open() 새로운 혹은 이미 존재하는 POSIX shared memory를 open하거나 없다면 새로 생성. shm_unlink() shm_opne()으로 생성된 shared memory를 없애준다. 예시 shm_open(SHM_NAME, O_RDWR | O_CREAT, 0666); shm_unlink(SHM_NAME);