xref: /freebsd/lib/libc/include/namespace.h (revision 43a5ec4eb41567cc92586503212743d89686d78f)
1 /*-
2  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3  *
4  * Copyright (c) 2001 Daniel Eischen <deischen@FreeBSD.org>.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  * 1. Redistributions of source code must retain the above copyright
11  *    notice, this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright
13  *    notice, this list of conditions and the following disclaimer in the
14  *    documentation and/or other materials provided with the distribution.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26  * SUCH DAMAGE.
27  *
28  * $FreeBSD$
29  */
30 
31 #ifndef _NAMESPACE_H_
32 #define _NAMESPACE_H_
33 
34 /*
35  * Adjust names so that headers declare "hidden" names.
36  *
37  * README: When modifying this file don't forget to make the appropriate
38  *         changes in un-namespace.h!!!
39  */
40 
41 /*
42  * ISO C (C90) section.  Most names in libc aren't in ISO C, so they
43  * should be here.  Most aren't here...
44  */
45 #define		err				_err
46 #define		warn				_warn
47 #define		nsdispatch			_nsdispatch
48 
49 /*
50  * Prototypes for syscalls/functions that need to be overridden
51  * in libc_r/libpthread.
52  */
53 #define		accept				_accept
54 #define		__acl_aclcheck_fd		___acl_aclcheck_fd
55 #define		__acl_delete_fd			___acl_delete_fd
56 #define		__acl_get_fd			___acl_get_fd
57 #define		__acl_set_fd			___acl_set_fd
58 #define		bind				_bind
59 #define		__cap_get_fd			___cap_get_fd
60 #define		__cap_set_fd			___cap_set_fd
61 #define		clock_nanosleep			_clock_nanosleep
62 #define		close				_close
63 #define		connect				_connect
64 #define		dup				_dup
65 #define		dup2				_dup2
66 #define		execve				_execve
67 #define		fcntl				_fcntl
68 /*#define		flock				_flock */
69 #define		flockfile			_flockfile
70 #define		fpathconf			_fpathconf
71 #define		fstat				_fstat
72 #define		fstatfs				_fstatfs
73 #define		fsync				_fsync
74 #define		funlockfile			_funlockfile
75 #define		getdirentries			_getdirentries
76 #define		getlogin			_getlogin
77 #define		getpeername			_getpeername
78 #define		getprogname			_getprogname
79 #define		getsockname			_getsockname
80 #define		getsockopt			_getsockopt
81 #define		ioctl				_ioctl
82 /* #define		kevent				_kevent */
83 #define		listen				_listen
84 #define		nanosleep			_nanosleep
85 #define		open				_open
86 #define		openat				_openat
87 #define		poll				_poll
88 #define		pthread_atfork			_pthread_atfork
89 #define		pthread_attr_destroy		_pthread_attr_destroy
90 #define		pthread_attr_get_np		_pthread_attr_get_np
91 #define		pthread_attr_getaffinity_np	_pthread_attr_getaffinity_np
92 #define		pthread_attr_getdetachstate	_pthread_attr_getdetachstate
93 #define		pthread_attr_getguardsize	_pthread_attr_getguardsize
94 #define		pthread_attr_getinheritsched	_pthread_attr_getinheritsched
95 #define		pthread_attr_getschedparam	_pthread_attr_getschedparam
96 #define		pthread_attr_getschedpolicy	_pthread_attr_getschedpolicy
97 #define		pthread_attr_getscope		_pthread_attr_getscope
98 #define		pthread_attr_getstack		_pthread_attr_getstack
99 #define		pthread_attr_getstackaddr	_pthread_attr_getstackaddr
100 #define		pthread_attr_getstacksize	_pthread_attr_getstacksize
101 #define		pthread_attr_init		_pthread_attr_init
102 #define		pthread_attr_setaffinity_np	_pthread_attr_setaffinity_np
103 #define		pthread_attr_setcreatesuspend_np _pthread_attr_setcreatesuspend_np
104 #define		pthread_attr_setdetachstate	_pthread_attr_setdetachstate
105 #define		pthread_attr_setguardsize	_pthread_attr_setguardsize
106 #define		pthread_attr_setinheritsched	_pthread_attr_setinheritsched
107 #define		pthread_attr_setschedparam	_pthread_attr_setschedparam
108 #define		pthread_attr_setschedpolicy	_pthread_attr_setschedpolicy
109 #define		pthread_attr_setscope		_pthread_attr_setscope
110 #define		pthread_attr_setstack		_pthread_attr_setstack
111 #define		pthread_attr_setstackaddr	_pthread_attr_setstackaddr
112 #define		pthread_attr_setstacksize	_pthread_attr_setstacksize
113 #define		pthread_barrier_destroy		_pthread_barrier_destroy
114 #define		pthread_barrier_init		_pthread_barrier_init
115 #define		pthread_barrier_wait		_pthread_barrier_wait
116 #define		pthread_barrierattr_destroy	_pthread_barrierattr_destroy
117 #define		pthread_barrierattr_getpshared	_pthread_barrierattr_getpshared
118 #define		pthread_barrierattr_init	_pthread_barrierattr_init
119 #define		pthread_barrierattr_setpshared	_pthread_barrierattr_setpshared
120 #define		pthread_cancel			_pthread_cancel
121 #define		pthread_cond_broadcast		_pthread_cond_broadcast
122 #define		pthread_cond_destroy		_pthread_cond_destroy
123 #define		pthread_cond_init		_pthread_cond_init
124 #define		pthread_cond_signal		_pthread_cond_signal
125 #define		pthread_cond_timedwait		_pthread_cond_timedwait
126 #define		pthread_cond_wait		_pthread_cond_wait
127 #define		pthread_condattr_destroy	_pthread_condattr_destroy
128 #define		pthread_condattr_getclock	_pthread_condattr_getclock
129 #define		pthread_condattr_getpshared	_pthread_condattr_getpshared
130 #define		pthread_condattr_init		_pthread_condattr_init
131 #define		pthread_condattr_setclock	_pthread_condattr_setclock
132 #define		pthread_condattr_setpshared	_pthread_condattr_setpshared
133 #define		pthread_create			_pthread_create
134 #define		pthread_detach			_pthread_detach
135 #define		pthread_equal			_pthread_equal
136 #define		pthread_exit			_pthread_exit
137 #define		pthread_get_name_np		_pthread_get_name_np
138 #define		pthread_getaffinity_np		_pthread_getaffinity_np
139 #define		pthread_getconcurrency		_pthread_getconcurrency
140 #define		pthread_getcpuclockid		_pthread_getcpuclockid
141 #define		pthread_getname_np		_pthread_getname_np
142 #define		pthread_getprio			_pthread_getprio
143 #define		pthread_getschedparam		_pthread_getschedparam
144 #define		pthread_getspecific		_pthread_getspecific
145 #define		pthread_getthreadid_np		_pthread_getthreadid_np
146 #define		pthread_join			_pthread_join
147 #define		pthread_key_create		_pthread_key_create
148 #define		pthread_key_delete		_pthread_key_delete
149 #define		pthread_kill			_pthread_kill
150 #define		pthread_main_np			_pthread_main_np
151 #define		pthread_multi_np		_pthread_multi_np
152 #define		pthread_mutex_destroy		_pthread_mutex_destroy
153 #define		pthread_mutex_getprioceiling	_pthread_mutex_getprioceiling
154 #define		pthread_mutex_init		_pthread_mutex_init
155 #define		pthread_mutex_isowned_np	_pthread_mutex_isowned_np
156 #define		pthread_mutex_lock		_pthread_mutex_lock
157 #define		pthread_mutex_setprioceiling	_pthread_mutex_setprioceiling
158 #define		pthread_mutex_timedlock		_pthread_mutex_timedlock
159 #define		pthread_mutex_trylock		_pthread_mutex_trylock
160 #define		pthread_mutex_unlock		_pthread_mutex_unlock
161 #define		pthread_mutexattr_destroy	_pthread_mutexattr_destroy
162 #define		pthread_mutexattr_getkind_np	_pthread_mutexattr_getkind_np
163 #define		pthread_mutexattr_getprioceiling _pthread_mutexattr_getprioceiling
164 #define		pthread_mutexattr_getprotocol	_pthread_mutexattr_getprotocol
165 #define		pthread_mutexattr_getpshared	_pthread_mutexattr_getpshared
166 #define		pthread_mutexattr_gettype	_pthread_mutexattr_gettype
167 #define		pthread_mutexattr_init		_pthread_mutexattr_init
168 #define		pthread_mutexattr_setkind_np	_pthread_mutexattr_setkind_np
169 #define		pthread_mutexattr_setprioceiling _pthread_mutexattr_setprioceiling
170 #define		pthread_mutexattr_setprotocol	_pthread_mutexattr_setprotocol
171 #define		pthread_mutexattr_setpshared	_pthread_mutexattr_setpshared
172 #define		pthread_mutexattr_settype	_pthread_mutexattr_settype
173 #define		pthread_once			_pthread_once
174 #define		pthread_resume_all_np		_pthread_resume_all_np
175 #define		pthread_resume_np		_pthread_resume_np
176 #define		pthread_rwlock_destroy		_pthread_rwlock_destroy
177 #define		pthread_rwlock_init		_pthread_rwlock_init
178 #define		pthread_rwlock_rdlock		_pthread_rwlock_rdlock
179 #define		pthread_rwlock_timedrdlock	_pthread_rwlock_timedrdlock
180 #define		pthread_rwlock_timedwrlock	_pthread_rwlock_timedwrlock
181 #define		pthread_rwlock_tryrdlock	_pthread_rwlock_tryrdlock
182 #define		pthread_rwlock_trywrlock	_pthread_rwlock_trywrlock
183 #define		pthread_rwlock_unlock		_pthread_rwlock_unlock
184 #define		pthread_rwlock_wrlock		_pthread_rwlock_wrlock
185 #define		pthread_rwlockattr_destroy	_pthread_rwlockattr_destroy
186 #define		pthread_rwlockattr_getpshared	_pthread_rwlockattr_getpshared
187 #define		pthread_rwlockattr_init		_pthread_rwlockattr_init
188 #define		pthread_rwlockattr_setpshared	_pthread_rwlockattr_setpshared
189 #define		pthread_self			_pthread_self
190 #define		pthread_set_name_np		_pthread_set_name_np
191 #define		pthread_setaffinity_np		_pthread_setaffinity_np
192 #define		pthread_setcancelstate		_pthread_setcancelstate
193 #define		pthread_setcanceltype		_pthread_setcanceltype
194 #define		pthread_setconcurrency		_pthread_setconcurrency
195 #define		pthread_setname_np		_pthread_setname_np
196 #define		pthread_setprio			_pthread_setprio
197 #define		pthread_setschedparam		_pthread_setschedparam
198 #define		pthread_setspecific		_pthread_setspecific
199 #define		pthread_sigmask			_pthread_sigmask
200 #define		pthread_single_np		_pthread_single_np
201 #define		pthread_spin_destroy		_pthread_spin_destroy
202 #define		pthread_spin_init		_pthread_spin_init
203 #define		pthread_spin_lock		_pthread_spin_lock
204 #define		pthread_spin_trylock		_pthread_spin_trylock
205 #define		pthread_spin_unlock		_pthread_spin_unlock
206 #define		pthread_suspend_all_np		_pthread_suspend_all_np
207 #define		pthread_suspend_np		_pthread_suspend_np
208 #define		pthread_switch_add_np		_pthread_switch_add_np
209 #define		pthread_switch_delete_np	_pthread_switch_delete_np
210 #define		pthread_testcancel		_pthread_testcancel
211 #define		pthread_timedjoin_np		_pthread_timedjoin_np
212 #define		pthread_yield			_pthread_yield
213 #define		read				_read
214 #define		readv				_readv
215 #define		recvfrom			_recvfrom
216 #define		recvmsg				_recvmsg
217 #define		recvmmsg			_recvmmsg
218 #define		select				_select
219 #define		sem_close			_sem_close
220 #define		sem_destroy			_sem_destroy
221 #define		sem_getvalue			_sem_getvalue
222 #define		sem_init			_sem_init
223 #define		sem_open			_sem_open
224 #define		sem_post			_sem_post
225 #define		sem_timedwait			_sem_timedwait
226 #define		sem_clockwait_np		_sem_clockwait_np
227 #define		sem_trywait			_sem_trywait
228 #define		sem_unlink			_sem_unlink
229 #define		sem_wait			_sem_wait
230 #define		sendmsg				_sendmsg
231 #define		sendmmsg			_sendmmsg
232 #define		sendto				_sendto
233 #define		setsockopt			_setsockopt
234 /*#define		sigaction			_sigaction*/
235 #define		sigprocmask			_sigprocmask
236 #define		sigsuspend			_sigsuspend
237 #define		socket				_socket
238 #define		socketpair			_socketpair
239 #define		usleep				_usleep
240 #define		wait4				_wait4
241 #define		wait6				_wait6
242 #define		waitpid				_waitpid
243 #define		write				_write
244 #define		writev				_writev
245 
246 
247 /*
248  * Other hidden syscalls/functions that libc_r needs to override
249  * but are not used internally by libc.
250  *
251  * XXX - When modifying libc to use one of the following, remove
252  * the prototype from below and place it in the list above.
253  */
254 #if 0
255 #define		creat				_creat
256 #define		fchflags			_fchflags
257 #define		fchmod				_fchmod
258 #define		ftrylockfile			_ftrylockfile
259 #define		msync				_msync
260 #define		nfssvc				_nfssvc
261 #define		pause				_pause
262 #define		sched_yield			_sched_yield
263 #define		sendfile			_sendfile
264 #define		shutdown			_shutdown
265 #define		sigaltstack			_sigaltstack
266 #define		sigpending			_sigpending
267 #define		sigreturn			_sigreturn
268 #define		sigsetmask			_sigsetmask
269 #define		sleep				_sleep
270 #define		system				_system
271 #define		tcdrain				_tcdrain
272 #define		wait				_wait
273 #endif
274 
275 #endif /* _NAMESPACE_H_ */
276