diff options
author | ache <ache@FreeBSD.org> | 2001-03-27 15:53:48 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 2001-03-27 15:53:48 +0000 |
commit | aec4c6204b3dfa70b3214176a6a67ae907395e67 (patch) | |
tree | e4c9eb2e50e966e6025fd675438eccdb7b22e436 /usr.bin/tail/forward.c | |
parent | 17f756a033567100d1690f161ecfd5e528de48a1 (diff) | |
download | FreeBSD-src-aec4c6204b3dfa70b3214176a6a67ae907395e67.zip FreeBSD-src-aec4c6204b3dfa70b3214176a6a67ae907395e67.tar.gz |
Add comment explaining why size not passed directly to mmap, i.e. not relay
on its check.
KNF multi-line comments
(inspired by bde)
Diffstat (limited to 'usr.bin/tail/forward.c')
-rw-r--r-- | usr.bin/tail/forward.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/usr.bin/tail/forward.c b/usr.bin/tail/forward.c index cfcb535..ef046cc 100644 --- a/usr.bin/tail/forward.c +++ b/usr.bin/tail/forward.c @@ -274,15 +274,21 @@ rlines(fp, off, sbp) if (!(size = sbp->st_size)) return; + /* + * size not passed directly to mmap() below because unclear error + * diagnostic "Invalid argument". + */ if (size > SIZE_T_MAX || size < 0) { errno = EFBIG; ierr(); exit(1); } - /* XXX: FIXME - mmap() not support files over 2Gb */ - /* Large file processing require alternative implementation */ - /* for now print nice error diagnostic at least */ + /* + * XXX: FIXME - mmap() not support files over 2GB + * Large file processing require alternative implementation, + * for now print nice error diagnostic at least. + */ if (size > SSIZE_MAX) { errno = EFBIG; ierr(); |