1 /* Copyright (C) 1998,2002,2003,2006 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public
15 License along with the GNU C Library; if not, write to the Free
16 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19 #include <sysdep-cancel.h>
21 #include <bits/errno.h>
22 #include <kernel-features.h>
26 #if defined HAVE_ELF && defined PIC && defined DO_VERSIONING
27 #define SELECT __select_tv64
29 #define SELECT __select
32 #if defined __ASSUME_TIMEVAL64
33 PSEUDO(SELECT, select, 5)
37 /* The problem here is that initially we made struct timeval compatible with
38 OSF/1, using int32. But we defined time_t with uint64, and later found
39 that POSIX requires tv_sec to be time_t.
41 So now we have to do compatibility stuff. */
43 /* The variable is shared between all wrappers around signal handling
44 functions which have RT equivalents. */
45 .comm __libc_missing_axp_tv64, 4
57 .mask 0x4000000, 40-64
63 ldl t0, __libc_missing_axp_tv64
66 /* Save timeout early, since we'll need to recover this after
76 /* Save arguments in case we do need to fall back. */
82 ldi v0, SYS_ify(select)
90 /* If we didn't get ENOSYS, it is a real error. */
92 $err64: cmpeq v0, ENOSYS, t0
94 stl t0, __libc_missing_axp_tv64
96 /* Recover the saved arguments. */
105 /* If the timeout argument is present bounce to the smaller fmt. */
113 1: ldi v0, SYS_ify(osf_select)
117 /* ... and bounce the remaining timeout back. */
131 /* Save arguments. */
140 ldl t0, __libc_missing_axp_tv64
143 /* Recover the saved arguments. */
150 ldi v0, SYS_ify(select)
154 bne a3, $cancel_err64
165 /* If we didn't get ENOSYS, it is a real error. */
169 beq t0, $cancel_error
170 stl t0, __libc_missing_axp_tv64
172 /* Recover the saved arguments. */
181 /* If the timeout argument is present bounce to the smaller fmt. */
189 1: ldi v0, SYS_ify(osf_select)
193 bne a3, $cancel_error
195 /* ... and bounce the remaining timeout back. */
222 SYSCALL_ERROR_HANDLER
225 #endif /* __ASSUME_TIMEVAL64 */
227 #if defined HAVE_ELF && defined PIC && defined DO_VERSIONING
228 default_symbol_version (__select_tv64, __select, GLIBC_2.1)
230 /* It seems to me to be a misfeature of the assembler that we can only
231 have one version-alias per symbol. So create an alias ourselves.
232 The 'p' is for 'public'. *Shrug* */
233 strong_alias (__select_tv64, __select_tv64p)
234 default_symbol_version (__select_tv64p, select, GLIBC_2.1)
235 libc_hidden_ver (__select_tv64, __select)
236 strong_alias (__select_tv64, __libc_select)
238 strong_alias (__select, __libc_select)
239 weak_alias (__select, select)
240 libc_hidden_def (__select)