Deleted Added
full compact
findfp.c (189249) findfp.c (200150)
1/*-
2 * Copyright (c) 1990, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Chris Torek.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 20 unchanged lines hidden (view full) ---

29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 */
32
33#if defined(LIBC_SCCS) && !defined(lint)
34static char sccsid[] = "@(#)findfp.c 8.2 (Berkeley) 1/4/94";
35#endif /* LIBC_SCCS and not lint */
36#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1990, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Chris Torek.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 20 unchanged lines hidden (view full) ---

29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 */
32
33#if defined(LIBC_SCCS) && !defined(lint)
34static char sccsid[] = "@(#)findfp.c 8.2 (Berkeley) 1/4/94";
35#endif /* LIBC_SCCS and not lint */
36#include <sys/cdefs.h>
37__FBSDID("$FreeBSD: head/lib/libc/stdio/findfp.c 189249 2009-03-01 19:25:40Z das $");
37__FBSDID("$FreeBSD: head/lib/libc/stdio/findfp.c 200150 2009-12-05 19:31:38Z ed $");
38
39#include <sys/param.h>
40#include <machine/atomic.h>
41#include <unistd.h>
42#include <stdio.h>
43#include <stdlib.h>
44#include <string.h>
45

--- 117 unchanged lines hidden (view full) ---

163/*
164 * XXX. Force immediate allocation of internal memory. Not used by stdio,
165 * but documented historically for certain applications. Bad applications.
166 */
167__warn_references(f_prealloc,
168 "warning: this program uses f_prealloc(), which is not recommended.");
169
170void
38
39#include <sys/param.h>
40#include <machine/atomic.h>
41#include <unistd.h>
42#include <stdio.h>
43#include <stdlib.h>
44#include <string.h>
45

--- 117 unchanged lines hidden (view full) ---

163/*
164 * XXX. Force immediate allocation of internal memory. Not used by stdio,
165 * but documented historically for certain applications. Bad applications.
166 */
167__warn_references(f_prealloc,
168 "warning: this program uses f_prealloc(), which is not recommended.");
169
170void
171f_prealloc()
171f_prealloc(void)
172{
173 struct glue *g;
174 int n;
175
176 n = getdtablesize() - FOPEN_MAX + 20; /* 20 for slop. */
177 /*
178 * It should be safe to walk the list without locking it;
179 * new nodes are only added to the end and none are ever

--- 37 unchanged lines hidden ---
172{
173 struct glue *g;
174 int n;
175
176 n = getdtablesize() - FOPEN_MAX + 20; /* 20 for slop. */
177 /*
178 * It should be safe to walk the list without locking it;
179 * new nodes are only added to the end and none are ever

--- 37 unchanged lines hidden ---