1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
9 * The purpose of this test and the sproc_ch.c test is to test the shutdown
10 * of all the IRIX sprocs in a program when one of them dies due to an error.
12 * In this test, the parent sproc gets a segmentation fault and dies.
13 * The child sproc never stops on its own. You should use "ps" to see if
14 * the child sproc is killed after the parent dies.
22 int main(int argc
, char **argv
)
24 printf("This test applies to IRIX only.\n");
31 #include <sys/types.h>
34 void NeverStops(void *unused
)
38 printf("The child sproc has pid %d.\n", getpid());
39 printf("The child sproc won't stop on its own.\n");
52 PR_Init(PR_USER_THREAD
, PR_PRIORITY_NORMAL
, 0);
54 printf("The parent sproc has pid %d.\n", getpid());
55 printf("The parent sproc will first create a child sproc.\n");
56 printf("Then the parent sproc will get a segmentation fault and die.\n");
57 printf("The child sproc should be killed after the parent sproc dies.\n");
58 printf("Use 'ps' to make sure this is so.\n");
61 PR_CreateThread(PR_USER_THREAD
, NeverStops
, NULL
,
62 PR_PRIORITY_NORMAL
, PR_GLOBAL_THREAD
, PR_UNJOINABLE_THREAD
, 0);
64 /* Force a segmentation fault */