#include <unistd.h>
#include <sys/types.h>
#include <sys/mman.h>
#include <fcntl.h>
int main () {
int descriptor;
if (descriptor = shm_open("custom", O_CREAT|O_RDWR, 0)) {
close(descriptor);
shm_unlink("custom");
}
return 0;
}
запуск
$ gcc sample.c
выдает ошибки
sample.c:(.text+0x21): undefined reference to 'shm_open'
sample.c:(.text+0x44): undefined reference to 'shm_unlink'