xref: /freebsd/include/ssp/unistd.h (revision e55512504d0178983978d64d67eed1cc85826523)
1be04fec4SKyle Evans /*	$NetBSD: unistd.h,v 1.7 2015/06/25 18:41:03 joerg Exp $	*/
2be04fec4SKyle Evans 
3be04fec4SKyle Evans /*-
4be04fec4SKyle Evans  *
5be04fec4SKyle Evans  * SPDX-License-Identifier: BSD-2-Clause
6be04fec4SKyle Evans  *
7be04fec4SKyle Evans  * Copyright (c) 2006 The NetBSD Foundation, Inc.
8be04fec4SKyle Evans  * All rights reserved.
9be04fec4SKyle Evans  *
10be04fec4SKyle Evans  * This code is derived from software contributed to The NetBSD Foundation
11be04fec4SKyle Evans  * by Christos Zoulas.
12be04fec4SKyle Evans  *
13be04fec4SKyle Evans  * Redistribution and use in source and binary forms, with or without
14be04fec4SKyle Evans  * modification, are permitted provided that the following conditions
15be04fec4SKyle Evans  * are met:
16be04fec4SKyle Evans  * 1. Redistributions of source code must retain the above copyright
17be04fec4SKyle Evans  *    notice, this list of conditions and the following disclaimer.
18be04fec4SKyle Evans  * 2. Redistributions in binary form must reproduce the above copyright
19be04fec4SKyle Evans  *    notice, this list of conditions and the following disclaimer in the
20be04fec4SKyle Evans  *    documentation and/or other materials provided with the distribution.
21be04fec4SKyle Evans  *
22be04fec4SKyle Evans  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
23be04fec4SKyle Evans  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
24be04fec4SKyle Evans  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
25be04fec4SKyle Evans  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
26be04fec4SKyle Evans  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27be04fec4SKyle Evans  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28be04fec4SKyle Evans  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29be04fec4SKyle Evans  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30be04fec4SKyle Evans  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31be04fec4SKyle Evans  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32be04fec4SKyle Evans  * POSSIBILITY OF SUCH DAMAGE.
33be04fec4SKyle Evans  */
34be04fec4SKyle Evans #ifndef _SSP_UNISTD_H_
35be04fec4SKyle Evans #define _SSP_UNISTD_H_
36be04fec4SKyle Evans 
37be04fec4SKyle Evans #include <ssp/ssp.h>
38be04fec4SKyle Evans 
39be04fec4SKyle Evans #if __SSP_FORTIFY_LEVEL > 0
40be04fec4SKyle Evans __BEGIN_DECLS
41be04fec4SKyle Evans 
42*e5551250SKyle Evans #ifndef _FORTIFY_SOURCE_read
43*e5551250SKyle Evans #define	_FORTIFY_SOURCE_read	read
44*e5551250SKyle Evans #endif
45*e5551250SKyle Evans 
46*e5551250SKyle Evans __ssp_redirect0(ssize_t, _FORTIFY_SOURCE_read, (int __fd, void *__buf,
47*e5551250SKyle Evans     size_t __len), (__fd, __buf, __len));
48be04fec4SKyle Evans 
49be04fec4SKyle Evans __ssp_redirect(ssize_t, readlink, (const char *__restrict __path, \
50be04fec4SKyle Evans     char *__restrict __buf, size_t __len), (__path, __buf, __len));
51be04fec4SKyle Evans 
52be04fec4SKyle Evans __ssp_redirect_raw(char *, getcwd, getcwd, (char *__buf, size_t __len),
53be04fec4SKyle Evans     (__buf, __len), __buf != 0, __ssp_bos);
54be04fec4SKyle Evans 
55be04fec4SKyle Evans __END_DECLS
56be04fec4SKyle Evans 
57be04fec4SKyle Evans #endif /* __SSP_FORTIFY_LEVEL > 0 */
58be04fec4SKyle Evans #endif /* _SSP_UNISTD_H_ */
59