1 /* Copyright (C) 1998, 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 WAIT4 __wait4_tv64
32 #if defined __ASSUME_TIMEVAL64
33 PSEUDO(WAIT4, wait4, 4)
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
58 ldl t0, __libc_missing_axp_tv64
60 /* Save arguments in case we do need to fall back. */
68 ldi v0, SYS_ify(wait4)
76 /* If we didn't get ENOSYS, it is a real error. */
78 $err64: cmpeq v0, ENOSYS, t0
80 stl t0, __libc_missing_axp_tv64
82 /* Recover the saved arguments. */
89 $do32: ldi v0, SYS_ify(osf_wait4)
93 /* Copy back to proper format. */
96 ldl t0, 0(a3) # ru_utime.tv_sec
97 ldl t1, 4(a3) # ru_utime.tv_usec
98 ldl t2, 8(a3) # ru_stime.tv_sec
99 ldl t3, 12(a3) # ru_stime.tv_usec
100 ldt $f15, 16(a3) # ru_maxrss
101 ldt $f16, 24(a3) # ru_ixrss
102 ldt $f17, 32(a3) # ru_idrss
103 ldt $f18, 40(a3) # ru_isrss
104 ldt $f19, 48(a3) # ru_minflt
105 ldt $f20, 56(a3) # ru_majflt
106 ldt $f21, 64(a3) # ru_nswap
107 ldt $f22, 72(a3) # ru_inblock
108 ldt $f23, 80(a3) # ru_oublock
109 ldt $f24, 88(a3) # ru_msgsend
110 ldt $f25, 96(a3) # ru_msgrcv
111 ldt $f26, 104(a3) # ru_nsignals
112 ldt $f27, 112(a3) # ru_nvcsw
114 ldt $f28, 120(a3) # ru_nivcsw
141 SYSCALL_ERROR_HANDLER
144 #endif /* __ASSUME_TIMEVAL64 */
146 #if defined HAVE_ELF && defined PIC && defined DO_VERSIONING
147 default_symbol_version (__wait4_tv64, __wait4, GLIBC_2.1)
149 /* It seems to me to be a misfeature of the assembler that we can only
150 have one version-alias per symbol. So create an alias ourselves.
151 The 'p' is for 'public'. *Shrug* */
152 strong_alias (__wait4_tv64, __wait4_tv64p)
153 default_symbol_version (__wait4_tv64p, wait4, GLIBC_2.1)
155 weak_alias (__wait4, wait4)