r4990 - in glibc-package/trunk/debian: . patches/kfreebsd
Author: ps-guest
Date: 2011-10-17 16:15:10 +0000 (Mon, 17 Oct 2011)
New Revision: 4990
Modified:
glibc-package/trunk/debian/changelog
glibc-package/trunk/debian/patches/kfreebsd/local-sysdeps.diff
Log:
kfreebsd/local-sysdeps.diff: update to revision 3740 (from glibc-bsd).
Modified: glibc-package/trunk/debian/changelog
===================================================================
--- glibc-package/trunk/debian/changelog 2011-10-16 23:38:53 UTC (rev 4989)
+++ glibc-package/trunk/debian/changelog 2011-10-17 16:15:10 UTC (rev 4990)
@@ -9,6 +9,9 @@
* patches/hurd-i386/submitted-setresid.diff: New patch to fix -1 passed to
setres[ug]id.
+ [ Petr Salinger ]
+ * kfreebsd/local-sysdeps.diff: update to revision 3740 (from glibc-bsd).
+
-- Samuel Thibault <sthibault@debian.org> Mon, 17 Oct 2011 01:23:52 +0200
eglibc (2.13-21) unstable; urgency=low
Modified: glibc-package/trunk/debian/patches/kfreebsd/local-sysdeps.diff
===================================================================
--- glibc-package/trunk/debian/patches/kfreebsd/local-sysdeps.diff 2011-10-16 23:38:53 UTC (rev 4989)
+++ glibc-package/trunk/debian/patches/kfreebsd/local-sysdeps.diff 2011-10-17 16:15:10 UTC (rev 4990)
@@ -622,2447 +622,6 @@
+
+weak_alias (__access, access)
--- /dev/null
-+++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/alpha/Makefile
-@@ -0,0 +1,28 @@
-+# Additional header files to be installed in $prefix/include:
-+
-+ifeq ($(subdir),misc)
-+sysdep_headers += machine/pal.h
-+sysdep_routines += sys_select sys_utimes sys_lutimes sys_futimes
-+endif
-+
-+# Additional functions, and particular system calls:
-+
-+ifeq ($(subdir),io)
-+sysdep_routines += sys_poll
-+endif
-+
-+ifeq ($(subdir),math)
-+sysdep_routines += ieee_get_fp_control ieee_set_fp_control
-+endif
-+
-+ifeq ($(subdir),posix)
-+sysdep_routines += sys_nanosleep sys_sched_rr_gi
-+endif
-+
-+ifeq ($(subdir),time)
-+sysdep_routines += sys_adjtime sys_gettimeofday sys_settimeofday sys_getitimer sys_setitimer
-+endif
-+
-+ifeq ($(subdir),resource)
-+sysdep_routines += sys_getrusage
-+endif
---- /dev/null
-+++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/alpha/README
-@@ -0,0 +1,11 @@
-+Note that even on 64-bit platforms, because __ino64_t != __ino_t, we have
-+stat64 != stat, fstat64 != fstat, lstat64 != lstat, fhstat64 != fhstat,
-+glob64 != glob.
-+
-+Note that on alpha glue code is used in order to use a 64-bit __time_t with a
-+32-bit __kernel_time_t type. All system calls taking arguments with
-+'time_t', 'struct timeval', 'struct timespec', 'struct itimerval',
-+'struct rusage', 'struct msqid_ds', 'struct shmid_ds', 'struct semid_ds' need
-+some special handling. The benefit is that user programs will not need to switch
-+from a 32-bit time_t to a 64-bit time_t in 2038.
-+
---- /dev/null
-+++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/alpha/adjtime.c
-@@ -0,0 +1,51 @@
-+/* Copyright (C) 2002 Free Software Foundation, Inc.
-+ This file is part of the GNU C Library.
-+ Contributed by Bruno Haible <bruno@clisp.org>, 2002.
-+
-+ The GNU C Library is free software; you can redistribute it and/or
-+ modify it under the terms of the GNU Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 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
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, write to the Free
-+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-+ 02111-1307 USA. */
-+
-+#include <stddef.h>
-+#include <sys/time.h>
-+#include <bits/kernel_time_t.h>
-+
-+extern int __syscall_adjtime (const struct __kernel_timeval *delta,
-+ struct __kernel_timeval *olddelta);
-+
-+int
-+__adjtime (const struct timeval *delta, struct timeval *olddelta)
-+{
-+ struct __kernel_timeval kdelta;
-+ int retval;
-+
-+ kdelta.tv_sec = delta->tv_sec;
-+ kdelta.tv_usec = delta->tv_usec;
-+ if (olddelta != NULL)
-+ {
-+ struct __kernel_timeval kolddelta;
-+
-+ retval = __syscall_adjtime (&kdelta, &kolddelta);
-+ if (retval >= 0)
-+ {
-+ olddelta->tv_sec = kolddelta.tv_sec;
-+ olddelta->tv_usec = kolddelta.tv_usec;
-+ }
-+ }
-+ else
-+ retval = __syscall_adjtime (&kdelta, NULL);
-+ return retval;
-+}
-+
-+weak_alias (__adjtime, adjtime)
---- /dev/null
-+++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/alpha/bits/kernel_time_t.h
-@@ -0,0 +1,143 @@
-+/* Copyright (C) 2006 Free Software Foundation, Inc.
-+ This file is part of the GNU C Library.
-+ Contributed by Aurelien Jarno <aurelien@aurel32.net>, 2006.
-+
-+ The GNU C Library is free software; you can redistribute it and/or
-+ modify it under the terms of the GNU Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 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
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, write to the Free
-+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-+ 02111-1307 USA. */
-+
-+
-+/* This header files describe the way that structures using time_t
-+ are represented in the kernel */
-+
-+#ifndef _BITS_KERNEL_TIME_T_H
-+#define _BITS_TIME_H 1
-+
-+#include <bits/types.h>
-+#include <sys/msg.h>
-+
-+/* This structure corresponds to the newer FreeBSD 'struct timespec' */
-+struct __kernel_timespec
-+ {
-+ int tv_sec; /* Seconds. */
-+ long int tv_nsec; /* Nanoseconds. */
-+ };
-+
-+/* This structure corresponds to the newer FreeBSD 'struct timeval' */
-+struct __kernel_timeval
-+ {
-+ int tv_sec; /* Seconds. */
-+ __suseconds_t tv_usec; /* Microseconds. */
-+ };
-+
-+/* This structure corresponds to the newer FreeBSD 'struct itimerval' */
-+struct __kernel_itimerval
-+ {
-+ /* Value to put into `it_value' when the timer expires. */
-+ struct __kernel_timeval it_interval;
-+ /* Time to the next timer expiration. */
-+ struct __kernel_timeval it_value;
-+ };
-+
-+/* This structure corresponds to the newer FreeBSD 'struct rusage' */
-+struct __kernel_rusage
-+ {
-+ /* Total amount of user time used. */
-+ struct __kernel_timeval ru_utime;
-+ /* Total amount of system time used. */
-+ struct __kernel_timeval ru_stime;
-+ /* Maximum resident set size (in kilobytes). */
-+ long int ru_maxrss;
-+ /* Amount of sharing of text segment memory
-+ with other processes (kilobyte-seconds). */
-+ long int ru_ixrss;
-+ /* Amount of data segment memory used (kilobyte-seconds). */
-+ long int ru_idrss;
-+ /* Amount of stack memory used (kilobyte-seconds). */
-+ long int ru_isrss;
-+ /* Number of soft page faults (i.e. those serviced by reclaiming
-+ a page from the list of pages awaiting reallocation. */
-+ long int ru_minflt;
-+ /* Number of hard page faults (i.e. those that required I/O). */
-+ long int ru_majflt;
-+ /* Number of times a process was swapped out of physical memory. */
-+ long int ru_nswap;
-+ /* Number of input operations via the file system. Note: This
-+ and `ru_oublock' do not include operations with the cache. */
-+ long int ru_inblock;
-+ /* Number of output operations via the file system. */
-+ long int ru_oublock;
-+ /* Number of IPC messages sent. */
-+ long int ru_msgsnd;
-+ /* Number of IPC messages received. */
-+ long int ru_msgrcv;
-+ /* Number of signals delivered. */
-+ long int ru_nsignals;
-+ /* Number of voluntary context switches, i.e. because the process
-+ gave up the process before it had to (usually to wait for some
-+ resource to be available). */
-+ long int ru_nvcsw;
-+ /* Number of involuntary context switches, i.e. a higher priority process
-+ became runnable or the current process used up its time slice. */
-+ long int ru_nivcsw;
-+ };
-+
-+/* This structure corresponds to the newer FreeBSD 'struct msqid_ds' */
-+struct __kernel_msqid_ds
-+{
-+ struct ipc_perm msg_perm; /* structure describing operation permission */
-+ void *__msg_first;
-+ void *__msg_last;
-+ msglen_t __msg_cbytes; /* current number of bytes on queue */
-+ msgqnum_t msg_qnum; /* number of messages currently on queue */
-+ msglen_t msg_qbytes; /* max number of bytes allowed on queue */
-+ __pid_t msg_lspid; /* pid of last msgsnd() */
-+ __pid_t msg_lrpid; /* pid of last msgrcv() */
-+ int msg_stime; /* time of last msgsnd command */
-+ long __unused1;
-+ int msg_rtime; /* time of last msgrcv command */
-+ long __unused2;
-+ int msg_ctime; /* time of last change */
-+ long __unused3;
-+ long __unused4[4];
-+};
-+
-+/* This structure corresponds to the newer FreeBSD 'struct shmid_ds' */
-+struct __kernel_shmid_ds
-+ {
-+ struct ipc_perm shm_perm; /* operation permission struct */
-+ int shm_segsz; /* size of segment in bytes */
-+ __pid_t shm_lpid; /* pid of last shmop */
-+ __pid_t shm_cpid; /* pid of creator */
-+ shmatt_t shm_nattch; /* number of current attaches */
-+ int shm_atime; /* time of last shmat() */
-+ int shm_dtime; /* time of last shmdt() */
-+ int shm_ctime; /* time of last change by shmctl() */
-+ void *__shm_internal;
-+ };
-+
-+/* This structure corresponds to the newer FreeBSD 'struct semid_ds' */
-+struct semid_ds
-+{
-+ struct ipc_perm sem_perm; /* operation permission struct */
-+ void *__sem_base;
-+ unsigned short int sem_nsems; /* number of semaphores in set */
-+ int sem_otime; /* last semop() time */
-+ long __unused1;
-+ int sem_ctime; /* last time changed by semctl() */
-+ long __unused2;
-+ long __unused3[4];
-+};
-+
-+#endif
---- /dev/null
-+++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/alpha/bits/mcontext.h
-@@ -0,0 +1,52 @@
-+/* Machine-dependent processor state structure for FreeBSD. alpha version.
-+ Copyright (C) 2002 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 Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 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
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, write to the Free
-+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-+ 02111-1307 USA. */
-+
-+#if !defined _SYS_UCONTEXT_H
-+# error "Never use <bits/mcontext.h> directly; include <sys/ucontext.h> instead."
-+#endif
-+
-+/* Whole processor state. */
-+typedef struct
-+ {
-+ long mc_onstack; /* Nonzero if running on sigstack. */
-+
-+ /* General registers. */
-+ unsigned long mc_regs[32];
-+ long mc_ps;
-+ long mc_pc; /* Process counter. */
-+
-+ /* Trap arguments. */
-+ unsigned long mc_traparg_a0;
-+ unsigned long mc_traparg_a1;
-+ unsigned long mc_traparg_a2;
-+
-+ /* Floating-point registers. */
-+ unsigned long mc_fpregs[32];
-+ unsigned long mc_fpcr;
-+ unsigned long mc_fp_control;
-+#define _MC_FPOWNED_NONE 0 /* FP state not used */
-+#define _MC_FPOWNED_FPU 1 /* FP state came from FPU */
-+#define _MC_FPOWNED_PCB 2 /* FP state came from PCB */
-+ long mc_ownedfp;
-+#define _MC_REV0_SIGFRAME 1 /* context is a signal frame */
-+#define _MC_REV0_TRAPFRAME 2 /* context is a trap frame */
-+ long mc_format;
-+ long mc_thrptr; /* Thread pointer */
-+ long mc_spare[5];
-+ } mcontext_t;
---- /dev/null
-+++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/alpha/bits/sigcontext.h
-@@ -0,0 +1,84 @@
-+/* Machine-dependent signal context structure for FreeBSD. alpha version.
-+ Copyright (C) 1991-1992,1994,1997,2001-2002 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 Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 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
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, write to the Free
-+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-+ 02111-1307 USA. */
-+
-+#if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H
-+# error "Never use <bits/sigcontext.h> directly; include <signal.h> instead."
-+#endif
-+
-+#ifndef _BITS_SIGCONTEXT_H
-+#define _BITS_SIGCONTEXT_H 1
-+
-+/* State of this thread when the signal was taken. */
-+struct sigcontext
-+ {
-+ __sigset_t sc_mask; /* Blocked signals to restore. */
-+ long sc_onstack; /* Nonzero if running on sigstack. */
-+
-+ /* General registers. */
-+ unsigned long sc_regs[32];
-+ long sc_ps;
-+ long sc_pc; /* Process counter. */
-+
-+ /* Trap arguments. */
-+ unsigned long sc_traparg_a0;
-+ unsigned long sc_traparg_a1;
-+ unsigned long sc_traparg_a2;
-+
-+ /* Floating-point registers. */
-+ unsigned long sc_fpregs[32];
-+ unsigned long sc_fpcr;
-+ unsigned long sc_fp_control;
-+ long sc_ownedfp;
-+ long sc_format; /* see mcontext_t */
-+ long sc_spare[6]; /* XXX */
-+ };
-+
-+/* Traditional BSD names for some members. */
-+#define sc_sp sc_regs[30] /* Stack pointer. */
-+#define sc_fp sc_regs[15] /* Frame pointer. */
-+
-+
-+#if 0 /* XXX These need verification. */
-+
-+/* Codes for SIGFPE. */
-+#define FPE_INTDIV 1 /* integer divide by zero */
-+#define FPE_INTOVF 2 /* integer overflow */
-+#define FPE_FLTDIV 3 /* floating divide by zero */
-+#define FPE_FLTOVF 4 /* floating overflow */
-+#define FPE_FLTUND 5 /* floating underflow */
-+#define FPE_FLTINX 6 /* floating loss of precision */
-+#define FPE_SUBRNG_FAULT 0x7 /* BOUNDS instruction failed */
-+#define FPE_FLTDNR_FAULT 0x8 /* denormalized operand */
-+#define FPE_EMERR_FAULT 0xa /* mysterious emulation error 33 */
-+#define FPE_EMBND_FAULT 0xb /* emulation BOUNDS instruction failed */
-+
-+/* Codes for SIGILL. */
-+#define ILL_PRIVIN_FAULT 1
-+#define ILL_ALIGN_FAULT 14
-+#define ILL_FPOP_FAULT 24
-+
-+/* Codes for SIGBUS. */
-+#define BUS_PAGE_FAULT 12
-+#define BUS_SEGNP_FAULT 26
-+#define BUS_STK_FAULT 27
-+#define BUS_SEGM_FAULT 29
-+
-+#endif
-+
-+#endif /* _BITS_SIGCONTEXT_H */
---- /dev/null
-+++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/alpha/bits/stat16.h
-@@ -0,0 +1,53 @@
-+/* Copyright (C) 2002 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 Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 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
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, write to the Free
-+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-+ 02111-1307 USA. */
-+
-+/* This structure corresponds to the original FreeBSD 'struct stat'
-+ (i.e. _STAT_VER_stat), and is used by the fhstat() system call. */
-+struct stat16
-+ {
-+ __dev_t st_dev; /* Device containing the file. */
-+ __ino_t st_ino; /* File serial number. */
-+
-+ __uint16_t st_mode; /* File mode. */
-+ __uint16_t st_nlink; /* Link count. */
-+
-+ __uid_t st_uid; /* User ID of the file's owner. */
-+ __gid_t st_gid; /* Group ID of the file's group. */
-+
-+ __dev_t st_rdev; /* Device number, if device. */
-+
-+ int st_atime; /* Time of last access. */
-+ long int st_atimensec; /* Nanoseconds of last access. */
-+ int st_mtime; /* Time of last modification. */
-+ long int st_mtimensec; /* Nanoseconds of last modification. */
-+ int st_ctime; /* Time of last status change. */
-+ long int st_ctimensec; /* Nanoseconds of last status change. */
-+
-+ __off_t st_size; /* Size of file, in bytes. */
-+
-+ __blkcnt_t st_blocks; /* Number of 512-byte blocks allocated. */
-+
-+ __blksize_t st_blksize; /* Optimal block size for I/O. */
-+
-+ __uint32_t st_flags; /* User defined flags. */
-+
-+ __uint32_t st_gen; /* Generation number. */
-+
-+ __uint32_t __unused1;
-+ __quad_t __unused2[2];
-+ };
---- /dev/null
-+++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/alpha/bits/stat32.h
-@@ -0,0 +1,52 @@
-+/* Copyright (C) 2002 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 Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 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
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, write to the Free
-+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-+ 02111-1307 USA. */
-+
-+/* This structure corresponds to the newer FreeBSD 'struct nstat'
-+ (i.e. _STAT_VER_nstat). */
-+struct stat32
-+ {
-+ __dev_t st_dev; /* Device containing the file. */
-+ __ino_t st_ino; /* File serial number. */
-+
-+ __uint32_t st_mode; /* File mode. */
-+ __uint32_t st_nlink; /* Link count. */
-+
-+ __uid_t st_uid; /* User ID of the file's owner. */
-+ __gid_t st_gid; /* Group ID of the file's group. */
-+
-+ __dev_t st_rdev; /* Device number, if device. */
-+
-+ int st_atime; /* Time of last access. */
-+ long int st_atimensec; /* Nanoseconds of last access. */
-+ int st_mtime; /* Time of last modification. */
-+ long int st_mtimensec; /* Nanoseconds of last modification. */
-+ int st_ctime; /* Time of last status change. */
-+ long int st_ctimensec; /* Nanoseconds of last status change. */
-+
-+ __off_t st_size; /* Size of file, in bytes. */
-+
-+ __blkcnt_t st_blocks; /* Number of 512-byte blocks allocated. */
-+
-+ __blksize_t st_blksize; /* Optimal block size for I/O. */
-+
-+ __uint32_t st_flags; /* User defined flags. */
-+
-+ __uint32_t st_gen; /* Generation number. */
-+
-+ __quad_t __unused1[2];
-+ };
---- /dev/null
-+++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/alpha/bits/time.h
-@@ -0,0 +1,89 @@
-+/* System-dependent timing definitions. FreeBSD version.
-+ Copyright (C) 1996-1997, 1999, 2000, 2002 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 Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 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
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, write to the Free
-+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-+ 02111-1307 USA. */
-+
-+/*
-+ * Never include this file directly; use <time.h> instead.
-+ */
-+
-+#ifndef __need_timeval
-+# ifndef _BITS_TIME_H
-+# define _BITS_TIME_H 1
-+
-+/* ISO/IEC 9899:1990 7.12.1: <time.h>
-+ The macro `CLOCKS_PER_SEC' is the number per second of the value
-+ returned by the `clock' function. */
-+/* CAE XSH, Issue 4, Version 2: <time.h>
-+ The value of CLOCKS_PER_SEC is required to be 1 million on all
-+ XSI-conformant systems. */
-+# define CLOCKS_PER_SEC 1000000l
-+
-+# if !defined __STRICT_ANSI__ && !defined __USE_XOPEN2K
-+/* Even though CLOCKS_PER_SEC has such a strange value CLK_TCK
-+ presents the real value for clock ticks per second for the system. */
-+# define CLK_TCK 100
-+# endif
-+
-+# ifdef __USE_POSIX199309
-+/* Identifier for system-wide realtime clock. */
-+# define CLOCK_REALTIME 0
-+/* High-resolution timer from the CPU. */
-+# define CLOCK_PROCESS_CPUTIME_ID 2
-+/* Thread-specific CPU-time clock. */
-+# define CLOCK_THREAD_CPUTIME_ID 3
-+/* Monotonic system-wide clock. */
-+# define CLOCK_MONOTONIC 4
-+/* These are BSD specific clocks. */
-+# ifdef __USE_BSD
-+# define CLOCK_VIRTUAL 1
-+# define CLOCK_PROF 2
-+# endif
-+
-+/* Flag to indicate time is absolute. */
-+# define TIMER_ABSTIME 1
-+# endif
-+
-+
-+/* Getkerninfo clock information structure */
-+struct clockinfo
-+ {
-+ int hz; /* clock frequency */
-+ int tick; /* micro-seconds per hz tick */
-+ int spare;
-+ int stathz; /* statistics clock frequency */
-+ int profhz; /* profiling clock frequency */
-+ };
-+
-+# endif /* bits/time.h */
-+#endif
-+
-+#ifdef __need_timeval
-+# undef __need_timeval
-+# 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
-+ {
-+ __time_t tv_sec; /* Seconds. */
-+ __suseconds_t tv_usec; /* Microseconds. */
-+ };
-+# endif /* struct timeval */
-+#endif /* need timeval */
---- /dev/null
-+++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/alpha/brk.S
-@@ -0,0 +1,73 @@
-+/* Copyright (C) 1993, 1995-1997, 2002 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 Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 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
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, write to the Free
-+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-+ 02111-1307 USA. */
-+
-+/* Traditional name for the 'brk' system call. */
-+#define SYS_brk SYS_obreak
-+
-+#include <sysdep.h>
-+
-+#ifdef PIC
-+.section .bss
-+ .align 3
-+ .globl __curbrk
-+__curbrk: .skip 8
-+ .type __curbrk,@object
-+ .size __curbrk,8
-+#else
-+.comm __curbrk, 8
-+#endif
-+
-+ .text
-+LEAF(__brk, 8)
-+ ldgp gp, 0(t12)
-+ subq sp, 8, sp
-+#ifdef PROF
-+ .set noat
-+ lda AT, _mcount
-+ jsr AT, (AT), _mcount
-+ .set at
-+#endif
-+ .prologue 1
-+
-+ /* Save the requested brk across the system call. */
-+ stq a0, 0(sp)
-+
-+ ldiq v0, SYS_brk
-+ call_pal PAL_callsys
-+
-+ ldq a0, 0(sp)
-+
-+ /* Test for error. */
-+ bne a3, $error
-+
-+ /* Don't need to handle brk(0) specially, because the kernel doesn't
-+ support this way of calling brk anyway. */
-+
-+ /* Update __curbrk and return cleanly. */
-+ stq a0, __curbrk
-+ mov zero, v0
-+ addq sp, 8, sp
-+ ret
-+
-+ /* What a horrible way to die. */
-+$error: addq sp, 8, sp
-+ jmp zero, __syscall_error
-+
-+ END(__brk)
-+
-+weak_alias (__brk, brk)
---- /dev/null
-+++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/alpha/dl-brk.S
-@@ -0,0 +1 @@
-+#include <brk.S>
---- /dev/null
-+++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/alpha/dl-machine.h
-@@ -0,0 +1,34 @@
-+/* Dynamic linker magic for glibc on FreeBSD.
-+ Copyright (C) 2002 Free Software Foundation, Inc.
-+ This file is part of the GNU C Library.
-+ Contributed by Bruno Haible <bruno@clisp.org>, 2002.
-+
-+ The GNU C Library is free software; you can redistribute it and/or
-+ modify it under the terms of the GNU Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 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
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, write to the Free
-+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-+ 02111-1307 USA. */
-+
-+/* FreeBSD on alpha can emulate two ABIs (= sets of system calls):
-+ The native FreeBSD ABI and OSF/1. Without additional kernel
-+ modules, only the FreeBSD ABI is supported. For this reason, we use
-+ this ABI, and we have to label every executable as using this ABI,
-+ by writing the string "FreeBSD" at byte offset 8 (= EI_ABIVERSION)
-+ of every executable. Strictly speaking, only ld.so and the
-+ executables would need this labelling. But it's easiest to mark
-+ every executable and every shared object the same way. */
-+#define VALID_ELF_HEADER(e_ident, expected, size) \
-+ (memcmp (e_ident, expected, EI_ABIVERSION) == 0 \
-+ && memcmp ((const char *) (e_ident) + EI_ABIVERSION, "FreeBSD", 8) == 0)
-+#define VALID_ELF_ABIVERSION(abi) (memcmp (&(abi), "FreeBSD", 8) == 0)
-+
-+#include_next <dl-machine.h>
---- /dev/null
-+++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/alpha/fhstatfs64.c
-@@ -0,0 +1,2 @@
-+/* 'fhstatfs64' is the same as 'fhstatfs', because
-+ __fsblkcnt64_t == __fsblkcnt_t and __fsfilcnt64_t == __fsfilcnt_t. */
---- /dev/null
-+++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/alpha/fork.S
-@@ -0,0 +1,30 @@
-+/* Copyright (C) 1993, 1995, 1997, 2002 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 Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 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
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, write to the Free
-+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-+ 02111-1307 USA. */
-+
-+#include <sysdep.h>
-+
-+PSEUDO (__libc_fork, fork, 0)
-+ /* In the parent process, a4 == 0, v0 == child pid. */
-+ /* In the child process, a4 == 1, v0 == parent pid. */
-+ cmovne a4, zero, v0
-+ ret
-+
-+PSEUDO_END (__libc_fork)
-+
-+weak_alias (__libc_fork, __fork)
-+weak_alias (__fork, fork)
---- /dev/null
-+++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/alpha/fpu.h
-@@ -0,0 +1,128 @@
-+/* Copyright (C) 2002 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 Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 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
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, write to the Free
-+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-+ 02111-1307 USA. */
-+
-+#ifndef _FPU_H
-+#define _FPU_H 1
-+
-+
-+/* Usage of the fpcr register.
-+ The rounding mode bits (in FPCR_DYN_MASK) can be modified in user mode
-+ and will be preserved by the kernel when a software assisted floating-
-+ point operation or an exception occurs. All other bits will be set by
-+ the kernel when a software assisted floating-point operation or an
-+ exception occurs. */
-+
-+#if 0 /* Only Linux, not FreeBSD */
-+#define FPCR_DNOD (1UL<<47) /* denorm INV trap disable */
-+#define FPCR_DNZ (1UL<<48) /* denorms to zero */
-+#endif
-+#define FPCR_INVD (1UL<<49) /* invalid op disable (opt.) */
-+#define FPCR_DZED (1UL<<50) /* division by zero disable (opt.) */
-+#define FPCR_OVFD (1UL<<51) /* overflow disable (optional) */
-+#define FPCR_INV (1UL<<52) /* invalid operation */
-+#define FPCR_DZE (1UL<<53) /* division by zero */
-+#define FPCR_OVF (1UL<<54) /* overflow */
-+#define FPCR_UNF (1UL<<55) /* underflow */
-+#define FPCR_INE (1UL<<56) /* inexact */
-+#define FPCR_IOV (1UL<<57) /* integer overflow */
-+#define FPCR_UNDZ (1UL<<60) /* underflow to zero (opt.) */
-+#define FPCR_UNFD (1UL<<61) /* underflow disable (opt.) */
-+#define FPCR_INED (1UL<<62) /* inexact disable (opt.) */
-+#define FPCR_SUM (1UL<<63) /* summary bit, an OR of bits 52..56 */
-+
-+#define FPCR_DYN_SHIFT 58 /* first dynamic rounding mode bit */
-+#define FPCR_DYN_CHOPPED (0x0UL << FPCR_DYN_SHIFT) /* towards 0 */
-+#define FPCR_DYN_MINUS (0x1UL << FPCR_DYN_SHIFT) /* towards -INF */
-+#define FPCR_DYN_NORMAL (0x2UL << FPCR_DYN_SHIFT) /* towards nearest */
-+#define FPCR_DYN_PLUS (0x3UL << FPCR_DYN_SHIFT) /* towards +INF */
-+#define FPCR_DYN_MASK (0x3UL << FPCR_DYN_SHIFT)
-+
-+#define FPCR_MASK 0xffff800000000000
-+
-+
-+/* IEEE traps are enabled depending on a control word (not to be confused
-+ with fpcr!) which can be read using __ieee_get_fp_control() and written
-+ using __ieee_set_fp_control(). The bits in these control word are
-+ as follows (compatible with Linux and OSF/1). */
-+
-+/* Trap enable bits. Get copied (inverted) to bits 49,50,51,61,62,47
-+ of fpcr in the kernel. */
-+#define IEEE_TRAP_ENABLE_INV (1UL<<1) /* invalid op */
-+#define IEEE_TRAP_ENABLE_DZE (1UL<<2) /* division by zero */
-+#define IEEE_TRAP_ENABLE_OVF (1UL<<3) /* overflow */
-+#define IEEE_TRAP_ENABLE_UNF (1UL<<4) /* underflow */
-+#define IEEE_TRAP_ENABLE_INE (1UL<<5) /* inexact */
-+#if 0 /* Only Linux, not FreeBSD */
-+#define IEEE_TRAP_ENABLE_DNO (1UL<<6) /* denorm */
-+#endif
-+#define IEEE_TRAP_ENABLE_MASK (IEEE_TRAP_ENABLE_INV | IEEE_TRAP_ENABLE_DZE |\
-+ IEEE_TRAP_ENABLE_OVF | IEEE_TRAP_ENABLE_UNF |\
-+ IEEE_TRAP_ENABLE_INE/*| IEEE_TRAP_ENABLE_DNO*/)
-+
-+#if 0 /* Only Linux, not FreeBSD */
-+
-+/* Denorm and Underflow flushing. */
-+/* Get copied to bits 48,60 of fpcr in the kernel. */
-+#define IEEE_MAP_DMZ (1UL<<12) /* Map denorm inputs to zero */
-+#define IEEE_MAP_UMZ (1UL<<13) /* Map underflowed outputs to zero */
-+
-+#define IEEE_MAP_MASK (IEEE_MAP_DMZ | IEEE_MAP_UMZ)
-+
-+#endif
-+
-+/* Status bits. Get copied to bits 52,53,54,55,56 of fpcr in the kernel. */
-+#define IEEE_STATUS_INV (1UL<<17) /* invalid op */
-+#define IEEE_STATUS_DZE (1UL<<18) /* division by zero */
-+#define IEEE_STATUS_OVF (1UL<<19) /* overflow */
-+#define IEEE_STATUS_UNF (1UL<<20) /* underflow */
-+#define IEEE_STATUS_INE (1UL<<21) /* inexact */
-+#if 0 /* Only Linux, not FreeBSD */
-+#define IEEE_STATUS_DNO (1UL<<22) /* denorm */
-+#endif
-+
-+#define IEEE_STATUS_MASK (IEEE_STATUS_INV | IEEE_STATUS_DZE | \
-+ IEEE_STATUS_OVF | IEEE_STATUS_UNF | \
-+ IEEE_STATUS_INE /* | IEEE_STATUS_DNO */)
-+
-+#define IEEE_SW_MASK (IEEE_TRAP_ENABLE_MASK | \
-+ IEEE_STATUS_MASK /* | IEEE_MAP_MASK */)
-+
-+#if 0 /* Only Linux, not FreeBSD */
-+
-+#define IEEE_CURRENT_RM_SHIFT 32
-+#define IEEE_CURRENT_RM_MASK (3UL<<IEEE_CURRENT_RM_SHIFT)
-+
-+#endif
-+
-+#define IEEE_INHERIT (1UL<<63) /* inherit on thread create? */
-+
-+
-+#if 0 /* Unused. */
-+
-+/* Exception summary bits. */
-+#define EXCSUM_SWC (1LL << 0) /* Software completion */
-+#define EXCSUM_INV (1LL << 1) /* Invalid operation */
-+#define EXCSUM_DZE (1LL << 2) /* Division by zero */
-+#define EXCSUM_OVF (1LL << 3) /* Overflow */
-+#define EXCSUM_UNF (1LL << 4) /* Underflow */
-+#define EXCSUM_INE (1LL << 5) /* Inexact result */
-+#define EXCSUM_IOV (1LL << 6) /* Integer overflow */
-+
-+#endif
-+
-+#endif /* _FPU_H */
---- /dev/null
-+++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/alpha/fstatfs64.c
-@@ -0,0 +1,2 @@
-+/* 'fstatfs64' is the same as 'fstatfs', because
-+ __fsblkcnt64_t == __fsblkcnt_t and __fsfilcnt64_t == __fsfilcnt_t. */
---- /dev/null
-+++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/alpha/futimes.c
-@@ -0,0 +1,43 @@
-+/* Copyright (C) 2002 Free Software Foundation, Inc.
-+ This file is part of the GNU C Library.
-+ Contributed by Bruno Haible <bruno@clisp.org>, 2002.
-+
-+ The GNU C Library is free software; you can redistribute it and/or
-+ modify it under the terms of the GNU Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 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
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, write to the Free
-+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-+ 02111-1307 USA. */
-+
-+#include <stddef.h>
-+#include <sys/time.h>
-+#include <bits/kernel_time_t.h>
-+
-+extern int __syscall_futimes (int fd, const struct __kernel_timeval tvp[2]);
-+
-+int
-+__futimes (int fd, const struct timeval tvp[2])
-+{
-+ if (tvp != NULL)
-+ {
-+ struct __kernel_timeval ktv[2];
-+
-+ ktv[0].tv_sec = tvp[0].tv_sec;
-+ ktv[0].tv_usec = tvp[0].tv_usec;
-+ ktv[1].tv_sec = tvp[1].tv_sec;
-+ ktv[1].tv_usec = tvp[1].tv_usec;
-+ return __syscall_futimes (fd, ktv);
-+ }
-+ else
-+ return __syscall_futimes (fd, NULL);
-+}
-+
-+weak_alias (__futimes, futimes)
---- /dev/null
-+++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/alpha/getfsstat64.c
-@@ -0,0 +1,2 @@
-+/* 'getfsstat64' is the same as 'getfsstat', because
-+ __fsblkcnt64_t == __fsblkcnt_t and __fsfilcnt64_t == __fsfilcnt_t. */
---- /dev/null
-+++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/alpha/getitimer.c
-@@ -0,0 +1,49 @@
-+/* Copyright (C) 2002 Free Software Foundation, Inc.
-+ This file is part of the GNU C Library.
-+ Contributed by Bruno Haible <bruno@clisp.org>, 2002.
-+
-+ The GNU C Library is free software; you can redistribute it and/or
-+ modify it under the terms of the GNU Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 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
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, write to the Free
-+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-+ 02111-1307 USA. */
-+
-+#include <stddef.h>
-+#include <errno.h>
-+#include <sys/time.h>
-+#include <bits/kernel_time_t.h>
-+
-+extern int __syscall_getitimer (int which, struct __kernel_itimerval *value);
-+
-+int
-+__getitimer (enum __itimer_which which, struct itimerval *value)
-+{
-+ struct __kernel_itimerval kvalue;
-+ int retval;
-+
-+ if (value == NULL)
-+ {
-+ errno = EFAULT;
-+ return -1;
-+ }
-+ retval = __syscall_getitimer (which, &kvalue);
-+ if (retval >= 0)
-+ {
-+ value->it_interval.tv_sec = kvalue.it_interval.tv_sec;
-+ value->it_interval.tv_usec = kvalue.it_interval.tv_usec;
-+ value->it_value.tv_sec = kvalue.it_value.tv_sec;
-+ value->it_value.tv_usec = kvalue.it_value.tv_usec;
-+ }
-+ return retval;
-+}
-+
-+weak_alias (__getitimer, getitimer)
---- /dev/null
-+++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/alpha/getmntinfo.c
-@@ -0,0 +1,8 @@
-+/* 'getmntinfo64' is the same as 'getmntinfo', because
-+ __fsblkcnt64_t == __fsblkcnt_t and __fsfilcnt64_t == __fsfilcnt_t. */
-+
-+#define getmntinfo64 __no_getmntinfo64_decl
-+#include <sysdeps/unix/bsd/bsd4.4/kfreebsd/getmntinfo.c>
-+#undef getmntinfo64
-+
-+weak_alias (__getmntinfo, getmntinfo64)
---- /dev/null
-+++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/alpha/getmntinfo64.c
-@@ -0,0 +1,2 @@
-+/* 'getmntinfo64' is the same as 'getmntinfo', because
-+ __fsblkcnt64_t == __fsblkcnt_t and __fsfilcnt64_t == __fsfilcnt_t. */
---- /dev/null
-+++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/alpha/getrusage.c
-@@ -0,0 +1,63 @@
-+/* Copyright (C) 2002 Free Software Foundation, Inc.
-+ This file is part of the GNU C Library.
-+ Contributed by Bruno Haible <bruno@clisp.org>, 2002.
-+
-+ The GNU C Library is free software; you can redistribute it and/or
-+ modify it under the terms of the GNU Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 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
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, write to the Free
-+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-+ 02111-1307 USA. */
-+
-+#include <stddef.h>
-+#include <errno.h>
-+#include <sys/resource.h>
-+#include <bits/kernel_time_t.h>
-+
-+extern int __syscall_getrusage (int who, struct __kernel_rusage *usage);
-+
-+int
-+__getrusage (enum __rusage_who who, struct rusage *usage)
-+{
-+ struct __kernel_rusage kusage;
-+ int retval;
-+
-+ if (usage == NULL)
-+ {
-+ errno = EFAULT;
-+ return -1;
-+ }
-+ retval = __syscall_getrusage (who, &kusage);
-+ if (retval >= 0)
-+ {
-+ usage->ru_utime.tv_sec = kusage.ru_utime.tv_sec;
-+ usage->ru_utime.tv_usec = kusage.ru_utime.tv_usec;
-+ usage->ru_stime.tv_sec = kusage.ru_stime.tv_sec;
-+ usage->ru_stime.tv_usec = kusage.ru_stime.tv_usec;
-+ usage->ru_maxrss = kusage.ru_maxrss;
-+ usage->ru_ixrss = kusage.ru_ixrss;
-+ usage->ru_idrss = kusage.ru_idrss;
-+ usage->ru_isrss = kusage.ru_isrss;
-+ usage->ru_minflt = kusage.ru_minflt;
-+ usage->ru_majflt = kusage.ru_majflt;
-+ usage->ru_nswap = kusage.ru_nswap;
-+ usage->ru_inblock = kusage.ru_inblock;
-+ usage->ru_oublock = kusage.ru_oublock;
-+ usage->ru_msgsnd = kusage.ru_msgsnd;
-+ usage->ru_msgrcv = kusage.ru_msgrcv;
-+ usage->ru_nsignals = kusage.ru_nsignals;
-+ usage->ru_nvcsw = kusage.ru_nvcsw;
-+ usage->ru_nivcsw = kusage.ru_nivcsw;
-+ }
-+ return retval;
-+}
-+
-+weak_alias (__getrusage, getrusage)
---- /dev/null
-+++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/alpha/gettimeofday.c
-@@ -0,0 +1,52 @@
-+/* Copyright (C) 2002 Free Software Foundation, Inc.
-+ This file is part of the GNU C Library.
-+ Contributed by Bruno Haible <bruno@clisp.org>, 2002.
-+
-+ The GNU C Library is free software; you can redistribute it and/or
-+ modify it under the terms of the GNU Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 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
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, write to the Free
-+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-+ 02111-1307 USA. */
-+
-+#include <stddef.h>
-+#include <errno.h>
-+#include <sys/time.h>
-+#include <bits/kernel_time_t.h>
-+
-+extern int __syscall_gettimeofday (struct __kernel_timeval *tv,
-+ struct timezone *tz);
-+
-+#undef __gettimeofday
-+
-+int
-+__gettimeofday (struct timeval *tv, struct timezone *tz)
-+{
-+ struct __kernel_timeval ktv;
-+ int retval;
-+
-+ if (tv == NULL)
-+ {
-+ errno = EFAULT;
-+ return -1;
-+ }
-+ retval = __syscall_gettimeofday (&ktv, tz);
-+ if (retval >= 0)
-+ {
-+ tv->tv_sec = ktv.tv_sec;
-+ tv->tv_usec = ktv.tv_usec;
-+ }
-+ return retval;
-+}
-+
-+INTDEF(__gettimeofday)
-+
-+weak_alias (__gettimeofday, gettimeofday)
---- /dev/null
-+++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/alpha/ieee_get_fp_control.c
-@@ -0,0 +1,35 @@
-+/* Copyright (C) 2002 Free Software Foundation, Inc.
-+ This file is part of the GNU C Library.
-+ Contributed by Bruno Haible <bruno@clisp.org>, 2002.
-+
-+ The GNU C Library is free software; you can redistribute it and/or
-+ modify it under the terms of the GNU Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 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
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, write to the Free
-+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-+ 02111-1307 USA. */
-+
-+#include <sysarch.h>
-+#include <stdlib.h>
-+
-+unsigned long
-+__ieee_get_fp_control (void)
-+{
-+ /* The Alpha hardware requires this to be a system call. */
-+ unsigned long word;
-+
-+ if (__sysarch (ALPHA_GET_FPMASK, &word) < 0)
-+ abort ();
-+
-+ return word;
-+}
-+
-+weak_alias (__ieee_get_fp_control, ieee_get_fp_control)
---- /dev/null
-+++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/alpha/ieee_set_fp_control.c
-@@ -0,0 +1,33 @@
-+/* Copyright (C) 2002 Free Software Foundation, Inc.
-+ This file is part of the GNU C Library.
-+ Contributed by Bruno Haible <bruno@clisp.org>, 2002.
-+
-+ The GNU C Library is free software; you can redistribute it and/or
-+ modify it under the terms of the GNU Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 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
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, write to the Free
-+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-+ 02111-1307 USA. */
-+
-+#include <sysarch.h>
-+#include <stdlib.h>
-+
-+void
-+__ieee_set_fp_control (unsigned long trap_enable_mask)
-+{
-+ /* The Alpha hardware requires this to be a system call. */
-+ unsigned long word = trap_enable_mask;
-+
-+ if (__sysarch (ALPHA_SET_FPMASK, &word) < 0)
-+ abort ();
-+}
-+
-+weak_alias (__ieee_set_fp_control, ieee_set_fp_control)
---- /dev/null
-+++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/alpha/lutimes.c
-@@ -0,0 +1,44 @@
-+/* Copyright (C) 2002 Free Software Foundation, Inc.
-+ This file is part of the GNU C Library.
-+ Contributed by Bruno Haible <bruno@clisp.org>, 2002.
-+
-+ The GNU C Library is free software; you can redistribute it and/or
-+ modify it under the terms of the GNU Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 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
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, write to the Free
-+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-+ 02111-1307 USA. */
-+
-+#include <stddef.h>
-+#include <sys/time.h>
-+#include <bits/kernel_time_t.h>
-+
-+extern int __syscall_lutimes (const char *file,
-+ const struct __kernel_timeval tvp[2]);
-+
-+int
-+__lutimes (const char *file, const struct timeval tvp[2])
-+{
-+ if (tvp != NULL)
-+ {
-+ struct __kernel_timeval ktv[2];
-+
-+ ktv[0].tv_sec = tvp[0].tv_sec;
-+ ktv[0].tv_usec = tvp[0].tv_usec;
-+ ktv[1].tv_sec = tvp[1].tv_sec;
-+ ktv[1].tv_usec = tvp[1].tv_usec;
-+ return __syscall_lutimes (file, ktv);
-+ }
-+ else
-+ return __syscall_lutimes (file, NULL);
-+}
-+
-+weak_alias (__lutimes, lutimes)
---- /dev/null
-+++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/alpha/machine/pal.h
-@@ -0,0 +1,57 @@
-+/* Copyright (C) 2002 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 Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 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
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, write to the Free
-+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-+ 02111-1307 USA. */
-+
-+/* Unprivileged PAL function codes. (The PAL codes which require
-+ privileges are useful in the kernel only.) */
-+
-+/* Common PAL codes. */
-+#define PAL_bpt 128
-+#define PAL_bugchk 129
-+#define PAL_callsys 131
-+#define PAL_imb 134
-+#define PAL_rduniq 158
-+#define PAL_wruniq 159
-+#define PAL_gentrap 170
-+#define PAL_nphalt 190
-+
-+/* gentrap causes. */
-+#define GEN_INTOVF -1 /* integer overflow */
-+#define GEN_INTDIV -2 /* integer division by zero */
-+#define GEN_FLTOVF -3 /* fp overflow */
-+#define GEN_FLTDIV -4 /* fp division by zero */
-+#define GEN_FLTUND -5 /* fp underflow */
-+#define GEN_FLTINV -6 /* invalid fp operand */
-+#define GEN_FLTINE -7 /* inexact fp operand */
-+#define GEN_DECOVF -8 /* decimal overflow (for COBOL??) */
-+#define GEN_DECDIV -9 /* decimal division by zero */
-+#define GEN_DECINV -10 /* invalid decimal operand */
-+#define GEN_ROPRAND -11 /* reserved operand */
-+#define GEN_ASSERTERR -12 /* assertion error */
-+#define GEN_NULPTRERR -13 /* null pointer error */
-+#define GEN_STKOVF -14 /* stack overflow */
-+#define GEN_STRLENERR -15 /* string length error */
-+#define GEN_SUBSTRERR -16 /* substring error */
-+#define GEN_RANGERR -17 /* range error */
-+#define GEN_SUBRNG -18
-+#define GEN_SUBRNG1 -19
-+#define GEN_SUBRNG2 -20
-+#define GEN_SUBRNG3 -21 /* these report range errors for */
-+#define GEN_SUBRNG4 -22 /* subscripting (indexing) at levels 0..7 */
-+#define GEN_SUBRNG5 -23
-+#define GEN_SUBRNG6 -24
-+#define GEN_SUBRNG7 -25
---- /dev/null
-+++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/alpha/msgctl.c
-@@ -0,0 +1,62 @@
-+/* Copyright (C) 2006 Free Software Foundation, Inc.
-+ This file is part of the GNU C Library.
-+ Contributed by Aurelien Jarno <aurelien@aurel32.net>, 2006.
-+
-+ The GNU C Library is free software; you can redistribute it and/or
-+ modify it under the terms of the GNU Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 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
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, write to the Free
-+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-+ 02111-1307 USA. */
-+
-+#include <sys/types.h>
-+#include <sys/ipc.h>
-+#include <sys/msg.h>
-+#include <bits/kernel_time_t.h>
-+
-+extern int __syscall_msgctl (int msqid, int cmd, struct __kernel_msqid_ds *buf);
-+
-+int
-+__msgctl (int msqid, int cmd, struct msqid_ds *buf)
-+{
-+ struct __kernel_msqid_ds kmsqid_ds;
-+ int retval;
-+
-+ kmsqid_ds.msg_perm = msqid_ds->msg_perm;
-+ kmsqid_ds.__msg_first = msqid_ds->__msg_first;
-+ kmsqid_ds.__msg_last = msqid_ds->__msg_last;
-+ kmsqid_ds.__msg_cbytes = msqid_ds->__msg_cbytes;
-+ kmsqid_ds.msg_qnum = msqid_ds->msg_qnum;
-+ kmsqid_ds.msg_qbytes = msqid_ds->msg_qbytes;
-+ kmsqid_ds.msg_lspid = msqid_ds->msg_lspid;
-+ kmsqid_ds.msg_lrpid = msqid_ds->msg_lrpid;
-+ kmsqid_ds.msg_stime = msqid_ds->msg_stime;
-+ kmsqid_ds.msg_rtime = msqid_ds->msg_rtime;
-+ kmsqid_ds.msg_ctime = msqid_ds->msg_ctime;
-+
-+ retval = __syscall_msgctl (msqid, cmd, &kmsqid_ds);
-+
-+ msqid_ds->msg_perm = kmsqid_ds.msg_perm;
-+ msqid_ds->__msg_first = kmsqid_ds.__msg_first;
-+ msqid_ds->__msg_last = kmsqid_ds.__msg_last;
-+ msqid_ds->__msg_cbytes = kmsqid_ds.__msg_cbytes;
-+ msqid_ds->msg_qnum = kmsqid_ds.msg_qnum;
-+ msqid_ds->msg_qbytes = kmsqid_ds.msg_qbytes;
-+ msqid_ds->msg_lspid = kmsqid_ds.msg_lspid;
-+ msqid_ds->msg_lrpid = kmsqid_ds.msg_lrpid;
-+ msqid_ds->msg_stime = kmsqid_ds.msg_stime;
-+ msqid_ds->msg_rtime = kmsqid_ds.msg_rtime;
-+ msqid_ds->msg_ctime = kmsqid_ds.msg_ctime;
-+
-+ return retval;
-+}
-+
-+weak_alias (__msgctl, msgctl)
---- /dev/null
-+++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/alpha/nanosleep.c
-@@ -0,0 +1,54 @@
-+/* Copyright (C) 2002 Free Software Foundation, Inc.
-+ This file is part of the GNU C Library.
-+ Contributed by Bruno Haible <bruno@clisp.org>, 2002.
-+
-+ The GNU C Library is free software; you can redistribute it and/or
-+ modify it under the terms of the GNU Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 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
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, write to the Free
-+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-+ 02111-1307 USA. */
-+
-+#include <stddef.h>
-+#include <errno.h>
-+#include <time.h>
-+#include <bits/kernel_time_t.h>
-+
-+extern int __syscall_nanosleep (const struct __kernel_timespec *requested_time,
-+ struct __kernel_timespec *remaining);
-+
-+int
-+__libc_nanosleep (const struct timespec *requested_time,
-+ struct timespec *remaining)
-+{
-+ struct __kernel_timespec krequested_time;
-+ int retval;
-+
-+ krequested_time.tv_sec = requested_time->tv_sec;
-+ krequested_time.tv_nsec = requested_time->tv_nsec;
-+ if (remaining != NULL)
-+ {
-+ struct __kernel_timespec kremaining;
-+
-+ retval = __syscall_nanosleep (&krequested_time, &kremaining);
-+ if (retval >= 0 || errno == EINTR)
-+ {
-+ remaining->tv_sec = kremaining.tv_sec;
-+ remaining->tv_nsec = kremaining.tv_nsec;
-+ }
-+ }
-+ else
-+ retval = __syscall_nanosleep (&krequested_time, NULL);
-+ return retval;
-+}
-+
-+weak_alias (__libc_nanosleep, __nanosleep)
-+weak_alias (__libc_nanosleep, nanosleep)
---- /dev/null
-+++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/alpha/poll.c
-@@ -0,0 +1,46 @@
-+/* Copyright (C) 2002 Free Software Foundation, Inc.
-+ This file is part of the GNU C Library.
-+ Contributed by Bruno Haible <bruno@clisp.org>, 2002.
-+
-+ The GNU C Library is free software; you can redistribute it and/or
-+ modify it under the terms of the GNU Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 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
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, write to the Free
-+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-+ 02111-1307 USA. */
-+
-+#include <sys/poll.h>
-+#include <sysdep.h>
-+#include <errno.h>
-+
-+/* nfds_t is defined as 'unsigned long int' in <sys/poll.h>, but the poll
-+ system call expects an 'unsigned int' as second argument. */
-+
-+extern int __syscall_poll (struct pollfd *fds, unsigned int nfds, int timeout);
-+
-+int
-+__poll (struct pollfd *fds, nfds_t nfds, int timeout)
-+{
-+ unsigned int infds = nfds;
-+
-+ if (infds == nfds)
-+ return INLINE_SYSCALL (poll, 3, fds, infds, timeout);
-+ else
-+ {
-+ /* NFDS doesn't fit into an unsigned int. FDS cannot point to such
-+ a big chunk of valid memory. */
-+ __set_errno (EFAULT);
-+ return -1;
-+ }
-+}
-+libc_hidden_def (__poll)
-+
-+weak_alias (__poll, poll)
---- /dev/null
-+++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/alpha/regdef.h
-@@ -0,0 +1,62 @@
-+/* Copyright (C) 2002 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 Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 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
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, write to the Free
-+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-+ 02111-1307 USA. */
-+
-+#ifndef _REGDEF_H
-+#define _REGDEF_H
-+
-+/* Common symbolic names for Alpha registers.
-+ Names taken from binutils/opcodes/alpha-dis.c.
-+ Register usage info taken from gcc-3.1/gcc/config/alpha/alpha.h.
-+ NB: "saved" = "call-saved", "nonsaved" = "call-used". */
-+
-+#define v0 $0 /* nonsaved, first return value */
-+#define t0 $1 /* nonsaved, second return value, lexical closure reg */
-+#define t1 $2 /* nonsaved */
-+#define t2 $3 /* nonsaved */
-+#define t3 $4 /* nonsaved */
-+#define t4 $5 /* nonsaved */
-+#define t5 $6 /* nonsaved */
-+#define t6 $7 /* nonsaved */
-+#define t7 $8 /* nonsaved */
-+#define s0 $9 /* saved */
-+#define s1 $10 /* saved */
-+#define s2 $11 /* saved */
-+#define s3 $12 /* saved */
-+#define s4 $13 /* saved */
-+#define s5 $14 /* saved */
-+#define s6 $15 /* use only in leaf functions without frame pointer */
-+#define fp $15 /* frame pointer */
-+#define a0 $16 /* nonsaved, argument 1 */
-+#define a1 $17 /* nonsaved, argument 2 */
-+#define a2 $18 /* nonsaved, argument 3 */
-+#define a3 $19 /* nonsaved, argument 4 */
-+#define a4 $20 /* nonsaved, argument 5 */
-+#define a5 $21 /* nonsaved, argument 6 */
-+#define t8 $22 /* nonsaved */
-+#define t9 $23 /* nonsaved */
-+#define t10 $24 /* nonsaved */
-+#define t11 $25 /* nonsaved */
-+#define ra $26 /* return address */
-+#define t12 $27 /* current function's address */
-+#define pv $27 /* current function's address */
-+#define AT $28 /* nonsaved, assembler temporary */
-+#define gp $29 /* global pointer */
-+#define sp $30 /* stack pointer */
-+#define zero $31 /* reads as zero, writes go to /dev/null */
-+
-+#endif /* _REGDEF_H */
---- /dev/null
-+++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/alpha/rfork.S
-@@ -0,0 +1,29 @@
-+/* Copyright (C) 1993, 1995, 1997, 2002 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 Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 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
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, write to the Free
-+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-+ 02111-1307 USA. */
-+
-+#include <sysdep.h>
-+
-+SYSCALL__ (rfork, 0)
-+ /* In the parent process, a4 == 0, v0 == child pid. */
-+ /* In the child process, a4 == 1, v0 == parent pid. */
-+ cmovne a4, zero, v0
-+ ret
-+
-+PSEUDO_END (__rfork)
-+
-+weak_alias (__rfork, rfork)
---- /dev/null
-+++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/alpha/sched_rr_gi.c
-@@ -0,0 +1,50 @@
-+/* Copyright (C) 2002 Free Software Foundation, Inc.
-+ This file is part of the GNU C Library.
-+ Contributed by Bruno Haible <bruno@clisp.org>, 2002.
-+
-+ The GNU C Library is free software; you can redistribute it and/or
-+ modify it under the terms of the GNU Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 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
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, write to the Free
-+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-+ 02111-1307 USA. */
-+
-+#include <stddef.h>
-+#include <errno.h>
-+#include <time.h>
-+#include <sched.h>
-+#include <sys/types.h>
-+#include <bits/kernel_time_t.h>
-+
-+extern int __syscall_sched_rr_get_interval (pid_t pid,
-+ struct __kernel_timespec *t);
-+
-+int
-+__sched_rr_get_interval (pid_t pid, struct timespec *t)
-+{
-+ struct __kernel_timespec kt;
-+ int retval;
-+
-+ if (t == NULL)
-+ {
-+ errno = EFAULT;
-+ return -1;
-+ }
-+ retval = __syscall_sched_rr_get_interval (pid, &kt);
-+ if (retval >= 0)
-+ {
-+ t->tv_sec = kt.tv_sec;
-+ t->tv_nsec = kt.tv_nsec;
-+ }
-+ return retval;
-+}
-+
-+weak_alias (__sched_rr_get_interval, sched_rr_get_interval)
---- /dev/null
-+++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/alpha/select.c
-@@ -0,0 +1,53 @@
-+/* Copyright (C) 2002 Free Software Foundation, Inc.
-+ This file is part of the GNU C Library.
-+ Contributed by Bruno Haible <bruno@clisp.org>, 2002.
-+
-+ The GNU C Library is free software; you can redistribute it and/or
-+ modify it under the terms of the GNU Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 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
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, write to the Free
-+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-+ 02111-1307 USA. */
-+
-+#include <stddef.h>
-+#include <sys/types.h>
-+#include <sys/time.h>
-+#include <bits/kernel_time_t.h>
-+
-+extern int __syscall_select (int nfds,
-+ fd_set *readfds,
-+ fd_set *writefds,
-+ fd_set *exceptfds,
-+ struct __kernel_timeval *timeout);
-+
-+int
-+__select (int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
-+ struct timeval *timeout)
-+{
-+ int retval;
-+
-+ if (timeout != NULL)
-+ {
-+ struct __kernel_timeval ktimeout;
-+
-+ ktimeout.tv_sec = timeout->tv_sec;
-+ ktimeout.tv_usec = timeout->tv_usec;
-+ retval = __syscall_select (nfds, readfds, writefds, exceptfds, &ktimeout);
-+ timeout->tv_sec = ktimeout.tv_sec;
-+ timeout->tv_usec = ktimeout.tv_usec;
-+ }
-+ else
-+ retval = __syscall_select (nfds, readfds, writefds, exceptfds, NULL);
-+ return retval;
-+}
-+libc_hidden_def (__select)
-+
-+weak_alias (__select, select)
---- /dev/null
-+++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/alpha/semctl.c
-@@ -0,0 +1,87 @@
-+/* Copyright (C) 1995,1997,1998,2000,2003,2004 Free Software Foundation, Inc.
-+ This file is part of the GNU C Library.
-+ Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
-+
-+ The GNU C Library is free software; you can redistribute it and/or
-+ modify it under the terms of the GNU Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 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
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, write to the Free
-+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-+ 02111-1307 USA. */
-+
-+#include <sys/sem.h>
-+#include <sys/syscall.h>
-+#include <stdarg.h> /* va_list */
-+#include <stdlib.h> /* NULL */
-+#include <bits/kernel_time_t.h>
-+
-+/* union semun from FreeBSD <sys/sem.h> */
-+/*
-+ * semctl's arg parameter structure
-+ */
-+union __kernel_semun
-+{
-+ int val; /* value for SETVAL */
-+ struct __kernel_semid_ds *buf; /* buffer for IPC_STAT & IPC_SET */
-+ unsigned short *array; /* array for GETALL & SETALL */
-+};
-+
-+int
-+semctl (int semid, int semnum, int cmd, ...)
-+{
-+ int result;
-+ va_list ap;
-+
-+ union semun semun;
-+ union semun semun_ptr;
-+
-+ union __kernel_semun ksemun;
-+ struct __kernel_semid_ds ksemid_ds;
-+
-+ va_start (ap, cmd);
-+ if (cmd == GETALL || cmd == SETVAL || cmd == SETALL)
-+ {
-+ semun = va_arg (ap, union semun);
-+ semun_ptr = &semun;
-+ }
-+ else if (cmd == IPC_SET || cmd == IPC_STAT)
-+ {
-+ semun = va_arg (ap, union semun);
-+
-+ ksemid_ds.sem_perm = semun.buf->sem_perm;
-+ ksemid_ds.sem_base = semun.buf->sem_base;
-+ ksemid_ds.sem_nsems = semun.buf->sem_nsems;
-+ ksemid_ds.sem_otime = semun.buf->sem_otime;
-+ ksemid_ds.sem_ctime = semun.buf->sem_ctime;
-+
-+ ksemun.buf = &ksemid_ds
-+ semun_ptr = (semun_ptr *) &ksemun;
-+ }
-+ else
-+ {
-+ semun_ptr = NULL;
-+ }
-+ va_end (ap);
-+
-+ result = syscall (SYS_semctl, semid, semnum, cmd, semun_ptr);
-+
-+ if (cmd == IPC_SET || cmd == IPC_STAT)
-+ {
-+ semun.buf->sem_perm = ksemid_ds.sem_perm;
-+ semun.buf->sem_base = ksemid_ds.sem_base;
-+ semun.buf->sem_nsems = ksemid_ds.sem_nsems;
-+ semun.buf->sem_otime = ksemid_ds.sem_otime;
-+ semun.buf->sem_ctime = ksemid_ds.sem_ctime;
-+ }
-+
-+ return result;
-+}
-+
---- /dev/null
-+++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/alpha/setfpucw.c
-@@ -0,0 +1,88 @@
-+/* Set FP exception mask and rounding mode.
-+ Copyright (C) 1996, 1997, 1998, 2002 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 Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 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
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, write to the Free
-+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-+ 02111-1307 USA. */
-+
-+#include <fpu_control.h>
-+#include <fpu.h>
-+
-+extern unsigned long __ieee_get_fp_control (void);
-+extern void __ieee_set_fp_control (unsigned long);
-+
-+
-+static inline unsigned long
-+rdfpcr (void)
-+{
-+ unsigned long fpcr;
-+ asm ("excb; mf_fpcr %0" : "=f"(fpcr));
-+ return fpcr;
-+}
-+
-+static inline void
-+wrfpcr (unsigned long fpcr)
-+{
-+ asm volatile ("mt_fpcr %0; excb" : : "f"(fpcr));
-+}
-+
-+
-+void
-+__setfpucw (fpu_control_t fpu_control)
-+{
-+ if (!fpu_control)
-+ fpu_control = _FPU_DEFAULT;
-+
-+ /* Note that the fpu_control argument, as defined in <fpu_control.h>,
-+ consists of bits that are not directly related to the bits of the
-+ fpcr and fp_control registers. In particular, the precision control
-+ (_FPU_EXTENDED, _FPU_DOUBLE, _FPU_SINGLE) and the interrupt mask
-+ _FPU_MASK_UM are without effect. */
-+
-+ /* First, set dynamic rounding mode: */
-+ {
-+ unsigned long fpcr;
-+
-+ fpcr = rdfpcr();
-+ fpcr &= ~FPCR_DYN_MASK;
-+ switch (fpu_control & 0xc00)
-+ {
-+ case _FPU_RC_NEAREST: fpcr |= FPCR_DYN_NORMAL; break;
-+ case _FPU_RC_DOWN: fpcr |= FPCR_DYN_MINUS; break;
-+ case _FPU_RC_UP: fpcr |= FPCR_DYN_PLUS; break;
-+ case _FPU_RC_ZERO: fpcr |= FPCR_DYN_CHOPPED; break;
-+ }
-+ wrfpcr(fpcr);
-+ }
-+
-+ /* Now tell kernel about traps that we like to hear about: */
-+ {
-+ unsigned long old_fpcw, fpcw;
-+
-+ old_fpcw = fpcw = __ieee_get_fp_control ();
-+ fpcw &= ~IEEE_TRAP_ENABLE_MASK;
-+
-+ if (!(fpu_control & _FPU_MASK_IM)) fpcw |= IEEE_TRAP_ENABLE_INV;
-+ if (!(fpu_control & _FPU_MASK_DM)) fpcw |= IEEE_TRAP_ENABLE_UNF;
-+ if (!(fpu_control & _FPU_MASK_ZM)) fpcw |= IEEE_TRAP_ENABLE_DZE;
-+ if (!(fpu_control & _FPU_MASK_OM)) fpcw |= IEEE_TRAP_ENABLE_OVF;
-+ if (!(fpu_control & _FPU_MASK_PM)) fpcw |= IEEE_TRAP_ENABLE_INE;
-+
-+ if (fpcw != old_fpcw)
-+ __ieee_set_fp_control (fpcw);
-+ }
-+
-+ __fpu_control = fpu_control; /* update global copy */
-+}
---- /dev/null
-+++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/alpha/setitimer.c
-@@ -0,0 +1,63 @@
-+/* Copyright (C) 2002 Free Software Foundation, Inc.
-+ This file is part of the GNU C Library.
-+ Contributed by Bruno Haible <bruno@clisp.org>, 2002.
-+
-+ The GNU C Library is free software; you can redistribute it and/or
-+ modify it under the terms of the GNU Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 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
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, write to the Free
-+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-+ 02111-1307 USA. */
-+
-+#include <stddef.h>
-+#include <errno.h>
-+#include <sys/time.h>
-+#include <bits/kernel_time_t.h>
-+
-+extern int __syscall_setitimer (int which,
-+ const struct __kernel_itimerval *new,
-+ struct __kernel_itimerval *old);
-+
-+int
-+__setitimer (enum __itimer_which which,
-+ const struct itimerval *new, struct itimerval *old)
-+{
-+ int retval;
-+ struct __kernel_itimerval knew;
-+
-+ if (new == NULL)
-+ {
-+ errno = EFAULT;
-+ return -1;
-+ }
-+ knew.it_interval.tv_sec = new->it_interval.tv_sec;
-+ knew.it_interval.tv_usec = new->it_interval.tv_usec;
-+ knew.it_value.tv_sec = new->it_value.tv_sec;
-+ knew.it_value.tv_usec = new->it_value.tv_usec;
-+ if (old != NULL)
-+ {
-+ struct __kernel_itimerval kold;
-+
-+ retval = __syscall_setitimer (which, &knew, &kold);
-+ if (retval >= 0)
-+ {
-+ old->it_interval.tv_sec = kold.it_interval.tv_sec;
-+ old->it_interval.tv_usec = kold.it_interval.tv_usec;
-+ old->it_value.tv_sec = kold.it_value.tv_sec;
-+ old->it_value.tv_usec = kold.it_value.tv_usec;
-+ }
-+ }
-+ else
-+ retval = __syscall_setitimer (which, &knew, NULL);
-+ return retval;
-+}
-+
-+weak_alias (__setitimer, setitimer)
---- /dev/null
-+++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/alpha/settimeofday.c
-@@ -0,0 +1,43 @@
-+/* Copyright (C) 2002 Free Software Foundation, Inc.
-+ This file is part of the GNU C Library.
-+ Contributed by Bruno Haible <bruno@clisp.org>, 2002.
-+
-+ The GNU C Library is free software; you can redistribute it and/or
-+ modify it under the terms of the GNU Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 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
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, write to the Free
-+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-+ 02111-1307 USA. */
-+
-+#include <stddef.h>
-+#include <errno.h>
-+#include <sys/time.h>
-+#include <bits/kernel_time_t.h>
-+
-+extern int __syscall_settimeofday (const struct __kernel_timeval *tv,
-+ const struct timezone *tz);
-+
-+int
-+__settimeofday (const struct timeval *tv, const struct timezone *tz)
-+{
-+ struct __kernel_timeval ktv;
-+
-+ if (tv == NULL)
-+ {
-+ errno = EFAULT;
-+ return -1;
-+ }
-+ ktv.tv_sec = tv->tv_sec;
-+ ktv.tv_usec = tv->tv_usec;
-+ return __syscall_settimeofday (&ktv, tz);
-+}
-+
-+weak_alias (__settimeofday, settimeofday)
---- /dev/null
-+++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/alpha/shmctl.c
-@@ -0,0 +1,58 @@
-+/* Copyright (C) 2006 Free Software Foundation, Inc.
-+ This file is part of the GNU C Library.
-+ Contributed by Aurelien Jarno <aurelien@aurel32.net>, 2006.
-+
-+ The GNU C Library is free software; you can redistribute it and/or
-+ modify it under the terms of the GNU Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 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
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, write to the Free
-+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-+ 02111-1307 USA. */
-+
-+#include <sys/types.h>
-+#include <sys/ipc.h>
-+#include <sys/shm.h>
-+#include <bits/kernel_time_t.h>
-+
-+extern int __syscall_msgctl (int shmid, int cmd, struct __kernel_shmid_ds *buf);
-+
-+int
-+__msgctl (int shmid, int cmd, struct shmid_ds *buf)
-+{
-+ struct __kernel_shmid_ds kshmid_ds;
-+ int retval;
-+
-+ kshmid_ds.shm_perm = shmid_ds->shm_perm;
-+ kshmid_ds.shm_segsz = shmid_ds->shm_segsz;
-+ kshmid_ds.shm_lpid = shmid_ds->shm_lpid;
-+ kshmid_ds.shm_cpid = shmid_ds->shm_cpid;
-+ kshmid_ds.shm_nattch = shmid_ds->shm_nattch;
-+ kshmid_ds.shm_atime = shmid_ds->shm_atime;
-+ kshmid_ds.shm_dtime = shmid_ds->shm_dtime;
-+ kshmid_ds.shm_ctime = shmid_ds->shm_ctime;
-+ kshmid_ds.__shm_internal = shmid_ds->__shm_internal;
-+
-+ retval = __syscall_shmctl (shmid, cmd, &kshmid_ds);
-+
-+ shmid_ds->shm_perm = kshmid_ds.shm_perm;
-+ shmid_ds->shm_segsz = kshmid_ds.shm_segsz;
-+ shmid_ds->shm_lpid = kshmid_ds.shm_lpid;
-+ shmid_ds->shm_cpid = kshmid_ds.shm_cpid;
-+ shmid_ds->shm_nattch = kshmid_ds.shm_nattch;
-+ shmid_ds->shm_atime = kshmid_ds.shm_atime;
-+ shmid_ds->shm_dtime = kshmid_ds.shm_dtime;
-+ shmid_ds->shm_ctime = kshmid_ds.shm_ctime;
-+ shmid_ds->__shm_internal = kshmid_ds.__shm_internal;
-+
-+ return retval;
-+}
-+
-+weak_alias (__shmctl, shmctl)
---- /dev/null
-+++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/alpha/sigcontextinfo.h
-@@ -0,0 +1,25 @@
-+/* Copyright (C) 1998, 1999, 2001, 2002 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 Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 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
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, write to the Free
-+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-+ 02111-1307 USA. */
-+
-+#define SIGCONTEXT int _code, struct sigcontext *
-+#define SIGCONTEXT_EXTRA_ARGS _code,
-+#define GET_PC(ctx) ((void *) (ctx)->sc_pc)
-+#define GET_FRAME(ctx) ((void *) (ctx)->sc_regs[15])
-+#define GET_STACK(ctx) ((void *) (ctx)->sc_regs[30])
-+#define CALL_SIGHANDLER(handler, signo, ctx) \
-+ (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx))
---- /dev/null
-+++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/alpha/start_thread.S
-@@ -0,0 +1,172 @@
-+/* Copyright (C) 2002 Free Software Foundation, Inc.
-+ This file is part of the GNU C Library.
-+ Contributed by Bruno Haible <bruno@clisp.org>, 2002.
-+
-+ The GNU C Library is free software; you can redistribute it and/or
-+ modify it under the terms of the GNU Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 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
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, write to the Free
-+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-+ 02111-1307 USA. */
-+
-+/* __start_thread (flags, stack, func, arg)
-+ calls __rfork (flags), and in the child sets the stack pointer and then
-+ calls _exit (func (arg)).
-+ It cannot be done in portable C. */
-+
-+#include <sysdep.h>
-+#define SIG_SETMASK 3
-+
-+ .text
-+ENTRY (__start_thread)
-+ /* There is a window of a few instructions, right after the rfork
-+ system call, where the handling of a signal would write garbage
-+ into the stack shared by the parent and the child (assuming
-+ RFMEM is set in flags). To solve this: 1. We block all signals
-+ around the rfork system call and unblock them afterwards in
-+ the parent and in the child (but only after changing the stack
-+ pointer). 2. The child accesses only values passed in registers
-+ and on its own stack. This way, if the parent is scheduled to
-+ run first, and handles a signal, it will not affect the child;
-+ and if the child runs first, and handles a signal, it will use
-+ the child's stack and not affect the parent.
-+ We need to pass 7 words of info to the child: stack, func, arg,
-+ and the signal mask to restore. Since we have only 4 call-saved
-+ registers available (%ebx, %esi, %edi, %ebp), we pass only the
-+ stack pointer in a register, and the rest through the child's
-+ stack. */
-+ lda sp,-56(sp)
-+ stq ra,0(sp)
-+ stq s0,8(sp)
-+ stq s1,16(sp)
-+ stq s2,24(sp)
-+ stq s3,32(sp)
-+ .prologue 1
-+
-+ /* Save arguments. */
-+ mov a0,s1 /* flags */
-+ mov a1,s0 /* stack */
-+ mov a2,s2 /* func */
-+ mov a3,s3 /* arg */
-+
-+ and a0,32,t0 /* flags & RFMEM */
-+ beq t0,$simple
-+
-+ /* Block all signals. */
-+ lda t0,-1
-+ stq t0,40(sp)
-+ stq t0,48(sp)
-+ lda a0,SIG_SETMASK
-+ lda a1,40(sp)
-+ mov a1,a2
-+ lda v0,SYS_sigprocmask
-+ call_pal PAL_callsys
-+ bne a3,$error
-+
-+ /* Copy all info to the child's stack. */
-+ lda s0,-32(s0) /* room for func, arg, sigset_t */
-+ andnot s0,7,s0 /* make it 8-bytes aligned */
-+ stq s2,8(s0) /* func */
-+ stq s3,0(s0) /* arg */
-+ ldq t0,40(sp) /* sigset_t word 0 */
-+ ldq t1,48(sp) /* sigset_t word 1 */
-+ stq t0,16(s0)
-+ stq t1,24(s0)
-+
-+ /* Perform the rfork system call. */
-+ mov s1,a0 /* flags */
-+ lda v0,SYS_rfork
-+ call_pal PAL_callsys
-+ bne a3,$error
-+
-+ /* a4 is now 0 for the parent and 1 for the child. */
-+ bne a4,$child
-+
-+ /* Save the child pid, currently in v0. */
-+ mov v0,s1
-+
-+ /* Restore the previous signal mask. */
-+ lda a0,SIG_SETMASK
-+ lda a1,40(sp)
-+ mov zero,a2
-+ lda v0,SYS_sigprocmask
-+ call_pal PAL_callsys
-+
-+ /* Return the child pid, currently in s1. */
-+ mov s1,v0
-+$retv0: ldq ra,0(sp)
-+ ldq s0,8(sp)
-+ ldq s1,16(sp)
-+ ldq s2,24(sp)
-+ ldq s3,32(sp)
-+ lda sp,56(sp)
-+ ret zero,(ra),1
-+
-+$child: /* Here we are in the child thread. */
-+
-+ /* Set the stack pointer. */
-+ mov s0,sp
-+
-+ /* Restore the previous signal mask. */
-+ lda a0,SIG_SETMASK
-+ lda a1,16(sp)
-+ mov zero,a2
-+ lda v0,SYS_sigprocmask
-+ call_pal PAL_callsys
-+
-+$child1:
-+ /* Call func (arg). */
-+ ldq a0,0(sp)
-+ ldq pv,8(sp)
-+ jsr ra,(pv),0
-+
-+ /* Tail-call _exit. */
-+ br gp,$here
-+$here: ldgp gp,0(gp)
-+ mov v0,a0
-+ jmp zero,_exit
-+
-+$simple:/* Simple case without signal mask handling. */
-+
-+ /* Copy all info to the child's stack. */
-+ lda s0,-16(s0) /* room for func, arg */
-+ andnot s0,7,s0 /* make it 8-bytes aligned */
-+ stq s2,8(s0) /* func */
-+ stq s3,0(s0) /* arg */
-+
-+ /* Perform the rfork system call. */
-+ mov s1,a0 /* flags */
-+ lda v0,SYS_rfork
-+ call_pal PAL_callsys
-+ bne a3,$error
-+
-+ /* a4 is now 0 for the parent and 1 for the child. */
-+ /* If in the parent, return the child pid, currently in v0. */
-+ beq a4,$retv0
-+
-+$simple_child:/* Here we are in the child thread. */
-+
-+ /* Set the stack pointer. */
-+ mov s0,sp
-+
-+ br zero,$child1
-+
-+$error: ldq ra,0(sp)
-+ ldq s0,8(sp)
-+ ldq s1,16(sp)
-+ ldq s2,24(sp)
-+ ldq s3,32(sp)
-+ lda sp,56(sp)
-+#if 0 /* Not needed: The PSEUDO_END expansion starts with this label. */
-+ br zero,1996f
-+#endif
-+
-+PSEUDO_END (__start_thread)
---- /dev/null
-+++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/alpha/statfs64.c
-@@ -0,0 +1,2 @@
-+/* 'statfs64' is the same as 'statfs', because
-+ __fsblkcnt64_t == __fsblkcnt_t and __fsfilcnt64_t == __fsfilcnt_t. */
---- /dev/null
-+++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/alpha/sysarch.h
-@@ -0,0 +1,53 @@
-+/* Parameters for the architecture specific system call. alpha version.
-+ Copyright (C) 2002 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 Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 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
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, write to the Free
-+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-+ 02111-1307 USA. */
-+
-+#ifndef _SYSARCH_H
-+#define _SYSARCH_H 1
-+
-+#include <features.h>
-+
-+/* Function that can be used as first argument to 'sysarch'. */
-+enum
-+ {
-+ ALPHA_SETHAE = 0,
-+#define ALPHA_SETHAE ALPHA_SETHAE
-+ /* Arg is 'unsigned long *'. Returns the current pcb_fp_control. */
-+ ALPHA_GET_FPMASK = 1,
-+#define ALPHA_GET_FPMASK ALPHA_GET_FPMASK
-+ /* Arg is 'unsigned long *'. Sets the pcb_fp_control and returns its
-+ old value in the same memory location. */
-+ ALPHA_SET_FPMASK = 2,
-+#define ALPHA_SET_FPMASK ALPHA_SET_FPMASK
-+ ALPHA_GET_UAC = 3,
-+#define ALPHA_GET_UAC ALPHA_GET_UAC
-+ ALPHA_SET_UAC = 4
-+#define ALPHA_SET_UAC ALPHA_SET_UAC
-+ };
-+
-+__BEGIN_DECLS
-+
-+extern int sysarch (int __cmd, void *__arg);
-+
-+#ifdef _LIBC
-+extern int __sysarch (int __cmd, void *__arg);
-+#endif
-+
-+__END_DECLS
-+
-+#endif /* _SYSARCH_H */
---- /dev/null
-+++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/alpha/syscall.S
-@@ -0,0 +1 @@
-+#include <sysdeps/unix/sysv/linux/alpha/syscall.S>
---- /dev/null
-+++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/alpha/syscalls.list
-@@ -0,0 +1,21 @@
-+# File name Caller Syscall name # args Strong name Weak names
-+
-+fhstatfs - fhstatfs i:pp __fhstatfs fhstatfs fhstatfs64
-+fstatfs - fstatfs i:ip __fstatfs fstatfs __fstatfs64 fstatfs64
-+getfsstat - getfsstat i:pii __getfsstat getfsstat __getfsstat64 getfsstat64
-+sys_poll - poll i:pii __syscall_poll
-+statfs - statfs i:sp __statfs statfs statfs64
-+sys_adjtime - adjtime i:pp __syscall_adjtime
-+sys_futimes - futimes i:ip __syscall_futimes
-+sys_getitimer - getitimer i:ip __syscall_getitimer
-+sys_getrusage - getrusage i:ip __syscall_getrusage
-+sys_gettimeofday - gettimeofday i:PP __syscall_gettimeofday
-+sys_lutimes - lutimes i:sp __syscall_lutimes
-+sys_msgctl - msgctl i:iip __syscall_msgctl
-+sys_nanosleep - nanosleep i:pp __syscall_nanosleep
-+sys_sched_rr_gi - sched_rr_get_interval i:ip __syscall_sched_rr_get_interval
-+sys_shmctl - shmctl i:iip __syscall_shmctl
-+sys_select - select i:iPPPP __syscall_select
-+sys_setitimer - setitimer i:ipp __syscall_setitimer
-+sys_settimeofday - settimeofday i:PP __syscall_settimeofday
-+sys_utimes - utimes i:sp __syscall_utimes
---- /dev/null
-+++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/alpha/sysdep.h
-@@ -0,0 +1,34 @@
-+/* Copyright (C) 1993, 1995, 1997, 2002 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 Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 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
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, write to the Free
-+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-+ 02111-1307 USA. */
-+
-+#ifndef _FREEBSD_ALPHA_SYSDEP_H
-+#define _FREEBSD_ALPHA_SYSDEP_H 1
-+
-+#ifdef __ASSEMBLER__
-+#include <machine/pal.h> /* get PAL_callsys */
-+#else
-+#include <syscalls-inline.h>
-+#endif
-+
-+#include <sysdeps/unix/alpha/sysdep.h>
-+
-+/* FIXME: Is this necessary? */
-+#undef INLINE_SYSCALL
-+#define INLINE_SYSCALL(name, nr, args...) __syscall_##name(args)
-+
-+#endif /* freebsd/alpha/sysdep.h */
---- /dev/null
-+++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/alpha/utimes.c
-@@ -0,0 +1,44 @@
-+/* Copyright (C) 2002 Free Software Foundation, Inc.
-+ This file is part of the GNU C Library.
-+ Contributed by Bruno Haible <bruno@clisp.org>, 2002.
-+
-+ The GNU C Library is free software; you can redistribute it and/or
-+ modify it under the terms of the GNU Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 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
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, write to the Free
-+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-+ 02111-1307 USA. */
-+
-+#include <stddef.h>
-+#include <sys/time.h>
-+#include <bits/kernel_time_t.h>
-+
-+extern int __syscall_utimes (const char *file,
-+ const struct __kernel_timeval tvp[2]);
-+
-+int
-+__utimes (const char *file, const struct timeval tvp[2])
-+{
-+ if (tvp != NULL)
-+ {
-+ struct __kernel_timeval ktv[2];
-+
-+ ktv[0].tv_sec = tvp[0].tv_sec;
-+ ktv[0].tv_usec = tvp[0].tv_usec;
-+ ktv[1].tv_sec = tvp[1].tv_sec;
-+ ktv[1].tv_usec = tvp[1].tv_usec;
-+ return __syscall_utimes (file, ktv);
-+ }
-+ else
-+ return __syscall_utimes (file, NULL);
-+}
-+
-+weak_alias (__utimes, utimes)
---- /dev/null
-+++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/alpha/vfork.S
-@@ -0,0 +1,29 @@
-+/* Copyright (C) 1993, 1995, 1997, 2002 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 Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 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
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU Lesser General Public
-+ License along with the GNU C Library; if not, write to the Free
-+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-+ 02111-1307 USA. */
-+
-+#include <sysdep.h>
-+
-+SYSCALL__ (vfork, 0)
-+ /* In the parent process, a4 == 0, v0 == child pid. */
-+ /* In the child process, a4 == 1, v0 == parent pid. */
-+ cmovne a4, zero, v0
-+ ret
-+
-+PSEUDO_END (__vfork)
-+
-+weak_alias (__vfork, vfork)
---- /dev/null
+++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/bind.c
@@ -0,0 +1,60 @@
+/* Copyright (C) 2005 Free Software Foundation, Inc.
@@ -3117,7 +676,7 @@
+
+ /* Only allow a smaller size, otherwise it could lead to
+ stack corruption */
-+ if (new_addrlen < addrlen)
++ if ((new_addrlen != 0) && (new_addrlen < addrlen))
+ addrlen = new_addrlen;
+
+ /* We pass 3 arguments. */
@@ -8223,7 +5782,7 @@
+
+ /* Only allow a smaller size, otherwise it could lead to
+ stack corruption */
-+ if (new_addrlen < addrlen)
++ if ((new_addrlen != 0) && (new_addrlen < addrlen))
+ addrlen = new_addrlen;
+
+ /* We pass 3 arguments. */
@@ -21736,7 +19295,7 @@
+ case AF_IPX:
+ return sizeof (struct sockaddr_ipx);
+ case AF_LOCAL:
-+ return sizeof (struct sockaddr_un);
++ return sizeof (struct sockaddr_un) - sizeof(((struct sockaddr_un *) 0)->__sun_user_compat);
+ }
+ return 0;
+}
@@ -22127,7 +19686,7 @@
+
+ /* Only allow a smaller size, otherwise it could lead to
+ stack corruption */
-+ if (new_addrlen < addrlen)
++ if ((new_addrlen != 0) && (new_addrlen < addrlen))
+ addrlen = new_addrlen;
+ }
+
@@ -22572,6 +20131,11 @@
+
+weak_alias (__sleep, sleep)
--- /dev/null
++++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/socket/sys/un.h
+@@ -0,0 +1,2 @@
++/* kludge to satisfy $SRC/include/sys/un.h */
++#include <kfreebsd/sys/un.h>
+--- /dev/null
+++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/stat16conv.c
@@ -0,0 +1,84 @@
+/* Convert between different 'struct stat' formats.
@@ -25057,6 +22621,57 @@
+
+#endif /* sys/ucontext.h */
--- /dev/null
++++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/sys/un.h
+@@ -0,0 +1,48 @@
++/* Copyright (C) 1991, 1995, 1996, 2001 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 Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 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
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#ifndef _SYS_UN_H
++#define _SYS_UN_H 1
++
++#include <sys/cdefs.h>
++
++/* Get the definition of the macro to define the common sockaddr members. */
++#include <bits/sockaddr.h>
++
++__BEGIN_DECLS
++
++/* Structure describing the address of an AF_LOCAL (aka AF_UNIX) socket. */
++struct sockaddr_un
++ {
++ __SOCKADDR_COMMON (sun_);
++ char sun_path[104]; /* Path name, the kernel restrict it to 104, */
++ char __sun_user_compat[4]; /* but former user header used 108 */
++ };
++
++
++#ifdef __USE_MISC
++# include <string.h> /* For prototype of `strlen'. */
++
++/* Evaluate to actual length of the `sockaddr_un' structure. */
++# define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) \
++ + strlen ((ptr)->sun_path))
++#endif
++
++__END_DECLS
++
++#endif /* sys/un.h */
+--- /dev/null
+++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/syscalls-inline.h
@@ -0,0 +1,59 @@
+/* prototypes of generally used "inline syscalls"
Reply to: