]>
git.saurik.com Git - apple/libc.git/blob - include/secure/_stdio.h
9d1b16348c46171fa951f7116b74918caeba5183
2 * Copyright (c) 2007 Apple Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
21 * @APPLE_LICENSE_HEADER_END@
25 #error error "Never use <secure/_stdio.h> directly; include <stdio.h> instead."
28 #ifndef _SECURE__STDIO_H_
29 #define _SECURE__STDIO_H_
31 #include <secure/_common.h>
33 #if _USE_FORTIFY_LEVEL > 0
40 /* sprintf, vsprintf, snprintf, vsnprintf */
42 extern int __sprintf_chk (char * __restrict
, int, size_t,
43 const char * __restrict
, ...)
44 __DARWIN_LDBL_COMPAT (__sprintf_chk
);
46 #define sprintf(str, ...) \
47 __builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__)
49 extern int __snprintf_chk (char * __restrict
, size_t, int, size_t,
50 const char * __restrict
, ...)
51 __DARWIN_LDBL_COMPAT (__snprintf_chk
);
53 #define snprintf(str, len, ...) \
54 __builtin___snprintf_chk (str, len, 0, __darwin_obsz(str), __VA_ARGS__)
56 extern int __vsprintf_chk (char * __restrict
, int, size_t,
57 const char * __restrict
, va_list)
58 __DARWIN_LDBL_COMPAT (__vsprintf_chk
);
60 #define vsprintf(str, format, ap) \
61 __builtin___vsprintf_chk (str, 0, __darwin_obsz(str), format, ap)
63 extern int __vsnprintf_chk (char * __restrict
, size_t, int, size_t,
64 const char * __restrict
, va_list)
65 __DARWIN_LDBL_COMPAT (__vsnprintf_chk
);
67 #define vsnprintf(str, len, format, ap) \
68 __builtin___vsnprintf_chk (str, len, 0, __darwin_obsz(str), format, ap)