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
29290914Sngie#include <sys/param.h>
30140558Ssilby#include <stdio.h>
31140558Ssilby#include <stdlib.h>
32290914Sngie#include <unistd.h>
33140558Ssilby
34140558Ssilby/*
35140558Ssilby * $FreeBSD$
36140558Ssilby * This program just allocates as many pipes as it can to ensure
37140558Ssilby * that using up all pipe memory doesn't cause a panic.
38140558Ssilby */
39140558Ssilby
40290914Sngieint
41290914Sngiemain(void)
42290914Sngie{
43292822Sngie	int pipes[10000];
44290914Sngie	unsigned int i;
45140558Ssilby
46292822Sngie	for (i = 0; i < nitems(pipes); i++)
47292822Sngie		(void)pipe(&pipes[i]);
48140558Ssilby	printf("PASS\n");
49290914Sngie
50290914Sngie	exit(0);
51140558Ssilby}
52