xref: /onnv-gate/usr/src/lib/libc/inc/lint.h (revision 9569:5657927bc642)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
56812Sraf  * Common Development and Distribution License (the "License").
66812Sraf  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
216812Sraf 
220Sstevel@tonic-gate /*
23*9569SRod.Evans@Sun.COM  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
240Sstevel@tonic-gate  * Use is subject to license terms.
250Sstevel@tonic-gate  */
260Sstevel@tonic-gate 
270Sstevel@tonic-gate #ifndef _LIBC_LINT_H
280Sstevel@tonic-gate #define	_LIBC_LINT_H
290Sstevel@tonic-gate 
300Sstevel@tonic-gate #ifdef __cplusplus
310Sstevel@tonic-gate extern "C" {
320Sstevel@tonic-gate #endif
330Sstevel@tonic-gate 
340Sstevel@tonic-gate /*
350Sstevel@tonic-gate  * We must include "lint.h" as the first #include in all libc source files
360Sstevel@tonic-gate  * for the purpose of running lint over libc, else lint errors occur due to
370Sstevel@tonic-gate  * lint not knowing the details of the implementation of locales and stdio.
380Sstevel@tonic-gate  */
390Sstevel@tonic-gate #if defined(__lint)
406812Sraf 
410Sstevel@tonic-gate #include "mbstatet.h"
420Sstevel@tonic-gate #include "file64.h"
436812Sraf 
446812Sraf #else
456812Sraf 
466812Sraf /*
476812Sraf  * Small optimization for callers of syscall() and __systemcall().
486812Sraf  * This could/should be defined elsewhere, but here is a particularly
496812Sraf  * attractive place since all source files in libc include "lint.h".
506812Sraf  */
516812Sraf #define	syscall		_syscall6
526812Sraf #define	__systemcall	__systemcall6
536812Sraf 
54*9569SRod.Evans@Sun.COM /*
55*9569SRod.Evans@Sun.COM  * Shades of the old and deprecated "synonyms.h" file.
56*9569SRod.Evans@Sun.COM  * Because of the awkward relationship between these functions:
57*9569SRod.Evans@Sun.COM  *	memcmp()
58*9569SRod.Evans@Sun.COM  *	memcpy()
59*9569SRod.Evans@Sun.COM  *	memmove()
60*9569SRod.Evans@Sun.COM  *	memset()
61*9569SRod.Evans@Sun.COM  * and the sparc auxiliary filters:
62*9569SRod.Evans@Sun.COM  *	/platform/.../lib/libc_psr.so.1
63*9569SRod.Evans@Sun.COM  * we must be careful always to call the leading-underscore
64*9569SRod.Evans@Sun.COM  * symbol names when calling from within libc itself.
65*9569SRod.Evans@Sun.COM  *
66*9569SRod.Evans@Sun.COM  * If an interposer interposes on these mem*() symbol names,
67*9569SRod.Evans@Sun.COM  * and we call one of them from within a critical region in libc,
68*9569SRod.Evans@Sun.COM  * we will end up in the interposer code while executing within
69*9569SRod.Evans@Sun.COM  * the critical region.  Chaos can ensue.
70*9569SRod.Evans@Sun.COM  *
71*9569SRod.Evans@Sun.COM  * We try to avoid this by calling only the leading-underscore names.
72*9569SRod.Evans@Sun.COM  * We hope that no interposer will interpose on the leading-underscore
73*9569SRod.Evans@Sun.COM  * versions of these functions, else all hope is lost.
74*9569SRod.Evans@Sun.COM  */
75*9569SRod.Evans@Sun.COM 
76*9569SRod.Evans@Sun.COM #pragma	redefine_extname	memcmp		_memcmp
77*9569SRod.Evans@Sun.COM #pragma	redefine_extname	memcpy		_memcpy
78*9569SRod.Evans@Sun.COM #pragma	redefine_extname	memmove		_memmove
79*9569SRod.Evans@Sun.COM #pragma	redefine_extname	memset		_memset
80*9569SRod.Evans@Sun.COM 
810Sstevel@tonic-gate #endif
820Sstevel@tonic-gate 
830Sstevel@tonic-gate #ifdef __cplusplus
840Sstevel@tonic-gate }
850Sstevel@tonic-gate #endif
860Sstevel@tonic-gate 
870Sstevel@tonic-gate #endif /* _LIBC_LINT_H */
88