* PROT_EXEC PROT_READ PROT_WRITE.
* \param flags Exactly one of MAP_SHARED and MAP_PRIVATE.
* \param fd The file to mmap from.
- * \param offset Mmap start.
* \param map Result pointer.
*
* \return Standard.
*
* \sa mmap(2).
*/
-int para_mmap(size_t length, int prot, int flags, int fd, off_t offset,
- void *map)
+int para_mmap(size_t length, int prot, int flags, int fd, void *map)
{
void **m = map;
errno = EINVAL;
if (!length)
goto err;
- *m = mmap(NULL, length, prot, flags, fd, offset);
+ *m = mmap(NULL, length, prot, flags, fd, (off_t)0);
if (*m != MAP_FAILED)
return 1;
err:
if (S_ISDIR(file_status.st_mode))
goto out;
- ret = para_mmap(*size, mmap_prot, mmap_flags, fd, 0, map);
+ ret = para_mmap(*size, mmap_prot, mmap_flags, fd, map);
out:
if (ret < 0 || !fd_ptr)
close(fd);
__must_check int mark_fd_blocking(int fd);
void para_fd_set(int fd, fd_set *fds, int *max_fileno);
__must_check int para_fgets(char *line, int size, FILE *f);
-int para_mmap(size_t length, int prot, int flags, int fd, off_t offset,
- void *map);
+int para_mmap(size_t length, int prot, int flags, int fd, void *map);
int para_open(const char *path, int flags, mode_t mode);
int para_mkdir(const char *path, mode_t mode);
int para_chdir(const char *path);
goto err;
}
ret = para_mmap(statbuf.st_size, PROT_READ, MAP_PRIVATE | MAP_POPULATE,
- passed_fd, 0, &vsst->map);
+ passed_fd, &vsst->map);
if (ret < 0)
goto err;
vsst->mapsize = statbuf.st_size;