I am trying to setup a 'shared' memory location using
caddr_t mmap_ptr;
But am getting an error. Any help? Thanks!
Also
mmap_ptr = mmap((caddr_t) 0, /* Memory Location, 0 lets O/S choose */
MAX_BUFFER_SIZE,/* How many bytes to mmap */
PROT_READ | PROT_WRITE, /* Read and write permissions */
MAP_SHARED, /* Accessible by another process */
fid, /* which file is associated with mmap */
(off_t) 0); /* Offset in page frame */
caddr_t is a BSD-ism, and an old one at that. Under Linux (and POSIX), mmap returns a void pointer.
#include <sys/mman.h>
void *mmap (void *addr,
size_t length,
int prot,
int flags,
int fd,
off_t offset);
int munmap (void *addr,
size_t length);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With