err.badbcopy2.d revision 178476
1153809Skbyanc/*
2153809Skbyanc * CDDL HEADER START
3175061Sobrien *
4153809Skbyanc * The contents of this file are subject to the terms of the
5153809Skbyanc * Common Development and Distribution License (the "License").
6175061Sobrien * You may not use this file except in compliance with the License.
7153809Skbyanc *
8153809Skbyanc * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9153809Skbyanc * or http://www.opensolaris.org/os/licensing.
10153809Skbyanc * See the License for the specific language governing permissions
11153809Skbyanc * and limitations under the License.
12153809Skbyanc *
13153809Skbyanc * When distributing Covered Code, include this CDDL HEADER in each
14153809Skbyanc * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15153809Skbyanc * If applicable, add the following below this CDDL HEADER, with the
16153809Skbyanc * fields enclosed by brackets "[]" replaced with your own identifying
17153809Skbyanc * information: Portions Copyright [yyyy] [name of copyright owner]
18175061Sobrien *
19153809Skbyanc * CDDL HEADER END
20153809Skbyanc */
21153809Skbyanc
22153809Skbyanc/*
23153809Skbyanc * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
24153809Skbyanc * Use is subject to license terms.
25153809Skbyanc */
26153809Skbyanc
27153809Skbyanc#pragma	ident	"%Z%%M%	%I%	%E% SMI"
28153809Skbyanc
29153809Skbyanc/*
30153809Skbyanc * ASSERTION:
31175061Sobrien *	bcopy should not copy from one memory location to another
32153809Skbyanc *	if the memory is not properly allocated
33153809Skbyanc *
34153809Skbyanc * SECTION: Actions and Subroutines/bcopy()
35153809Skbyanc *
36153809Skbyanc */
37153809Skbyanc
38153809Skbyanc#pragma D option quiet
39153809Skbyanc
40153809Skbyancint *ptr;
41153809Skbyanc
42153809SkbyancBEGIN
43153809Skbyanc{
44153809Skbyanc	/* Attempt to copy to non-scratch memory */
45153809Skbyanc
46153809Skbyanc	bcopy((void *)&`kmem_flags, ptr, sizeof (int));
47153809Skbyanc	exit(0);
48153809Skbyanc}
49153809Skbyanc
50153809SkbyancERROR
51153809Skbyanc{
52153809Skbyanc	exit(1);
53153809Skbyanc}
54153809Skbyanc