version 1.9, 2015/01/16 06:40:12 |
version 1.10, 2015/02/06 23:21:59 |
|
|
#include <fcntl.h> |
#include <fcntl.h> |
#include <limits.h> |
#include <limits.h> |
#include <locale.h> |
#include <locale.h> |
|
#include <stdint.h> |
#include <stdio.h> |
#include <stdio.h> |
#include <stdlib.h> |
#include <stdlib.h> |
#include <string.h> |
#include <string.h> |
|
|
wlists[i].fd = open(argv[i], O_RDONLY, 0); |
wlists[i].fd = open(argv[i], O_RDONLY, 0); |
if (wlists[i].fd == -1 || fstat(wlists[i].fd, &sb) != 0) |
if (wlists[i].fd == -1 || fstat(wlists[i].fd, &sb) != 0) |
err(1, "%s", argv[i]); |
err(1, "%s", argv[i]); |
if (sb.st_size > SIZE_T_MAX) |
if (sb.st_size > SIZE_MAX) |
errc(1, EFBIG, "%s", argv[i]); |
errc(1, EFBIG, "%s", argv[i]); |
wlists[i].front = mmap(NULL, (size_t)sb.st_size, PROT_READ, |
wlists[i].front = mmap(NULL, (size_t)sb.st_size, PROT_READ, |
MAP_PRIVATE, wlists[i].fd, (off_t)0); |
MAP_PRIVATE, wlists[i].fd, (off_t)0); |