I’m trying to run a program which can write to a shared memory location. The several examples I’ve found online are giving me trouble. Perhaps someone here can help.
The error I’m getting is:
unknown symbol: __deregister_frame_info
unknown symbol: __register_frame_info
Could not resolve all symbols
Is this because my compiler is out of date?
I’m ideally (with correct syntax, etc) running this code:
struct region { /* Defines “structure” of shared memory */
int len;
char buf[MAX_LEN];
};
struct region *rptr;
int fd;
/* Create shared memory object and set its size */
fd = shm_open("/myregion", O_CREAT | O_RDWR, S_IRUSR | S_IWUSR);
if (fd == -1)
/* Handle error */;
if (ftruncate(fd, sizeof(struct region)) == -1)
/* Handle error */;
/* Map shared memory object */
rptr = mmap(NULL, sizeof(struct region),
PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
if (rptr == MAP_FAILED)
/* Handle error */;
/* Now we can refer to mapped region using fields of rptr;
for example, rptr->len */
…