1140558Ssilby/*-
2140558Ssilby * Copyright (C) 2005 Michael J. Silbersack <silby@freebsd.org>
3140558Ssilby *  All rights reserved.
4140558Ssilby *
5140558Ssilby * Redistribution and use in source and binary forms, with or without
6140558Ssilby * modification, are permitted provided that the following conditions
7140558Ssilby * are met:
8140558Ssilby * 1. Redistributions of source code must retain the above copyright
9140558Ssilby *    notice(s), this list of conditions and the following disclaimer as
10140558Ssilby *    the first lines of this file unmodified other than the possible
11140558Ssilby *    addition of one or more copyright notices.
12140558Ssilby * 2. Redistributions in binary form must reproduce the above copyright
13140558Ssilby *    notice(s), this list of conditions and the following disclaimer in the
14140558Ssilby *    documentation and/or other materials provided with the distribution.
15140558Ssilby *
16140558Ssilby * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY
17140558Ssilby * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18140558Ssilby * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19140558Ssilby * DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
20140558Ssilby * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21140558Ssilby * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22140558Ssilby * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23140558Ssilby * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24140558Ssilby * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25140558Ssilby * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
26140558Ssilby * DAMAGE.
27140558Ssilby */
28140558Ssilby
29140558Ssilby#include <stdio.h>
30140558Ssilby#include <stdlib.h>
31140558Ssilby
32140558Ssilby/*
33140558Ssilby * $FreeBSD$
34140558Ssilby * This program just allocates as many pipes as it can to ensure
35140558Ssilby * that using up all pipe memory doesn't cause a panic.
36140558Ssilby */
37140558Ssilby
38140558Ssilbyint main (void)
39140558Ssilby
40140558Ssilby{
41140558Ssilby	int i, returnval;
42140558Ssilby	int pipes[10000];
43140558Ssilby	for (i = 0; i < 10000; i++) {
44140558Ssilby		returnval = pipe(&pipes[i]);
45140558Ssilby	}
46140558Ssilby	printf("PASS\n");
47140558Ssilby}
48