tst.raise3.c revision 303975
150397Sobrien/* 290075Sobrien * CDDL HEADER START 390075Sobrien * 418334Speter * The contents of this file are subject to the terms of the 518334Speter * Common Development and Distribution License (the "License"). 618334Speter * You may not use this file except in compliance with the License. 718334Speter * 818334Speter * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 918334Speter * or http://www.opensolaris.org/os/licensing. 1018334Speter * See the License for the specific language governing permissions 1118334Speter * and limitations under the License. 1218334Speter * 1318334Speter * When distributing Covered Code, include this CDDL HEADER in each 1418334Speter * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 1518334Speter * If applicable, add the following below this CDDL HEADER, with the 1618334Speter * fields enclosed by brackets "[]" replaced with your own identifying 1718334Speter * information: Portions Copyright [yyyy] [name of copyright owner] 1818334Speter * 1918334Speter * CDDL HEADER END 2018334Speter */ 2118334Speter 2218334Speter/* 2318334Speter * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 2418334Speter * Use is subject to license terms. 2518334Speter */ 2690075Sobrien 2790075Sobrien#pragma ident "%Z%%M% %I% %E% SMI" 2890075Sobrien 2990075Sobrien#include <unistd.h> 3090075Sobrien#include <signal.h> 3190075Sobrien#include <stdlib.h> 3290075Sobrien 3390075Sobrienstatic void 3490075Sobrienhandle(int sig) 3518334Speter{ 3618334Speter exit(0); 3718334Speter} 3818334Speter 3918334Speterint 4018334Spetermain(int argc, char **argv) 4118334Speter{ 4218334Speter struct sigaction sa; 4350397Sobrien 4450397Sobrien sa.sa_handler = handle; 4550397Sobrien sigemptyset(&sa.sa_mask); 4618334Speter sa.sa_flags = 0; 4718334Speter 4890075Sobrien (void) sigaction(SIGINT, &sa, NULL); 4918334Speter 5090075Sobrien for (;;) { 5190075Sobrien (void) getpid(); 5290075Sobrien } 5318334Speter} 5490075Sobrien