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
21 #include <bits/errno.h>
22 #include <kernel-features.h>
26 #if defined HAVE_ELF && defined PIC && defined DO_VERSIONING
27 #define GETTIMEOFDAY __gettimeofday_tv64
29 #define GETTIMEOFDAY __gettimeofday
32 #if defined __ASSUME_TIMEVAL64
33 PSEUDO(GETTIMEOFDAY, gettimeofday, 2)
35 PSEUDO_END(GETTIMEOFDAY)
38 /* The problem here is that initially we made struct timeval compatible with
39 OSF/1, using int32. But we defined time_t with uint64, and later found
40 that POSIX requires tv_sec to be time_t.
42 So now we have to do compatibility stuff. */
44 /* The variable is shared between all wrappers around signal handling
45 functions which have RT equivalents. */
46 .comm __libc_missing_axp_tv64, 4
48 LEAF(GETTIMEOFDAY, 16)
59 ldl t0, __libc_missing_axp_tv64
61 /* Save arguments in case we do need to fall back. */
67 ldi v0, SYS_ify(gettimeofday)
75 /* If we didn't get ENOSYS, it is a real error. */
77 $err64: cmpeq v0, ENOSYS, t0
79 stl t0, __libc_missing_axp_tv64
81 /* Recover the saved arguments. */
86 $do32: ldi v0, SYS_ify(osf_gettimeofday)
90 /* Copy back to proper format. */
104 SYSCALL_ERROR_HANDLER
107 #endif /* __ASSUME_TIMEVAL64 */
109 #if defined HAVE_ELF && defined PIC && defined DO_VERSIONING
110 default_symbol_version (__gettimeofday_tv64, __gettimeofday, GLIBC_2.1)
112 /* It seems to me to be a misfeature of the assembler that we can only
113 have one version-alias per symbol. So create an alias ourselves.
114 The 'p' is for 'public'. *Shrug* */
115 strong_alias (__gettimeofday_tv64, __gettimeofday_tv64p)
116 default_symbol_version (__gettimeofday_tv64p, gettimeofday, GLIBC_2.1)
118 weak_alias (__gettimeofday, gettimeofday)
120 strong_alias(GETTIMEOFDAY, __gettimeofday_internal)