diff options
author | 2013-12-17 16:33:27 +0000 | |
---|---|---|
committer | 2013-12-17 16:33:27 +0000 | |
commit | a992c6bf4a55ad8cc35755502b4fbec5bd3f404c (patch) | |
tree | f106c76a6376c9235dc1d78188c2b1bbc6aafa05 /lib/libc/stdio/findfp.c | |
parent | Add tcgetsid() now that it is in POSIX base. Man page adapted from (diff) | |
download | wireguard-openbsd-a992c6bf4a55ad8cc35755502b4fbec5bd3f404c.tar.xz wireguard-openbsd-a992c6bf4a55ad8cc35755502b4fbec5bd3f404c.zip |
f_prealloc() goes away. Comment from the original source file:
* XXX. Force immediate allocation of internal memory. Not used by stdio,
* but documented historically for certain applications. Bad applications.
Diffstat (limited to 'lib/libc/stdio/findfp.c')
-rw-r--r-- | lib/libc/stdio/findfp.c | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/lib/libc/stdio/findfp.c b/lib/libc/stdio/findfp.c index 1908a954dac..3594369bf9d 100644 --- a/lib/libc/stdio/findfp.c +++ b/lib/libc/stdio/findfp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: findfp.c,v 1.14 2013/11/13 15:52:48 deraadt Exp $ */ +/* $OpenBSD: findfp.c,v 1.15 2013/12/17 16:33:27 deraadt Exp $ */ /*- * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -140,29 +140,6 @@ found: return (fp); } -#define getdtablesize() sysconf(_SC_OPEN_MAX) - -/* - * XXX. Force immediate allocation of internal memory. Not used by stdio, - * but documented historically for certain applications. Bad applications. - */ -void -f_prealloc(void) -{ - struct glue *g; - int n; - - n = getdtablesize() - FOPEN_MAX + 20; /* 20 for slop. */ - for (g = &__sglue; (n -= g->niobs) > 0 && g->next; g = g->next) - /* void */; - if (n > 0 && ((g = moreglue(n)) != NULL)) { - _THREAD_PRIVATE_MUTEX_LOCK(__sfp_mutex); - lastglue->next = g; - lastglue = g; - _THREAD_PRIVATE_MUTEX_UNLOCK(__sfp_mutex); - } -} - /* * exit() and abort() call _cleanup() through the callback registered * with __atexit_register_cleanup(), set whenever we open or buffer a |