diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2015-03-18 15:11:32 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2015-03-18 15:11:32 +0000 |
commit | fa4bfdcce582071db65c68fb3267414aba5c4837 (patch) | |
tree | feb0e94668cb371684e3789eb10f27289c1418f2 /lib | |
parent | 0b9e2b1cfec8a0b09290cf013863810bdb628d6a (diff) |
use 4x buffer size for opendir. speeds up large directory reading, and
increased memory use is minimal.
ok deraadt logan
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/gen/opendir.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/gen/opendir.c b/lib/libc/gen/opendir.c index ed6f7a980ea..36896280a19 100644 --- a/lib/libc/gen/opendir.c +++ b/lib/libc/gen/opendir.c @@ -1,4 +1,4 @@ -/* $OpenBSD: opendir.c,v 1.27 2014/03/10 07:54:14 schwarze Exp $ */ +/* $OpenBSD: opendir.c,v 1.28 2015/03/18 15:11:31 tedu Exp $ */ /* * Copyright (c) 1983, 1993 * The Regents of the University of California. All rights reserved. @@ -104,7 +104,7 @@ __fdopendir(int fd) return (NULL); pageoffset = getpagesize() - 1; - dirp->dd_len = ((int)sb.st_blksize + pageoffset) & ~pageoffset; + dirp->dd_len = ((int)sb.st_blksize * 4 + pageoffset) & ~pageoffset; dirp->dd_buf = malloc((size_t)dirp->dd_len); if (dirp->dd_buf == NULL) { free(dirp); |