aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>1998-02-04 10:17:52 +0000
committerRichard Henderson <rth@redhat.com>1998-02-04 10:17:52 +0000
commit823bc6527dae4ef44cb43794628fb07fc0d9544d (patch)
tree1c66f06467e5fb86fa2db4bb75759bc83c6b17f4 /sysdeps/unix/sysv
parent566efee21908cc59bb0645c3208446f3dedebce8 (diff)
downloadglibc-823bc6527dae4ef44cb43794628fb07fc0d9544d.tar
glibc-823bc6527dae4ef44cb43794628fb07fc0d9544d.tar.gz
glibc-823bc6527dae4ef44cb43794628fb07fc0d9544d.tar.bz2
glibc-823bc6527dae4ef44cb43794628fb07fc0d9544d.zip
* sysdeps/unix/sysv/linux/alpha/clone.S: Elide terminal ldgp for PROF. * sysdeps/unix/sysv/linux/alpha/rt_sigaction.S: Fix typos. * sysdeps/unix/sysv/linux/alpha/bits/time.h (struct timeval): Follow POSIX and make tv_sec a time_t. * sysdeps/unix/sysv/linux/alpha/getitimer.S: New file to handle new tv64 syscall as well as fall back to tv32. * sysdeps/unix/sysv/linux/alpha/getrusage.S: Likewise. * sysdeps/unix/sysv/linux/alpha/gettimeofday.S: Likewise. * sysdeps/unix/sysv/linux/alpha/select.S: Likewise. * sysdeps/unix/sysv/linux/alpha/setitimer.S: Likewise. * sysdeps/unix/sysv/linux/alpha/settimeofday.S: Likewise. * sysdeps/unix/sysv/linux/alpha/utimes.S: Likewise. * sysdeps/unix/sysv/linux/alpha/wait4.S: Likewise. * sysdeps/unix/sysv/linux/alpha/syscalls.list: Add tv32 entries.
1998-02-04 18:04 Richard Henderson <rth@cygnus.com> * sysdeps/unix/sysv/linux/alpha/clone.S: Elide terminal ldgp for PROF. * sysdeps/unix/sysv/linux/alpha/rt_sigaction.S: Fix typos. * sysdeps/unix/sysv/linux/alpha/bits/time.h (struct timeval): Follow POSIX and make tv_sec a time_t. * sysdeps/unix/sysv/linux/alpha/getitimer.S: New file to handle new tv64 syscall as well as fall back to tv32. * sysdeps/unix/sysv/linux/alpha/getrusage.S: Likewise. * sysdeps/unix/sysv/linux/alpha/gettimeofday.S: Likewise. * sysdeps/unix/sysv/linux/alpha/select.S: Likewise. * sysdeps/unix/sysv/linux/alpha/setitimer.S: Likewise. * sysdeps/unix/sysv/linux/alpha/settimeofday.S: Likewise. * sysdeps/unix/sysv/linux/alpha/utimes.S: Likewise. * sysdeps/unix/sysv/linux/alpha/wait4.S: Likewise. * sysdeps/unix/sysv/linux/alpha/syscalls.list: Add tv32 entries.
Diffstat (limited to 'sysdeps/unix/sysv')
-rw-r--r--sysdeps/unix/sysv/linux/alpha/Makefile6
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/time.h6
-rw-r--r--sysdeps/unix/sysv/linux/alpha/clone.S2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/getitimer.S99
-rw-r--r--sysdeps/unix/sysv/linux/alpha/getrusage.S127
-rw-r--r--sysdeps/unix/sysv/linux/alpha/gettimeofday.S102
-rw-r--r--sysdeps/unix/sysv/linux/alpha/rt_sigaction.S9
-rw-r--r--sysdeps/unix/sysv/linux/alpha/select.S116
-rw-r--r--sysdeps/unix/sysv/linux/alpha/setitimer.S121
-rw-r--r--sysdeps/unix/sysv/linux/alpha/settimeofday.S102
-rw-r--r--sysdeps/unix/sysv/linux/alpha/syscalls.list13
-rw-r--r--sysdeps/unix/sysv/linux/alpha/utimes.S107
-rw-r--r--sysdeps/unix/sysv/linux/alpha/wait4.S138
13 files changed, 941 insertions, 7 deletions
diff --git a/sysdeps/unix/sysv/linux/alpha/Makefile b/sysdeps/unix/sysv/linux/alpha/Makefile
index fa2c078664..48f5562d29 100644
--- a/sysdeps/unix/sysv/linux/alpha/Makefile
+++ b/sysdeps/unix/sysv/linux/alpha/Makefile
@@ -3,4 +3,10 @@ sysdep_headers += alpha/ptrace.h alpha/regdef.h
sysdep_routines += ieee_get_fp_control ieee_set_fp_control \
sethae ioperm osf_sigprocmask fstatfs statfs llseek
+
+# Support old timeval32 entry points
+sysdep_routines += osf_select osf_gettimeofday osf_settimeofday \
+ osf_getitimer osf_setitimer osf_utimes \
+ osf_getrusage osf_wait4
+
endif
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/time.h b/sysdeps/unix/sysv/linux/alpha/bits/time.h
index d32f4d30e9..7f26efd031 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/time.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/time.h
@@ -43,11 +43,13 @@
#ifndef _STRUCT_TIMEVAL
# define _STRUCT_TIMEVAL 1
+# include <bits/types.h>
+
/* A time value that is accurate to the nearest
microsecond but also has a range of years. */
struct timeval
{
- int tv_sec; /* Seconds. */
- int tv_usec; /* Microseconds. */
+ __time_t tv_sec; /* Seconds. */
+ __time_t tv_usec; /* Microseconds. */
};
#endif /* struct timeval */
diff --git a/sysdeps/unix/sysv/linux/alpha/clone.S b/sysdeps/unix/sysv/linux/alpha/clone.S
index 930e379296..a8bd7f1b33 100644
--- a/sysdeps/unix/sysv/linux/alpha/clone.S
+++ b/sysdeps/unix/sysv/linux/alpha/clone.S
@@ -62,8 +62,10 @@ ENTRY(__clone)
/* Something bad happened -- no child created */
$error:
+#ifndef PROF
br gp,1f
1: ldgp gp,0(gp)
+#endif
jmp zero,__syscall_error
END(__clone)
diff --git a/sysdeps/unix/sysv/linux/alpha/getitimer.S b/sysdeps/unix/sysv/linux/alpha/getitimer.S
new file mode 100644
index 0000000000..03ae6ea491
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/alpha/getitimer.S
@@ -0,0 +1,99 @@
+/* Copyright (C) 1998 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <sysdep.h>
+#define _ERRNO_H 1
+#include <bits/errno.h>
+
+/* The problem here is that initially we made struct timeval compatible with
+ OSF/1, using int32. But we defined time_t with uint64, and later found
+ that POSIX requires tv_sec to be time_t.
+
+ So now we have to do compatibility stuff. */
+
+/* The variable is shared between all wrappers around signal handling
+ functions which have RT equivalents. */
+.comm __libc_missing_axp_tv64, 4
+
+.text
+
+LEAF(__getitimer_tv64, 16)
+ ldgp gp, 0(pv)
+ subq sp, 16, sp
+#ifdef PROF
+ .set noat
+ lda AT, _mcount
+ jsr AT, (AT), _mcount
+ .set at
+#endif
+ .prologue 1
+
+ ldl t0, __libc_missing_axp_tv64
+
+ /* Save arguments in case we do need to fall back. */
+ stq a0, 0(sp)
+ stq a1, 8(sp)
+
+ bne t0, $do32
+
+ ldi v0, SYS_ify(getitimer)
+ callsys
+ bne a3, $err64
+
+ /* Everything ok. */
+ addq sp, 16, sp
+ ret
+
+ /* If we didn't get ENOSYS, it is a real error. */
+ .align 3
+$err64: cmpeq v0, ENOSYS, t0
+ bne t0, $error
+ stl t0, __libc_missing_axp_tv64
+
+ /* Recover the saved arguments. */
+ ldq a1, 8(sp)
+ ldq a0, 0(sp)
+
+ .align 3
+$do32: ldi v0, SYS_ify(osf_getitimer)
+ callsys
+ bne a3, $error
+
+ /* Copy back to proper format. */
+ ldq a1, 8(sp)
+ ldl t0, 0(a1)
+ ldl t1, 4(a1)
+ ldl t2, 8(a1)
+ ldl t3, 12(a1)
+ stq t0, 0(a1)
+ stq t1, 8(a1)
+ stq t2, 16(a1)
+ stq t3, 24(a1)
+
+ addq sp, 16, sp
+ ret
+
+ .align 3
+$error:
+ lda pv, __syscall_error
+ addq sp, 16, sp
+ jmp zero, (pv), __syscall_error
+
+END(__getitimer_tv64)
+
+default_symbol_version (__getitimer_tv64, getitimer, GLIBC_2.1)
diff --git a/sysdeps/unix/sysv/linux/alpha/getrusage.S b/sysdeps/unix/sysv/linux/alpha/getrusage.S
new file mode 100644
index 0000000000..d875c83771
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/alpha/getrusage.S
@@ -0,0 +1,127 @@
+/* Copyright (C) 1998 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <sysdep.h>
+#define _ERRNO_H 1
+#include <bits/errno.h>
+
+/* The problem here is that initially we made struct timeval compatible with
+ OSF/1, using int32. But we defined time_t with uint64, and later found
+ that POSIX requires tv_sec to be time_t.
+
+ So now we have to do compatibility stuff. */
+
+/* The variable is shared between all wrappers around signal handling
+ functions which have RT equivalents. */
+.comm __libc_missing_axp_tv64, 4
+
+.text
+
+LEAF(__getrusage_tv64, 16)
+ ldgp gp, 0(pv)
+ subq sp, 16, sp
+#ifdef PROF
+ .set noat
+ lda AT, _mcount
+ jsr AT, (AT), _mcount
+ .set at
+#endif
+ .prologue 1
+
+ ldl t0, __libc_missing_axp_tv64
+
+ /* Save arguments in case we do need to fall back. */
+ stq a0, 0(sp)
+ stq a1, 8(sp)
+
+ bne t0, $do32
+
+ ldi v0, SYS_ify(getrusage)
+ callsys
+ bne a3, $err64
+
+ /* Everything ok. */
+ addq sp, 16, sp
+ ret
+
+ /* If we didn't get ENOSYS, it is a real error. */
+ .align 3
+$err64: cmpeq v0, ENOSYS, t0
+ bne t0, $error
+ stl t0, __libc_missing_axp_tv64
+
+ /* Recover the saved arguments. */
+ ldq a1, 8(sp)
+ ldq a0, 0(sp)
+
+ .align 3
+$do32: ldi v0, SYS_ify(osf_getrusage)
+ callsys
+ bne a3, $error
+
+ /* Copy back to proper format. */
+ ldq a1, 8(sp)
+ ldl t0, 0(a1) # ru_utime.tv_sec
+ ldl t1, 4(a1) # ru_utime.tv_usec
+ ldl t2, 8(a1) # ru_stime.tv_sec
+ ldl t3, 12(a1) # ru_stime.tv_usec
+ ldt $f15, 16(a1) # ru_maxrss
+ ldt $f16, 24(a1) # ru_ixrss
+ ldt $f17, 32(a1) # ru_idrss
+ ldt $f18, 40(a1) # ru_isrss
+ ldt $f19, 48(a1) # ru_minflt
+ ldt $f20, 56(a1) # ru_majflt
+ ldt $f21, 64(a1) # ru_nswap
+ ldt $f22, 72(a1) # ru_inblock
+ ldt $f23, 80(a1) # ru_oublock
+ ldt $f24, 88(a1) # ru_msgsend
+ ldt $f25, 96(a1) # ru_msgrcv
+ ldt $f26, 104(a1) # ru_nsignals
+ ldt $f27, 112(a1) # ru_nvcsw
+ ldt $f28, 120(a1) # ru_nivcsw
+ stq t0, 0(a1)
+ stq t1, 8(a1)
+ stq t2, 16(a1)
+ stq t3, 24(a1)
+ stt $f15, 32(a1)
+ stt $f16, 40(a1)
+ stt $f17, 48(a1)
+ stt $f18, 56(a1)
+ stt $f19, 64(a1)
+ stt $f20, 72(a1)
+ stt $f21, 80(a1)
+ stt $f22, 88(a1)
+ stt $f23, 96(a1)
+ stt $f24, 104(a1)
+ stt $f25, 112(a1)
+ stt $f26, 120(a1)
+ stt $f27, 128(a1)
+ stt $f28, 136(a1)
+
+ addq sp, 16, sp
+ ret
+
+ .align 3
+$error:
+ lda pv, __syscall_error
+ addq sp, 16, sp
+ jmp zero, (pv), __syscall_error
+
+END(__getrusage_tv64)
+
+default_symbol_version (__getrusage_tv64, getrusage, GLIBC_2.1)
diff --git a/sysdeps/unix/sysv/linux/alpha/gettimeofday.S b/sysdeps/unix/sysv/linux/alpha/gettimeofday.S
new file mode 100644
index 0000000000..bceeefc0a7
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/alpha/gettimeofday.S
@@ -0,0 +1,102 @@
+/* Copyright (C) 1998 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <sysdep.h>
+#define _ERRNO_H 1
+#include <bits/errno.h>
+
+/* The problem here is that initially we made struct timeval compatible with
+ OSF/1, using int32. But we defined time_t with uint64, and later found
+ that POSIX requires tv_sec to be time_t.
+
+ So now we have to do compatibility stuff. */
+
+/* The variable is shared between all wrappers around signal handling
+ functions which have RT equivalents. */
+.comm __libc_missing_axp_tv64, 4
+
+.text
+
+LEAF(__gettimeofday_tv64, 16)
+ ldgp gp, 0(pv)
+ subq sp, 16, sp
+#ifdef PROF
+ .set noat
+ lda AT, _mcount
+ jsr AT, (AT), _mcount
+ .set at
+#endif
+ .prologue 1
+
+ ldl t0, __libc_missing_axp_tv64
+
+ /* Save arguments in case we do need to fall back. */
+ stq a0, 0(sp)
+ stq a1, 8(sp)
+
+ bne t0, $do32
+
+ ldi v0, SYS_ify(gettimeofday)
+ callsys
+ bne a3, $err64
+
+ /* Everything ok. */
+ addq sp, 16, sp
+ ret
+
+ /* If we didn't get ENOSYS, it is a real error. */
+ .align 3
+$err64: cmpeq v0, ENOSYS, t0
+ bne t0, $error
+ stl t0, __libc_missing_axp_tv64
+
+ /* Recover the saved arguments. */
+ ldq a1, 8(sp)
+ ldq a0, 0(sp)
+
+ .align 3
+$do32: ldi v0, SYS_ify(osf_gettimeofday)
+ callsys
+ bne a3, $error
+
+ /* Copy back to proper format. */
+ ldq a0, 0(sp)
+ beq a0, 2f
+ ldl t0, 0(a0)
+ ldl t1, 4(a0)
+ stq t0, 0(a0)
+ stq t1, 0(a0)
+
+2: addq sp, 16, sp
+ ret
+
+ .align 3
+$error:
+ lda pv, __syscall_error
+ addq sp, 16, sp
+ jmp zero, (pv), __syscall_error
+
+END(__gettimeofday_tv64)
+
+default_symbol_version (__gettimeofday_tv64, __gettimeofday, GLIBC_2.1)
+
+/* It seems to me to be a misfeature of the assembler that we can only
+ have one version-alias per symbol. So create an alias ourselves.
+ The 'p' is for 'public'. *Shrug* */
+strong_alias (__gettimeofday_tv64, __gettimeofday_tv64p)
+default_symbol_version (__gettimeofday_tv64p, gettimeofday, GLIBC_2.1)
diff --git a/sysdeps/unix/sysv/linux/alpha/rt_sigaction.S b/sysdeps/unix/sysv/linux/alpha/rt_sigaction.S
index bcb2be0e28..1d98de9695 100644
--- a/sysdeps/unix/sysv/linux/alpha/rt_sigaction.S
+++ b/sysdeps/unix/sysv/linux/alpha/rt_sigaction.S
@@ -40,18 +40,21 @@ ENTRY(__syscall_rt_sigaction)
.prologue 1
beq a1, 0f
- ldl t0, 8(a1)
+ ldl t0, 8(a1) # sa_flags
lda a4, sigreturn-__syscall_rt_sigaction(pv)
lda t1, rt_sigreturn-__syscall_rt_sigaction(pv)
and t0, 0x00000040, t0 # SA_SIGINFO
cmovne t0, t1, a4
-0: ldi v0,__NR_sigaction
+0: ldi v0,__NR_rt_sigaction
callsys
bne a3,1f
ret
-1: br gp,2f
+1:
+#ifndef PROF
+ br gp,2f
2: ldgp gp,0(gp)
+#endif
jmp __syscall_error
END(__syscall_rt_sigaction)
diff --git a/sysdeps/unix/sysv/linux/alpha/select.S b/sysdeps/unix/sysv/linux/alpha/select.S
new file mode 100644
index 0000000000..73076b9158
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/alpha/select.S
@@ -0,0 +1,116 @@
+/* Copyright (C) 1998 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <sysdep.h>
+#define _ERRNO_H 1
+#include <bits/errno.h>
+
+/* The problem here is that initially we made struct timeval compatible with
+ OSF/1, using int32. But we defined time_t with uint64, and later found
+ that POSIX requires tv_sec to be time_t.
+
+ So now we have to do compatibility stuff. */
+
+/* The variable is shared between all wrappers around signal handling
+ functions which have RT equivalents. */
+.comm __libc_missing_axp_tv64, 4
+
+.text
+
+LEAF(__select_tv64, 64)
+ ldgp gp, 0(pv)
+ subq sp, 64, sp
+#ifdef PROF
+ .set noat
+ lda AT, _mcount
+ jsr AT, (AT), _mcount
+ .set at
+#endif
+ .prologue 1
+
+ ldl t0, __libc_missing_axp_tv64
+ bne t0, $do32
+
+ /* Save arguments in case we do need to fall back. */
+ stq a0, 8(sp)
+ stq a1, 16(sp)
+ stq a2, 24(sp)
+ stq a3, 32(sp)
+ stq a4, 48(sp)
+
+ ldi v0, SYS_ify(select)
+ callsys
+ bne a3, $err64
+
+ /* Everything ok. */
+ addq sp, 64, sp
+ ret
+
+ /* If we didn't get ENOSYS, it is a real error. */
+ .align 3
+$err64: cmpeq v0, ENOSYS, t0
+ bne t0, $error
+ stl t0, __libc_missing_axp_tv64
+
+ /* Recover the saved arguments. */
+ ldq a4, 48(sp)
+ ldq a3, 32(sp)
+ ldq a2, 24(sp)
+ ldq a1, 16(sp)
+ ldq a0, 8(sp)
+
+ .align 3
+$do32:
+ /* If the timeout argument is present bounce to the smaller fmt. */
+ beq a4, 1f
+ ldq t0, 0(a4)
+ ldq t1, 8(a4)
+ stl t0, 0(sp)
+ stl t1, 4(sp)
+ mov sp, a4
+
+1: ldi v0, SYS_ify(osf_select)
+ callsys
+ bne a3, $error
+
+ /* ... and bounce the remaining timeout back. */
+ ldq a4, 48(sp)
+ beq a4, 2f
+ ldl t0, 0(sp)
+ ldl t1, 4(sp)
+ stq t0, 0(a4)
+ stq t1, 8(a4)
+
+2: addq sp, 64, sp
+ ret
+
+ .align 3
+$error:
+ lda pv, __syscall_error
+ addq sp, 64, sp
+ jmp zero, (pv), __syscall_error
+
+END(__select_tv64)
+
+default_symbol_version (__select_tv64, __select, GLIBC_2.1)
+
+/* It seems to me to be a misfeature of the assembler that we can only
+ have one version-alias per symbol. So create an alias ourselves.
+ The 'p' is for 'public'. *Shrug* */
+strong_alias (__select_tv64, __select_tv64p)
+default_symbol_version (__select_tv64p, select, GLIBC_2.1)
diff --git a/sysdeps/unix/sysv/linux/alpha/setitimer.S b/sysdeps/unix/sysv/linux/alpha/setitimer.S
new file mode 100644
index 0000000000..a2085cc29e
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/alpha/setitimer.S
@@ -0,0 +1,121 @@
+/* Copyright (C) 1998 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <sysdep.h>
+#define _ERRNO_H 1
+#include <bits/errno.h>
+
+/* The problem here is that initially we made struct timeval compatible with
+ OSF/1, using int32. But we defined time_t with uint64, and later found
+ that POSIX requires tv_sec to be time_t.
+
+ So now we have to do compatibility stuff. */
+
+/* The variable is shared between all wrappers around signal handling
+ functions which have RT equivalents. */
+.comm __libc_missing_axp_tv64, 4
+
+.text
+
+LEAF(__setitimer_tv64, 48)
+ ldgp gp, 0(pv)
+ subq sp, 48, sp
+#ifdef PROF
+ .set noat
+ lda AT, _mcount
+ jsr AT, (AT), _mcount
+ .set at
+#endif
+ .prologue 1
+
+ ldl t0, __libc_missing_axp_tv64
+
+ /* Save arguments in case we do need to fall back. */
+ stq a0, 0(sp)
+ stq a1, 8(sp)
+ stq a2, 16(sp)
+
+ bne t0, $do32
+
+ ldi v0, SYS_ify(setitimer)
+ callsys
+ bne a3, $err64
+
+ /* Everything ok. */
+ addq sp, 48, sp
+ ret
+
+ /* If we didn't get ENOSYS, it is a real error. */
+ .align 3
+$err64: cmpeq v0, ENOSYS, t0
+ bne t0, $error
+ stl t0, __libc_missing_axp_tv64
+
+ /* Recover the saved arguments. */
+ ldq a2, 16(sp)
+ ldq a1, 8(sp)
+ ldq a0, 0(sp)
+
+ .align 3
+$do32:
+ /* Conditionally bounce new value down. */
+ beq a1, 1f
+ ldq t0, 0(a1)
+ ldq t1, 8(a1)
+ ldq t2, 16(a1)
+ ldq t3, 24(a1)
+ stl t0, 32(sp)
+ stl t1, 36(sp)
+ stl t2, 40(sp)
+ stl t3, 44(sp)
+ addq sp, 32, a1
+
+1: ldi v0, SYS_ify(osf_setitimer)
+ callsys
+ bne a3, $error
+
+ /* Conditionaly bounce old value up. */
+ ldq a2, 16(sp)
+ bne a2, 2f
+ ldl t0, 0(a2)
+ ldl t1, 4(a2)
+ ldl t2, 8(a2)
+ ldl t3, 12(a2)
+ stq t0, 0(a2)
+ stq t1, 8(a2)
+ stq t2, 48(a2)
+ stq t3, 24(a2)
+
+2: addq sp, 48, sp
+ ret
+
+ .align 3
+$error:
+ lda pv, __syscall_error
+ addq sp, 48, sp
+ jmp zero, (pv), __syscall_error
+
+END(__setitimer_tv64)
+
+default_symbol_version (__setitimer_tv64, __setitimer, GLIBC_2.1)
+
+/* It seems to me to be a misfeature of the assembler that we can only
+ have one version-alias per symbol. So create an alias ourselves.
+ The 'p' is for 'public'. *Shrug* */
+strong_alias (__setitimer_tv64, __setitimer_tv64p)
+default_symbol_version (__setitimer_tv64p, setitimer, GLIBC_2.1)
diff --git a/sysdeps/unix/sysv/linux/alpha/settimeofday.S b/sysdeps/unix/sysv/linux/alpha/settimeofday.S
new file mode 100644
index 0000000000..b730df7136
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/alpha/settimeofday.S
@@ -0,0 +1,102 @@
+/* Copyright (C) 1998 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <sysdep.h>
+#define _ERRNO_H 1
+#include <bits/errno.h>
+
+/* The problem here is that initially we made struct timeval compatible with
+ OSF/1, using int32. But we defined time_t with uint64, and later found
+ that POSIX requires tv_sec to be time_t.
+
+ So now we have to do compatibility stuff. */
+
+/* The variable is shared between all wrappers around signal handling
+ functions which have RT equivalents. */
+.comm __libc_missing_axp_tv64, 4
+
+.text
+
+LEAF(__settimeofday_tv64, 16)
+ ldgp gp, 0(pv)
+ subq sp, 16, sp
+#ifdef PROF
+ .set noat
+ lda AT, _mcount
+ jsr AT, (AT), _mcount
+ .set at
+#endif
+ .prologue 1
+
+ ldl t0, __libc_missing_axp_tv64
+ bne t0, $do32
+
+ /* Save arguments in case we do need to fall back. */
+ stq a0, 0(sp)
+ stq a1, 8(sp)
+
+ ldi v0, SYS_ify(settimeofday)
+ callsys
+ bne a3, $err64
+
+ /* Everything ok. */
+ addq sp, 16, sp
+ ret
+
+ /* If we didn't get ENOSYS, it is a real error. */
+ .align 3
+$err64: cmpeq v0, ENOSYS, t0
+ bne t0, $error
+ stl t0, __libc_missing_axp_tv64
+
+ /* Recover the saved arguments. */
+ ldq a1, 8(sp)
+ ldq a0, 0(sp)
+
+ .align 3
+$do32:
+ /* Conditionally bounce the timeval down. */
+ beq a0, 1f
+ ldq t0, 0(a0)
+ ldq t1, 8(a0)
+ stl t0, 0(sp)
+ stl t1, 4(sp)
+ mov sp, a0
+
+1: ldi v0, SYS_ify(osf_settimeofday)
+ callsys
+ bne a3, $error
+
+ addq sp, 16, sp
+ ret
+
+ .align 3
+$error:
+ lda pv, __syscall_error
+ addq sp, 16, sp
+ jmp zero, (pv), __syscall_error
+
+END(__settimeofday_tv64)
+
+default_symbol_version (__settimeofday_tv64, __settimeofday, GLIBC_2.1)
+
+/* It seems to me to be a misfeature of the assembler that we can only
+ have one version-alias per symbol. So create an alias ourselves.
+ The 'p' is for 'public'. *Shrug* */
+strong_alias (__settimeofday_tv64, __settimeofday_tv64p)
+default_symbol_version (__settimeofday_tv64p, settimeofday, GLIBC_2.1)
diff --git a/sysdeps/unix/sysv/linux/alpha/syscalls.list b/sysdeps/unix/sysv/linux/alpha/syscalls.list
index 17c55f0991..3166531d2b 100644
--- a/sysdeps/unix/sysv/linux/alpha/syscalls.list
+++ b/sysdeps/unix/sysv/linux/alpha/syscalls.list
@@ -34,8 +34,7 @@ truncate - truncate 2 truncate truncate64
sys_ustat ustat ustat 2 __syscall_ustat
sys_mknod xmknod mknod 3 __syscall_mknod
-# override select.S in parent directory:
-select - select 5 __select select
+# proper socket implementations:
accept - accept 3 __libc_accept __accept accept
bind - bind 3 __bind bind
connect - connect 3 __libc_connect __connect connect
@@ -58,3 +57,13 @@ sysctl - _sysctl 6 sysctl
# access pci space protected from machine checks:
pciconfig_read EXTRA pciconfig_read 5 pciconfig_read
pciconfig_write EXTRA pciconfig_write 5 pciconfig_write
+
+# support old timeval32 entry points
+osf_select - osf_select 5 __select_tv32 __select@GLIBC_2.0 select@GLIBC_2.0
+osf_gettimeofday - osf_gettimeofday 2 __gettimeofday_tv32 __gettimeofday@GLIBC_2.0 gettimeofday@GLIBC_2.0
+osf_settimeofday - osf_settimeofday 2 __settimeofday_tv32 settimeofday@GLIBC_2.0
+osf_getitimer - osf_getitimer 2 __getitimer_tv32 getitimer@GLIBC_2.0
+osf_setitimer - osf_setitimer 3 __setitimer_tv32 setitimer@GLIBC_2.0
+osf_utimes - osf_utimes 2 __utimes_tv32 utimes@GLIBC_2.0
+osf_getrusage - osf_getrusage 2 __getrusage_tv32 getrusage@GLIBC_2.0
+osf_wait4 - osf_wait4 2 __wait4_tv32 wait4@GLIBC_2.0
diff --git a/sysdeps/unix/sysv/linux/alpha/utimes.S b/sysdeps/unix/sysv/linux/alpha/utimes.S
new file mode 100644
index 0000000000..2b4c71e410
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/alpha/utimes.S
@@ -0,0 +1,107 @@
+/* Copyright (C) 1998 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <sysdep.h>
+#define _ERRNO_H 1
+#include <bits/errno.h>
+
+/* The problem here is that initially we made struct timeval compatible with
+ OSF/1, using int32. But we defined time_t with uint64, and later found
+ that POSIX requires tv_sec to be time_t.
+
+ So now we have to do compatibility stuff. */
+
+/* The variable is shared between all wrappers around signal handling
+ functions which have RT equivalents. */
+.comm __libc_missing_axp_tv64, 4
+
+.text
+
+LEAF(__utimes_tv64, 16)
+ ldgp gp, 0(pv)
+ subq sp, 16, sp
+#ifdef PROF
+ .set noat
+ lda AT, _mcount
+ jsr AT, (AT), _mcount
+ .set at
+#endif
+ .prologue 1
+
+ ldl t0, __libc_missing_axp_tv64
+
+ /* Save arguments in case we do need to fall back. */
+ stq a0, 0(sp)
+ stq a1, 8(sp)
+
+ bne t0, $do32
+
+ ldi v0, SYS_ify(utimes)
+ callsys
+ bne a3, $err64
+
+ /* Everything ok. */
+ addq sp, 16, sp
+ ret
+
+ /* If we didn't get ENOSYS, it is a real error. */
+ .align 3
+$err64: cmpeq v0, ENOSYS, t0
+ bne t0, $error
+ stl t0, __libc_missing_axp_tv64
+
+ /* Recover the saved arguments. */
+ ldq a1, 8(sp)
+ ldq a0, 0(sp)
+
+ .align 3
+$do32:
+ /* Conditionally bounce values down. */
+ beq a1, 1f
+ ldq t0, 0(a1)
+ ldq t1, 8(a1)
+ ldq t2, 16(a1)
+ ldq t3, 24(a1)
+ stl t0, 0(sp)
+ stl t1, 4(sp)
+ stl t2, 8(sp)
+ stl t3, 12(sp)
+ mov sp, a1
+
+1: ldi v0, SYS_ify(osf_utimes)
+ callsys
+ bne a3, $error
+
+ addq sp, 16, sp
+ ret
+
+ .align 3
+$error:
+ lda pv, __syscall_error
+ addq sp, 16, sp
+ jmp zero, (pv), __syscall_error
+
+END(__utimes_tv64)
+
+default_symbol_version (__utimes_tv64, __utimes, GLIBC_2.1)
+
+/* It seems to me to be a misfeature of the assembler that we can only
+ have one version-alias per symbol. So create an alias ourselves.
+ The 'p' is for 'public'. *Shrug* */
+strong_alias (__utimes_tv64, __utimes_tv64p)
+default_symbol_version (__utimes_tv64p, utimes, GLIBC_2.1)
diff --git a/sysdeps/unix/sysv/linux/alpha/wait4.S b/sysdeps/unix/sysv/linux/alpha/wait4.S
new file mode 100644
index 0000000000..5ab86077c8
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/alpha/wait4.S
@@ -0,0 +1,138 @@
+/* Copyright (C) 1998 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <sysdep.h>
+#define _ERRNO_H 1
+#include <bits/errno.h>
+
+/* The problem here is that initially we made struct timeval compatible with
+ OSF/1, using int32. But we defined time_t with uint64, and later found
+ that POSIX requires tv_sec to be time_t.
+
+ So now we have to do compatibility stuff. */
+
+/* The variable is shared between all wrappers around signal handling
+ functions which have RT equivalents. */
+.comm __libc_missing_axp_tv64, 4
+
+.text
+
+LEAF(__wait4_tv64, 32)
+ ldgp gp, 0(pv)
+ subq sp, 32, sp
+#ifdef PROF
+ .set noat
+ lda AT, _mcount
+ jsr AT, (AT), _mcount
+ .set at
+#endif
+ .prologue 1
+
+ ldl t0, __libc_missing_axp_tv64
+
+ /* Save arguments in case we do need to fall back. */
+ stq a0, 0(sp)
+ stq a1, 8(sp)
+ stq a2, 16(sp)
+ stq a3, 24(sp)
+
+ bne t0, $do32
+
+ ldi v0, SYS_ify(wait4)
+ callsys
+ bne a3, $err64
+
+ /* Everything ok. */
+ addq sp, 32, sp
+ ret
+
+ /* If we didn't get ENOSYS, it is a real error. */
+ .align 3
+$err64: cmpeq v0, ENOSYS, t0
+ bne t0, $error
+ stl t0, __libc_missing_axp_tv64
+
+ /* Recover the saved arguments. */
+ ldq a3, 24(sp)
+ ldq a2, 16(sp)
+ ldq a1, 8(sp)
+ ldq a0, 0(sp)
+
+ .align 3
+$do32: ldi v0, SYS_ify(osf_wait4)
+ callsys
+ bne a3, $error
+
+ /* Copy back to proper format. */
+ ldq a3, 8(sp)
+ beq a3, 2f
+ ldl t0, 0(a3) # ru_utime.tv_sec
+ ldl t1, 4(a3) # ru_utime.tv_usec
+ ldl t2, 8(a3) # ru_stime.tv_sec
+ ldl t3, 12(a3) # ru_stime.tv_usec
+ ldt $f15, 16(a3) # ru_maxrss
+ ldt $f16, 24(a3) # ru_ixrss
+ ldt $f17, 32(a3) # ru_idrss
+ ldt $f18, 40(a3) # ru_isrss
+ ldt $f19, 48(a3) # ru_minflt
+ ldt $f20, 56(a3) # ru_majflt
+ ldt $f21, 64(a3) # ru_nswap
+ ldt $f22, 72(a3) # ru_inblock
+ ldt $f23, 80(a3) # ru_oublock
+ ldt $f24, 88(a3) # ru_msgsend
+ ldt $f25, 96(a3) # ru_msgrcv
+ ldt $f26, 104(a3) # ru_nsignals
+ ldt $f27, 112(a3) # ru_nvcsw
+ ldt $f28, 120(a3) # ru_nivcsw
+ stq t0, 0(a3)
+ stq t1, 8(a3)
+ stq t2, 16(a3)
+ stq t3, 24(a3)
+ stt $f15, 32(a3)
+ stt $f16, 40(a3)
+ stt $f17, 48(a3)
+ stt $f18, 56(a3)
+ stt $f19, 64(a3)
+ stt $f20, 72(a3)
+ stt $f21, 80(a3)
+ stt $f22, 88(a3)
+ stt $f23, 96(a3)
+ stt $f24, 104(a3)
+ stt $f25, 112(a3)
+ stt $f26, 120(a3)
+ stt $f27, 128(a3)
+ stt $f28, 136(a3)
+
+2: addq sp, 32, sp
+ ret
+
+ .align 3
+$error:
+ lda pv, __syscall_error
+ addq sp, 32, sp
+ jmp zero, (pv), __syscall_error
+
+END(__wait4_tv64)
+
+default_symbol_version (__wait4_tv64, __wait4, GLIBC_2.1)
+
+/* It seems to me to be a misfeature of the assembler that we can only
+ have one version-alias per symbol. So create an alias ourselves.
+ The 'p' is for 'public'. *Shrug* */
+strong_alias (__wait4_tv64, __wait4_tv64p)
+default_symbol_version (__wait4_tv64p, wait4, GLIBC_2.1)