Rename lxc_mmap()/lxc_munmap() to lxc_strmmap()/lxc_strmunmap().
Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
if (fbuf.st_size != 0) {
- buf = lxc_mmap(NULL, fbuf.st_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
+ buf = lxc_strmmap(NULL, fbuf.st_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
if (buf == MAP_FAILED) {
SYSERROR("Failed to create mapping %s", path);
close(fd);
bytes += len;
}
- lxc_munmap(buf, fbuf.st_size);
+ lxc_strmunmap(buf, fbuf.st_size);
if (ftruncate(fd, fbuf.st_size - bytes) < 0) {
SYSERROR("Failed to truncate file %s", path);
close(fd);
return n;
}
-void *lxc_mmap(void *addr, size_t length, int prot, int flags, int fd,
- off_t offset)
+void *lxc_strmmap(void *addr, size_t length, int prot, int flags, int fd,
+ off_t offset)
{
void *tmp = NULL, *overlap = NULL;
return overlap;
}
-int lxc_munmap(void *addr, size_t length)
+int lxc_strmunmap(void *addr, size_t length)
{
return munmap(addr, length + 1);
}
/* mmap() wrapper. lxc_mmap() will take care to \0-terminate files so that
* normal string-handling functions can be used on the buffer. */
-extern void *lxc_mmap(void *addr, size_t length, int prot, int flags, int fd,
- off_t offset);
+extern void *lxc_strmmap(void *addr, size_t length, int prot, int flags, int fd,
+ off_t offset);
/* munmap() wrapper. Use it to free memory mmap()ed with lxc_mmap(). */
-extern int lxc_munmap(void *addr, size_t length);
+extern int lxc_strmunmap(void *addr, size_t length);
//initialize rand with urandom
extern int randseed(bool);