160484Sobrien/* 260484Sobrien * CDDL HEADER START 360484Sobrien * 460484Sobrien * The contents of this file are subject to the terms of the 560484Sobrien * Common Development and Distribution License (the "License"). 660484Sobrien * You may not use this file except in compliance with the License. 760484Sobrien * 860484Sobrien * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 960484Sobrien * or http://www.opensolaris.org/os/licensing. 1060484Sobrien * See the License for the specific language governing permissions 1160484Sobrien * and limitations under the License. 1260484Sobrien * 1360484Sobrien * When distributing Covered Code, include this CDDL HEADER in each 1460484Sobrien * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 1560484Sobrien * If applicable, add the following below this CDDL HEADER, with the 1660484Sobrien * fields enclosed by brackets "[]" replaced with your own identifying 1760484Sobrien * information: Portions Copyright [yyyy] [name of copyright owner] 1860484Sobrien * 1960484Sobrien * CDDL HEADER END 2060484Sobrien */ 2160484Sobrien 2260484Sobrien/* 2360484Sobrien * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 2460484Sobrien * Use is subject to license terms. 2560484Sobrien */ 2660484Sobrien 2760484Sobrien#pragma ident "%Z%%M% %I% %E% SMI" 2860484Sobrien 2960484Sobrien#include <sys/types.h> 3060484Sobrien#include <sys/wait.h> 3160484Sobrien#include <spawn.h> 3260484Sobrien#include <signal.h> 3360484Sobrien#include <stdio.h> 3460484Sobrien 3560484Sobrienvoid 3660484Sobriengo(void) 3760484Sobrien{ 3860484Sobrien pid_t pid; 3960484Sobrien 4060484Sobrien (void) posix_spawn(&pid, "/bin/ls", NULL, NULL, NULL, NULL); 4160484Sobrien 4260484Sobrien (void) waitpid(pid, NULL, 0); 4360484Sobrien} 4460484Sobrien 4560484Sobrienvoid 4660484Sobrienintr(int sig) 4760484Sobrien{ 4860484Sobrien} 4960484Sobrien 5060484Sobrienint 5160484Sobrienmain(int argc, char **argv) 5260484Sobrien{ 5360484Sobrien struct sigaction sa; 5460484Sobrien 5560484Sobrien sa.sa_handler = intr; 5660484Sobrien sigfillset(&sa.sa_mask); 5760484Sobrien sa.sa_flags = 0; 5860484Sobrien 5960484Sobrien (void) sigaction(SIGUSR1, &sa, NULL); 6060484Sobrien 6160484Sobrien for (;;) { 6260484Sobrien go(); 6360484Sobrien } 6460484Sobrien 6560484Sobrien return (0); 6660484Sobrien} 6760484Sobrien