tst.signal.ksh revision 14ea49401f3c8c61422aefbda43809e275f60c6c
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# CDDL HEADER START
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# The contents of this file are subject to the terms of the
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# Common Development and Distribution License (the "License").
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# You may not use this file except in compliance with the License.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# See the License for the specific language governing permissions
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# and limitations under the License.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# When distributing Covered Code, include this CDDL HEADER in each
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# If applicable, add the following below this CDDL HEADER, with the
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# fields enclosed by brackets "[]" replaced with your own identifying
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# information: Portions Copyright [yyyy] [name of copyright owner]
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# CDDL HEADER END
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# Use is subject to license terms.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# ident "%Z%%M% %I% %E% SMI"
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# This script tests that the proc:::signal-send and proc:::signal-handle
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# probes fire correctly and with the correct arguments.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# If this fails, the script will run indefinitely; it relies on the harness
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# to time it out.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync proc:::signal-send
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync /execname == "kill" && curpsinfo->pr_ppid == $child &&
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync args[1]->pr_psargs == "$longsleep" && args[2] == SIGUSR1/
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * This is guaranteed to not race with signal-handle.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync target = args[1]->pr_pid;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync proc:::signal-handle
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync /target == pid && args[0] == SIGUSR1/
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync while true; do
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncif [ $# != 1 ]; then