xref: /freebsd/tools/build/libc-bootstrap/namespace.h (revision b3e7694832e81d7a904a10f525f8797b753bf0d3)
17ec1ec4fSAlex Richardson /*-
27ec1ec4fSAlex Richardson  * SPDX-License-Identifier: BSD-2-Clause
37ec1ec4fSAlex Richardson  *
47ec1ec4fSAlex Richardson  * Copyright 2018-2020 Alex Richardson <arichardson@FreeBSD.org>
57ec1ec4fSAlex Richardson  *
67ec1ec4fSAlex Richardson  * This software was developed by SRI International and the University of
77ec1ec4fSAlex Richardson  * Cambridge Computer Laboratory (Department of Computer Science and
87ec1ec4fSAlex Richardson  * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the
97ec1ec4fSAlex Richardson  * DARPA SSITH research programme.
107ec1ec4fSAlex Richardson  *
117ec1ec4fSAlex Richardson  * This software was developed by SRI International and the University of
127ec1ec4fSAlex Richardson  * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237)
137ec1ec4fSAlex Richardson  * ("CTSRD"), as part of the DARPA CRASH research programme.
147ec1ec4fSAlex Richardson  *
157ec1ec4fSAlex Richardson  * Redistribution and use in source and binary forms, with or without
167ec1ec4fSAlex Richardson  * modification, are permitted provided that the following conditions
177ec1ec4fSAlex Richardson  * are met:
187ec1ec4fSAlex Richardson  * 1. Redistributions of source code must retain the above copyright
197ec1ec4fSAlex Richardson  *    notice, this list of conditions and the following disclaimer.
207ec1ec4fSAlex Richardson  * 2. Redistributions in binary form must reproduce the above copyright
217ec1ec4fSAlex Richardson  *    notice, this list of conditions and the following disclaimer in the
227ec1ec4fSAlex Richardson  *    documentation and/or other materials provided with the distribution.
237ec1ec4fSAlex Richardson  *
247ec1ec4fSAlex Richardson  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
257ec1ec4fSAlex Richardson  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
267ec1ec4fSAlex Richardson  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
277ec1ec4fSAlex Richardson  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
287ec1ec4fSAlex Richardson  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
297ec1ec4fSAlex Richardson  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
307ec1ec4fSAlex Richardson  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
317ec1ec4fSAlex Richardson  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
327ec1ec4fSAlex Richardson  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
337ec1ec4fSAlex Richardson  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
347ec1ec4fSAlex Richardson  * SUCH DAMAGE.
357ec1ec4fSAlex Richardson  */
367ec1ec4fSAlex Richardson #pragma once
377ec1ec4fSAlex Richardson 
387ec1ec4fSAlex Richardson #define _open(...)	open(__VA_ARGS__)
397ec1ec4fSAlex Richardson #define _close(a)	close(a)
407ec1ec4fSAlex Richardson #define _fstat(a, b)	fstat(a, b)
417ec1ec4fSAlex Richardson #define _read(a, b, c)	read(a, b, c)
427ec1ec4fSAlex Richardson #define _write(a, b, c)	write(a, b, c)
437ec1ec4fSAlex Richardson #define _writev(a, b, c)	writev(a, b, c)
447ec1ec4fSAlex Richardson #define _fsync(a)	fsync(a)
457ec1ec4fSAlex Richardson #define	_getprogname()	getprogname()
46*02af91c5SAlex Richardson /* These two need to be renamed to build libc/gen/err.c */
47*02af91c5SAlex Richardson #define	err	_err
48*02af91c5SAlex Richardson #define	warn	_warn
497ec1ec4fSAlex Richardson 
507ec1ec4fSAlex Richardson #define _pthread_mutex_unlock	pthread_mutex_unlock
517ec1ec4fSAlex Richardson #define _pthread_mutex_lock	pthread_mutex_lock
527ec1ec4fSAlex Richardson 
53