diff options
Diffstat (limited to 'lib/xwrap.c')
-rw-r--r-- | lib/xwrap.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/xwrap.c b/lib/xwrap.c index 0281e701..83f54a0a 100644 --- a/lib/xwrap.c +++ b/lib/xwrap.c @@ -58,6 +58,13 @@ void xexit(void) _xexit(); } +void *xmmap(void *addr, size_t length, int prot, int flags, int fd, off_t off) +{ + void *ret = mmap(addr, length, prot, flags, fd, off); + if (ret == MAP_FAILED) perror_exit("mmap"); + return ret; +} + // Die unless we can allocate memory. void *xmalloc(size_t size) { |