tst.sdtargs.c revision 251237
1210753Srpaulo/* 2210753Srpaulo * CDDL HEADER START 3210753Srpaulo * 4210753Srpaulo * The contents of this file are subject to the terms of the 5210753Srpaulo * Common Development and Distribution License (the "License"). 6210753Srpaulo * You may not use this file except in compliance with the License. 7210753Srpaulo * 8210753Srpaulo * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9210753Srpaulo * or http://www.opensolaris.org/os/licensing. 10210753Srpaulo * See the License for the specific language governing permissions 11210753Srpaulo * and limitations under the License. 12210753Srpaulo * 13210753Srpaulo * When distributing Covered Code, include this CDDL HEADER in each 14210753Srpaulo * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15210753Srpaulo * If applicable, add the following below this CDDL HEADER, with the 16210753Srpaulo * fields enclosed by brackets "[]" replaced with your own identifying 17210753Srpaulo * information: Portions Copyright [yyyy] [name of copyright owner] 18210753Srpaulo * 19210753Srpaulo * CDDL HEADER END 20210753Srpaulo */ 21210753Srpaulo 22210753Srpaulo/* 23210753Srpaulo * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 24210753Srpaulo * Use is subject to license terms. 25210753Srpaulo */ 26210753Srpaulo 27210753Srpaulo#pragma ident "%Z%%M% %I% %E% SMI" 28210753Srpaulo 29251237Smarkj#include <sys/types.h> 30251237Smarkj#include <sys/sysctl.h> 31251237Smarkj 32251237Smarkj#include <err.h> 33210753Srpaulo#include <unistd.h> 34210753Srpaulo 35210753Srpauloint 36210753Srpaulomain(int argc, char **argv) 37210753Srpaulo{ 38251237Smarkj int val = 1; 39251237Smarkj 40210753Srpaulo while (1) { 41251237Smarkj if (sysctlbyname("debug.dtracetest.sdttest", NULL, NULL, &val, 42251237Smarkj sizeof(val))) 43251237Smarkj err(1, "sysctlbyname"); 44210753Srpaulo 45210753Srpaulo sleep(1); 46210753Srpaulo } 47210753Srpaulo 48210753Srpaulo return (0); 49210753Srpaulo} 50