err.badbcopy.d revision 178476
150476Speter/* 237535Sdes * CDDL HEADER START 337535Sdes * 437535Sdes * The contents of this file are subject to the terms of the 540975Sdes * Common Development and Distribution License (the "License"). 640975Sdes * You may not use this file except in compliance with the License. 740975Sdes * 840975Sdes * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 940975Sdes * or http://www.opensolaris.org/os/licensing. 1040975Sdes * See the License for the specific language governing permissions 1140975Sdes * and limitations under the License. 1240975Sdes * 1340975Sdes * When distributing Covered Code, include this CDDL HEADER in each 1440975Sdes * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 1540975Sdes * If applicable, add the following below this CDDL HEADER, with the 1640975Sdes * fields enclosed by brackets "[]" replaced with your own identifying 1740975Sdes * information: Portions Copyright [yyyy] [name of copyright owner] 1840975Sdes * 1940975Sdes * CDDL HEADER END 2077056Sdes */ 21241840Seadler 2240975Sdes/* 2340975Sdes * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 2440975Sdes * Use is subject to license terms. 2540975Sdes */ 2640975Sdes 2740975Sdes#pragma ident "%Z%%M% %I% %E% SMI" 2840975Sdes 2940975Sdes 3040975Sdes/* 3140975Sdes * ASSERTION: 3240975Sdes * bcopy should not allow a copy to memory that is not scratch memory. 3340975Sdes * 3440975Sdes * SECTION: Actions and Subroutines/alloca(); 3540975Sdes * Actions and Subroutines/bcopy() 3640975Sdes * 3740975Sdes */ 3877056Sdes 3977056Sdes#pragma D option quiet 4040975Sdes 4140975Sdes 4240975SdesBEGIN 4340975Sdes{ 4440975Sdes ptr = alloca(sizeof (int)); 4540975Sdes 4655555Sdes /* Attempt a copy from scratch memory to a kernel address */ 47 48 bcopy(ptr, (void *)&`kmem_flags, sizeof (int)); 49 exit(0); 50} 51 52ERROR 53{ 54 exit(1); 55} 56