diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2013-12-17 16:33:28 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2013-12-17 16:33:28 +0000 |
commit | 2feed2f335bbfdea25f95c06f2a1dbed4ab64b93 (patch) | |
tree | 53b45239806938f4c5a94b3bb43b1997ba7242fd | |
parent | 04ad14cc66b992ba61004afe4e798dd5c6e42c4c (diff) |
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.
-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 |