1 /* Copyright (C) 1998, 2003, 2006, 2012 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, see
16 <http://www.gnu.org/licenses/>. */
20 #include <bits/errno.h>
21 #include <kernel-features.h>
25 #if defined PIC && defined DO_VERSIONING
26 #define SETITIMER __setitimer_tv64
28 #define SETITIMER __setitimer
31 #if defined __ASSUME_TIMEVAL64
32 PSEUDO(SETITIMER, setitimer, 3)
36 /* The problem here is that initially we made struct timeval compatible with
37 OSF/1, using int32. But we defined time_t with uint64, and later found
38 that POSIX requires tv_sec to be time_t.
40 So now we have to do compatibility stuff. */
42 /* The variable is shared between all wrappers around signal handling
43 functions which have RT equivalents. */
44 .comm __libc_missing_axp_tv64, 4
57 ldl t0, __libc_missing_axp_tv64
59 /* Save arguments in case we do need to fall back. */
66 ldi v0, SYS_ify(setitimer)
74 /* If we didn't get ENOSYS, it is a real error. */
76 $err64: cmpeq v0, ENOSYS, t0
78 stl t0, __libc_missing_axp_tv64
80 /* Recover the saved arguments. */
87 /* Conditionally bounce new value down. */
99 1: ldi v0, SYS_ify(osf_setitimer)
103 /* Conditionaly bounce old value up. */
121 SYSCALL_ERROR_HANDLER
124 #endif /* __ASSUME_TIMEVAL64 */
126 #if defined PIC && defined DO_VERSIONING
127 default_symbol_version (__setitimer_tv64, __setitimer, GLIBC_2.1)
129 /* It seems to me to be a misfeature of the assembler that we can only
130 have one version-alias per symbol. So create an alias ourselves.
131 The 'p' is for 'public'. *Shrug* */
132 strong_alias (__setitimer_tv64, __setitimer_tv64p)
133 default_symbol_version (__setitimer_tv64p, setitimer, GLIBC_2.1)
135 weak_alias (__setitimer, setitimer)