9512fe850e98fdd448c638ca63fdd92a8a510255ahl * CDDL HEADER START
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * The contents of this file are subject to the terms of the
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * Common Development and Distribution License (the "License").
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * You may not use this file except in compliance with the License.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * See the License for the specific language governing permissions
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * and limitations under the License.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * When distributing Covered Code, include this CDDL HEADER in each
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * If applicable, add the following below this CDDL HEADER, with the
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * fields enclosed by brackets "[]" replaced with your own identifying
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * information: Portions Copyright [yyyy] [name of copyright owner]
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * CDDL HEADER END
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * Use is subject to license terms.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl#pragma ident "%Z%%M% %I% %E% SMI"
9512fe850e98fdd448c638ca63fdd92a8a510255ahlstatic void
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * With all of our file descriptors closed, wait here spinning in bogus
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * ioctl() calls until DTrace hits us with a SIGUSR1 to start the test.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * To test the fds[] array, we open /dev/null (a file with reliable
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * pathname and properties) using various flags and seek offsets.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl fds[n++] = open(file, O_RDWR | O_APPEND | O_CREAT | O_DSYNC |
9512fe850e98fdd448c638ca63fdd92a8a510255ahl O_LARGEFILE | O_NOCTTY | O_NONBLOCK | O_NDELAY | O_RSYNC |
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * Once we have all the file descriptors in the state we want to test,
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * issue a bogus ioctl() on each fd with cmd -1 and arg NULL to whack
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * our DTrace script into recording the content of the fds[] array.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl for (i = 0; i < n; i++)