Hello t...@.
On OpenBSD/amd64, doing something like
char *buf = mmap(NULL, len + 1, PROT_READ | PROT_WRITE,
MAP_PRIVATE, some.fd, 0);
buf[len] = '\0';
causes segfault on buf[len] = '\0' assignment if len = 16384.
However doing
char *buf = mmap(NULL, len + 1, PROT_READ | PROT_WRITE,
MAP_PRIVATE, some.fd, 0);
char *nbuf = malloc(len + 1);
memcpy(nbuf, buf, len);
nbuf[len] = '\0';
does not lead to a crash.
Is it expected behavior of mmap (alignment?) or usage of mmap is wrong?
Thanks.
Alexey
