version 1.3, 1996/06/26 05:40:15 |
version 1.4, 1997/01/12 23:43:05 |
|
|
#include <sys/time.h> |
#include <sys/time.h> |
#include <sys/mman.h> |
#include <sys/mman.h> |
|
|
#include <limits.h> |
#include <err.h> |
#include <fcntl.h> |
|
#include <errno.h> |
#include <errno.h> |
#include <unistd.h> |
#include <fcntl.h> |
|
#include <limits.h> |
#include <stdio.h> |
#include <stdio.h> |
#include <stdlib.h> |
#include <stdlib.h> |
#include <string.h> |
#include <string.h> |
|
#include <unistd.h> |
|
|
#include "extern.h" |
#include "extern.h" |
|
|
static void rlines __P((FILE *, long, struct stat *)); |
static void rlines __P((FILE *, long, struct stat *)); |
|
|
second.tv_sec = 1; |
second.tv_sec = 1; |
second.tv_usec = 0; |
second.tv_usec = 0; |
if (select(0, NULL, NULL, NULL, &second) == -1) |
if (select(0, NULL, NULL, NULL, &second) == -1) |
err(1, "select: %s", strerror(errno)); |
err(1, "select"); |
clearerr(fp); |
clearerr(fp); |
} |
} |
} |
} |
|
|
return; |
return; |
|
|
if (size > SIZE_T_MAX) { |
if (size > SIZE_T_MAX) { |
err(0, "%s: %s", fname, strerror(EFBIG)); |
errx(0, "%s: %s", fname, strerror(EFBIG)); |
return; |
return; |
} |
} |
|
|
if ((start = mmap(NULL, (size_t)size, |
if ((start = mmap(NULL, (size_t)size, |
PROT_READ, 0, fileno(fp), (off_t)0)) == (caddr_t)-1) { |
PROT_READ, 0, fileno(fp), (off_t)0)) == (caddr_t)-1) { |
err(0, "%s: %s", fname, strerror(EFBIG)); |
errx(0, "%s: %s", fname, strerror(EFBIG)); |
return; |
return; |
} |
} |
|
|
|
|
return; |
return; |
} |
} |
if (munmap(start, (size_t)sbp->st_size)) { |
if (munmap(start, (size_t)sbp->st_size)) { |
err(0, "%s: %s", fname, strerror(errno)); |
err(0, fname); |
return; |
return; |
} |
} |
} |
} |