mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-22 17:54:52 +00:00
Add comment explaining why size not passed directly to mmap, i.e. not relay
on its check. KNF multi-line comments (inspired by bde)
This commit is contained in:
parent
d92a0c0bde
commit
6bea9ab43b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=74863
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue