* struct sockaddr_in *raddr;
* u_long program;
* u_long version;
- * struct timeval wait;
+ * struct timeval wait_resend;
* int *sockp;
*
* Same as above, but you specify max packet sizes.
* struct sockaddr_in *raddr;
* u_long program;
* u_long version;
- * struct timeval wait;
+ * struct timeval wait_resend;
* int *sockp;
* u_int sendsz;
* u_int recvsz;
*/
extern CLIENT *clntudp_create __P ((struct sockaddr_in *__raddr,
u_long __program, u_long __version,
- struct timeval __wait, int *__sockp));
+ struct timeval __wait_resend,
+ int *__sockp));
extern CLIENT *clntudp_bufcreate __P ((struct sockaddr_in *__raddr,
u_long __program, u_long __version,
- struct timeval __wait, int *__sockp,
- u_int __sendsz, u_int __recvsz));
+ struct timeval __wait_resend,
+ int *__sockp, u_int __sendsz,
+ u_int __recvsz));
/*
* Print why creation failed
*/
-void clnt_pcreateerror __P ((char *__msg)); /* stderr */
-char *clnt_spcreateerror __P ((char *__msg)); /* string */
+extern void clnt_pcreateerror __P ((char *__msg)); /* stderr */
+extern char *clnt_spcreateerror __P ((char *__msg)); /* string */
/*
* Like clnt_perror(), but is more verbose in its output
*/
-void clnt_perrno __P ((enum clnt_stat __num)); /* stderr */
+extern void clnt_perrno __P ((enum clnt_stat __num)); /* stderr */
/*
* Print an English error message, given the client error code
*/
-void clnt_perror __P ((CLIENT *__clnt, char *__msg)); /* stderr */
-char *clnt_sperror __P ((CLIENT *__clnt, char *__msg)); /* string */
+extern void clnt_perror __P ((CLIENT *__clnt, char *__msg)); /* stderr */
+extern char *clnt_sperror __P ((CLIENT *__clnt, char *__msg)); /* string */
/*
* If a creation fails, the following allows the user to figure out why.
/*
* Copy error message to buffer.
*/
-char *clnt_sperrno __P ((enum clnt_stat __num)); /* string */
+extern char *clnt_sperrno __P ((enum clnt_stat __num)); /* string */
+++ /dev/null
-/* @(#)rnusers.x 2.1 88/08/01 4.0 RPCSRC */
-/* @(#)rnusers.x 1.2 87/09/20 Copyr 1987 Sun Micro */
-
-/*
- * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
- * unrestricted use provided that this legend is included on all tape
- * media and as a part of the software program in whole or part. Users
- * may copy or modify Sun RPC without charge, but are not authorized
- * to license or distribute it to anyone else except as part of a product or
- * program developed by the user.
- *
- * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
- * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
- * Sun RPC is provided with no support and without any obligation on the
- * part of Sun Microsystems, Inc. to assist in its use, correction,
- * modification or enhancement.
- *
- * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
- * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
- * OR ANY PART THEREOF.
- *
- * In no event will Sun Microsystems, Inc. be liable for any lost revenue
- * or profits or other special, indirect and consequential damages, even if
- * Sun has been advised of the possibility of such damages.
- *
- * Sun Microsystems, Inc.
- * 2550 Garcia Avenue
- * Mountain View, California 94043
- */
-
-/*
- * Find out about remote users
- */
-
-const MAXUSERS = 100;
-const MAXUTLEN = 256;
-
-struct utmp {
- string ut_line<MAXUTLEN>;
- string ut_name<MAXUTLEN>;
- string ut_host<MAXUTLEN>;
- int ut_time;
-};
-
-
-struct utmpidle {
- utmp ui_utmp;
- unsigned int ui_idle;
-};
-
-typedef utmp utmparr<MAXUSERS>;
-
-typedef utmpidle utmpidlearr<MAXUSERS>;
-
-program RUSERSPROG {
- /*
- * Includes idle information
- */
- version RUSERSVERS_IDLE {
- int
- RUSERSPROC_NUM(void) = 1;
-
- utmpidlearr
- RUSERSPROC_NAMES(void) = 2;
-
- utmpidlearr
- RUSERSPROC_ALLNAMES(void) = 3;
- } = 1;
-
- /*
- * Old version does not include idle information
- */
- version RUSERSVERS_ORIG {
- int
- RUSERSPROC_NUM(void) = 1;
-
- utmparr
- RUSERSPROC_NAMES(void) = 2;
-
- utmparr
- RUSERSPROC_ALLNAMES(void) = 3;
- } = 2;
-} = 100002;
-
--- /dev/null
+/*
+ * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+ * unrestricted use provided that this legend is included on all tape
+ * media and as a part of the software program in whole or part. Users
+ * may copy or modify Sun RPC without charge, but are not authorized
+ * to license or distribute it to anyone else except as part of a product or
+ * program developed by the user.
+ *
+ * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+ * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+ *
+ * Sun RPC is provided with no support and without any obligation on the
+ * part of Sun Microsystems, Inc. to assist in its use, correction,
+ * modification or enhancement.
+ *
+ * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+ * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+ * OR ANY PART THEREOF.
+ *
+ * In no event will Sun Microsystems, Inc. be liable for any lost revenue
+ * or profits or other special, indirect and consequential damages, even if
+ * Sun has been advised of the possibility of such damages.
+ *
+ * Sun Microsystems, Inc.
+ * 2550 Garcia Avenue
+ * Mountain View, California 94043
+ */
+
+%/*
+% * Find out about remote users
+% */
+
+const RUSERS_MAXUSERLEN = 32;
+const RUSERS_MAXLINELEN = 32;
+const RUSERS_MAXHOSTLEN = 257;
+
+struct rusers_utmp {
+ string ut_user<RUSERS_MAXUSERLEN>; /* aka ut_name */
+ string ut_line<RUSERS_MAXLINELEN>; /* device */
+ string ut_host<RUSERS_MAXHOSTLEN>; /* host user logged on from */
+ int ut_type; /* type of entry */
+ int ut_time; /* time entry was made */
+ unsigned int ut_idle; /* minutes idle */
+};
+
+typedef rusers_utmp utmp_array<>;
+
+#ifdef RPC_HDR
+%
+%/*
+% * Values for ut_type field above.
+% */
+#endif
+const RUSERS_EMPTY = 0;
+const RUSERS_RUN_LVL = 1;
+const RUSERS_BOOT_TIME = 2;
+const RUSERS_OLD_TIME = 3;
+const RUSERS_NEW_TIME = 4;
+const RUSERS_INIT_PROCESS = 5;
+const RUSERS_LOGIN_PROCESS = 6;
+const RUSERS_USER_PROCESS = 7;
+const RUSERS_DEAD_PROCESS = 8;
+const RUSERS_ACCOUNTING = 9;
+
+program RUSERSPROG {
+
+ version RUSERSVERS_3 {
+ int
+ RUSERSPROC_NUM(void) = 1;
+
+ utmp_array
+ RUSERSPROC_NAMES(void) = 2;
+
+ utmp_array
+ RUSERSPROC_ALLNAMES(void) = 3;
+ } = 3;
+
+} = 100002;
+
+#ifdef RPC_HDR
+%
+%
+%#ifdef __cplusplus
+%extern "C" {
+%#endif
+%
+%/*
+% * The following structures are used by version 2 of the rusersd protocol.
+% * They were not developed with rpcgen, so they do not appear as RPCL.
+% */
+%
+%#define RUSERSVERS_IDLE 2
+%#define RUSERSVERS 3 /* current version */
+%#define MAXUSERS 100
+%
+%/*
+% * This is the structure used in version 2 of the rusersd RPC service.
+% * It corresponds to the utmp structure for BSD sytems.
+% */
+%struct ru_utmp {
+% char ut_line[8]; /* tty name */
+% char ut_name[8]; /* user id */
+% char ut_host[16]; /* host name, if remote */
+% long ut_time; /* time on */
+%};
+%
+%struct utmparr {
+% struct ru_utmp **uta_arr;
+% int uta_cnt;
+%};
+%typedef struct utmparr utmparr;
+%int xdr_utmparr();
+%
+%struct utmpidle {
+% struct ru_utmp ui_utmp;
+% unsigned ui_idle;
+%};
+%
+%struct utmpidlearr {
+% struct utmpidle **uia_arr;
+% int uia_cnt;
+%};
+%
+%int xdr_utmpidlearr();
+%
+%#ifdef __cplusplus
+%}
+%#endif
+#endif
+
+
+#ifdef RPC_XDR
+%bool_t
+%xdr_utmp(xdrs, objp)
+% XDR *xdrs;
+% struct ru_utmp *objp;
+%{
+% /* Since the fields are char foo [xxx], we should not free them. */
+% if (xdrs->x_op != XDR_FREE)
+% {
+% char *ptr;
+% ptr = objp->ut_line;
+% if (!xdr_string (xdrs, &ptr, sizeof (objp->ut_line))) {
+% return (FALSE);
+% }
+% ptr = objp->ut_name;
+% if (!xdr_string (xdrs, &ptr, sizeof (objp->ut_name))) {
+% return (FALSE);
+% }
+% ptr = objp->ut_host;
+% if (!xdr_string (xdrs, &ptr, sizeof (objp->ut_host))) {
+% return (FALSE);
+% }
+% }
+% if (!xdr_long(xdrs, &objp->ut_time)) {
+% return (FALSE);
+% }
+% return (TRUE);
+%}
+%
+%bool_t
+%xdr_utmpptr(xdrs, objpp)
+% XDR *xdrs;
+% struct ru_utmp **objpp;
+%{
+% if (!xdr_reference(xdrs, (char **) objpp, sizeof (struct ru_utmp),
+% xdr_utmp)) {
+% return (FALSE);
+% }
+% return (TRUE);
+%}
+%
+%bool_t
+%xdr_utmparr(xdrs, objp)
+% XDR *xdrs;
+% struct utmparr *objp;
+%{
+% if (!xdr_array(xdrs, (char **)&objp->uta_arr, (u_int *)&objp->uta_cnt,
+% MAXUSERS, sizeof(struct ru_utmp *), xdr_utmpptr)) {
+% return (FALSE);
+% }
+% return (TRUE);
+%}
+%
+%bool_t
+%xdr_utmpidle(xdrs, objp)
+% XDR *xdrs;
+% struct utmpidle *objp;
+%{
+% if (!xdr_utmp(xdrs, &objp->ui_utmp)) {
+% return (FALSE);
+% }
+% if (!xdr_u_int(xdrs, &objp->ui_idle)) {
+% return (FALSE);
+% }
+% return (TRUE);
+%}
+%
+%bool_t
+%xdr_utmpidleptr(xdrs, objpp)
+% XDR *xdrs;
+% struct utmpidle **objpp;
+%{
+% if (!xdr_reference(xdrs, (char **) objpp, sizeof (struct utmpidle),
+% xdr_utmpidle)) {
+% return (FALSE);
+% }
+% return (TRUE);
+%}
+%
+%bool_t
+%xdr_utmpidlearr(xdrs, objp)
+% XDR *xdrs;
+% struct utmpidlearr *objp;
+%{
+% if (!xdr_array(xdrs, (char **)&objp->uia_arr, (u_int *)&objp->uia_cnt,
+% MAXUSERS, sizeof(struct utmpidle *), xdr_utmpidleptr)) {
+% return (FALSE);
+% }
+% return (TRUE);
+%}
+#endif
/* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'. Alpha version.
-Copyright (C) 1994, 1996 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+ Copyright (C) 1994, 1996 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 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.
+ 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., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ 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. */
/* This just does a tail-call to `__sigsetjmp (ARG, 0)'.
We cannot do it in C because it must be a tail-call, so frame-unwinding
ENTRY(_setjmp)
ldgp $29,0($27)
#ifdef PROF
+ .set noat
lda AT, _mcount
jsr AT, (AT), _mcount
+ .set at
#endif
.prologue 1
bis $31, $31, $17 /* Pass a second argument of zero. */
/* BSD `setjmp' entry point to `sigsetjmp (..., 1)'. Alpha version.
-Copyright (C) 1994, 1996 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+ Copyright (C) 1994, 1996 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 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.
+ 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., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ 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. */
/* This just does a tail-call to `__sigsetjmp (ARG, 1)'.
We cannot do it in C because it must be a tail-call, so frame-unwinding
ENTRY(setjmp)
ldgp $29, 0($27)
#ifdef PROF
+ .set noat
lda AT, _mcount
jsr AT, (AT), _mcount
+ .set at
#endif
.prologue 1
bis $31, 1, $17 /* Pass a second argument of one. */
/* Copyright (C) 1996 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+ 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 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.
+ 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., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ 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>
ENTRY(__htonl)
#ifdef PROF
ldgp gp, 0(pv)
+ .set noat
lda AT, _mcount
jsr AT, (AT), _mcount
+ .set at
.prologue 1
#else
.prologue 0
/* Copyright (C) 1996 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+ 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 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.
+ 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., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ 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>
ENTRY(__htons)
#ifdef PROF
ldgp gp, 0(pv)
+ .set noat
lda AT, _mcount
jsr AT, (AT), _mcount
+ .set at
.prologue 1
#else
.prologue 0
+++ /dev/null
-/* Copyright (C) 1996 Free Software Foundation, Inc.
- Contributed by Richard Henderson (rth@tamu.edu)
-
- 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., 675 Mass Ave,
- Cambridge, MA 02139, USA. */
-
-
-/* This is the child of the C-with-inline-assembly memcpy posted by
- Martin Ostermann (ost@comnets.rwth-aachen.de).
-
- This is generally scheduled for the EV5, but whenever necessary and
- possible, the autoswap slotting feature of the EV5 is used so that the
- code lays out nicely for the EV4 as well. */
-
-#include <alpha/regdef.h>
-
- .set noreorder
-
- .text
-
- .ent copy_fwd_aligned
-copy_fwd_aligned:
- .frame sp, 0, ra, 0
- .prologue 0
-
- /* Aligned forward copy main loop. On entry to this basic block:
- t0 == source word waiting to be stored
- t2 == loop counter
- a0 == destination pointer
- a1 == source pointer
- a2 mod 8 == byte count in final word */
- .align 4
-$fa_loop:
- and t2, 7, t1 # e0 :
- beq t1, 1f # .. e1 :
-
-0: stq_u t0, 0(a0) # e0 :
- subq t1, 1, t1 # .. e1 :
- ldq_u t0, 8(a1) # e0 : copy up to seven words
- addq a0, 8, a0 # .. e1 :
- addq a1, 8, a1 # e0 :
- bne t1, 0b # .. e1 :
-
-1: bic t2, 7, t2 # e0 :
- beq t2, $fa_tail # .. e1 :
-
-2: stq_u t0, 0(a0) # e0 :
- addq a0, 64, a0 # .. e1 :
- ldq_u t3, 8(a1) # e0 : copy eight words as fast as we can
- ldq_u t4, 16(a1) # .. e1 :
- ldq_u t5, 24(a1) # e0 :
- ldq_u t6, 32(a1) # .. e1 :
- ldq_u t7, 40(a1) # e0 :
- ldq_u t8, 48(a1) # .. e1 :
- ldq_u t9, 56(a1) # e0 :
- ldq_u t0, 64(a1) # .. e1 :
- stq_u t3, -56(a0) # e0 :
- subq t2, 8, t2 # .. e1 :
- stq_u t4, -48(a0) # e0 :
- addq a1, 64, a1 # .. e1 :
- stq_u t5, -40(a0) # e0 :
- stq_u t6, -32(a0) # e0 :
- stq_u t7, -24(a0) # e0 :
- stq_u t8, -16(a0) # e0 :
- stq_u t9, -8(a0) # e0 :
- bne t2, 2b # .. e1 :
-
- /* Take care of a partial word tail. */
-$fa_tail:
- and a2, 7, t3 # e0 :
- bne t3, 1f # .. e1 (zdb)
-
- /* Aligned copy, aligned tail, final store. */
- stq_u t0, 0(a0)
- ret
-
-1: ldq_u t1, 0(a0) # e1 :
- mskql t0, a2, t0 # .. e1 :
- mskqh t1, a2, t1 # e0 (stall)
- bis t0, t1, t0 # e1 :
- stq_u t0, 0(a0) # e0 :
- ret # .. e1 :
-
- /* This is the actual entry point to this function. */
- .align 3
-$fwd_aligned:
- ldq_u t0, 0(a1) # e0 :
- and a0, 7, t3 # .. e1 :
- addq a2, t3, a2 # e0 :
- subq a2, 1, t2 # e1 :
- sra t2, 3, t2 # e0 :
- beq t3, $fa_loop # .. e1 :
-
- ldq_u t1, 0(a0) # e0 :
- beq t2, $fa_small # .. e1 :
- mskqh t0, a0, t0 # e0 :
- mskql t1, a0, t3 # e0 :
- bis t0, t3, t0 # e0 :
- br $fa_loop # .. e1 :
-
- /* The move affects exactly one destination word. */
-$fa_small:
- mskqh t0, a0, t0 # e0 :
- and a2, 7, t4 # .. e1 :
- mskql t1, a0, t3 # e0 :
- bne t4, 1f # .. e1 :
-
- or t0, t3, t0 # e0 :
- unop # :
- stq_u t0, 0(a0) # e0 :
- ret # .. e1 :
-
-1: mskql t0, a2, t0 # e0 :
- mskqh t1, a2, t1 # e0 :
- or t0, t3, t0 # e0 :
- or t0, t1, t0 # e1 :
- stq_u t0, 0(a0) # e0 :
- ret # .. e1 :
-
- .end copy_fwd_aligned
-
- .ent memcpy
- .globl memcpy
- .align 3
-memcpy:
- .frame sp, 0, ra, 0
-#ifdef PROF
- ldgp gp, 0(ra)
- lda AT, _mcount
- jsr AT, (AT), _mcount
- .prologue 1
-#else
- .prologue 0
-#endif
-
- mov a0, v0
- beq a2, $zero_length
-
- /* Are source and destination co-aligned? */
- xor a0, a1, t0
- unop
- and t0, 7, t0
- beq t0, $fwd_aligned
- br $fwd_unaligned
-
- .end memcpy
-
- .ent copy_fwd_unaligned
-copy_fwd_unaligned:
- .frame sp, 0, ra, 0
- .prologue 0
-
- /* Unaligned forward copy main loop. On entry to this basic block:
- t0 == source low word, unshifted
- t2 == loop counter
- t7 == last source byte + 1
- a0 == destination pointer
- a1 == source pointer
- a2 mod 8 == byte count in final word */
- .align 4
-$fu_loop:
- beq t2, $fu_tail # e1 :
- blbc t2, 0f # e1 :
-
- ldq_u t1, 8(a1) # e1 : copy one unaligned word
- extql t0, a1, t3 # .. e0 :
- addq a1, 8, a1 # e0 :
- addq a0, 8, a0 # .. e1 :
- extqh t1, a1, t4 # e0 :
- subq t2, 1, t2 # .. e1 :
- mov t1, t0 # e0 :
- or t3, t4, t3 # .. e1 :
- stq_u t3, -8(a0) # e0 :
- beq t2, $fu_tail # .. e1 :
-
-0: ldq_u t1, 8(a1) # e1 : copy two unaligned words
- extql t0, a1, t3 # .. e0 :
- ldq_u t0, 16(a1) # e0 :
- subq t2, 2, t2 # .. e1 :
- extqh t1, a1, t4 # e0 :
- addq a0, 16, a0 # .. e1 :
- extql t1, a1, t5 # e0 :
- or t3, t4, t3 # .. e1 :
- extqh t0, a1, t6 # e0 :
- addq a1, 16, a1 # .. e1 :
- stq_u t3, -16(a0) # e0 :
- or t5, t6, t5 # .. e1 :
- stq_u t5, -8(a0) # e0 :
- bne t2, 0b # .. e1 :
-
- /* Take care of a partial words tail. */
-$fu_tail:
- ldq_u t4, -1(t7) # e1 :
- extql t0, a1, t3 # .. e0 :
- extqh t4, a1, t4 # e0 (stall)
- and a2, 7, t5 # .. e1 :
- or t3, t4, t3 # e0 :
- beq t5, 1f # .. e1 :
-
- ldq_u t1, 0(a0) # e1 :
- mskql t3, a2, t3 # .. e0 :
- mskqh t1, a2, t1 # e0 (stall)
- or t1, t3, t3 # e1 :
-
-1: stq_u t3, 0(a0) # e0 :
- ret # .. e1 :
-
- /* The entry point to the unaligned forward copy. */
- .align 3
-$fwd_unaligned:
- ldq_u t0, 0(a1) # e0 : load initial bits of src
- addq a1, a2, t7 # .. e1 : record last byte + 1 of src
- and a0, 7, t3 # e0 : find dst misalignment
- addq a2, t3, a2 # e1 : find number of words affected
- subq a2, 1, t2 # e0 :
- cmple a2, 8, t4 # .. e1 : are we dealing with a small block?
- subq a1, t3, a1 # e0 :
- bne t4, $fu_small # .. e1 :
- srl t2, 3, t2 # e0 :
- beq t3, $fu_loop # .. e1 :
-
- /* Take care of an unaligned dst head. */
- ldq_u t5, 0(a0) # e0 :
- ldq_u t1, 8(a1) # .. e1 :
- extql t0, a1, t3 # e0 :
- addq a0, 8, a0 # .. e1 :
- extqh t1, a1, t4 # e0 :
- addq a1, 8, a1 # .. e1 :
- mskql t5, a0, t5 # e0 :
- or t3, t4, t3 # .. e1 :
- mskqh t3, a0, t3 # e0 :
- subq t2, 1, t2 # .. e1 :
- or t3, t5, t3 # e0 :
- mov t1, t0 # .. e1 :
- stq_u t3, -8(a0) # e0 :
- br $fu_loop # .. e1 :
-
- /* The move affects exactly one destination word. */
- .align 3
-$fu_small:
- ldq_u t2, 0(a0) # e1 :
- extql t0, a1, t3 # .. e0 :
- ldq_u t1, -1(t7) # e0 :
- and a2, 7, t8 # .. e1 :
- mskqh t2, a2, t6 # e0 :
- mskql t2, a0, t5 # e0 :
- extqh t1, a1, t4 # e0 :
- cmovne t8, t6, t8 # .. e1 :
- or t3, t4, t3 # e0 :
- or t5, t8, t5 # .. e1 :
- mskqh t3, a0, t3 # e0 :
- and a2, 7, t8 # .. e1 :
- mskql t3, a2, t6 # e0 :
- cmovne t8, t6, t8 # e1 :
- or t3, t5, t3 # e0 :
- unop # :
- stq_u t3, 0(a0) # e0 :
-
-$zero_length:
- ret # .. e1 :
-
- .end copy_fwd_unaligned
/* Copyright (C) 1996 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
-Contributed by David Mosberger <davidm@azstarnet.com>
+ This file is part of the GNU C Library.
+ Contributed by David Mosberger <davidm@azstarnet.com>, 1996.
-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 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.
+ 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., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ 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>
ENTRY(__copysign)
#ifdef PROF
ldgp gp, 0(pv)
+ .set noat
lda AT, _mcount
jsr AT, (AT), _mcount
+ .set at
.prologue 1
#else
.prologue 0
/* Copyright (C) 1992, 1994, 1996 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+ 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 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.
+ 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., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ 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>
ENTRY (__sigsetjmp)
ldgp $29, 0($27)
#ifdef PROF
+ .set noat
lda AT, _mcount
jsr AT, (AT), _mcount
+ .set at
#endif
.prologue 1
/* Copyright (C) 1996 Free Software Foundation, Inc.
- Contributed by Richard Henderson (rth@tamu.edu)
+ This file is part of the GNU C Library.
+ Contributed by Richard Henderson <rth@tamu.edu>, 1996.
-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 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.
-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., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ 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. */
/* Copy a null-terminated string from SRC to DST. Return a pointer
to the null-terminator in the source. */
ENTRY(__stpcpy)
ldgp gp, 0(pv)
#ifdef PROF
+ .set noat
lda AT, _mcount
jsr AT, (AT), _mcount
+ .set at
#endif
.prologue 1
/* Copyright (C) 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Richard Henderson (rth@tamu.edu)
+ Contributed by Richard Henderson <rth@tamu.edu>, 1996.
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
ENTRY(strcat)
ldgp gp, 0(pv)
#ifdef PROF
+ .set noat
lda AT, _mcount
jsr AT, (AT), _mcount
+ .set at
#endif
.prologue 1
/* Copyright (C) 1996 Free Software Foundation, Inc.
- Contributed by Richard Henderson (rth@tamu.edu)
+ This file is part of the GNU C Library.
+ Contributed by Richard Henderson <rth@tamu.edu>, 1996.
-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 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.
-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., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ 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. */
/* Copy a null-terminated string from SRC to DST. Return a pointer
to the null-terminator in the source. */
ENTRY(strcpy)
ldgp gp, 0(pv)
#ifdef PROF
+ .set noat
lda AT, _mcount
jsr AT, (AT), _mcount
+ .set at
#endif
.prologue 1
/* Copyright (C) 1996 Free Software Foundation, Inc.
- Contributed by Richard Henderson (rth@tamu.edu)
+ This file is part of the GNU C Library.
+ Contributed by Richard Henderson <rth@tamu.edu>, 1996.
-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 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.
-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., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ 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. */
/* Append no more than COUNT characters from the null-terminated string SRC
to the null-terminated string DST. Always null-terminate the new DST. */
ENTRY(strncat)
ldgp gp, 0(pv)
#ifdef PROF
+ .set noat
lda AT, _mcount
jsr AT, (AT), _mcount
+ .set at
#endif
.prologue 1
/* Copyright (C) 1996 Free Software Foundation, Inc.
- Contributed by David Mosberger (davidm@cs.arizona.edu).
- Based on public-domain C source by Linus Torvalds.
-
This file is part of the GNU C Library.
+ Contributed by David Mosberger <davidm@cs.arizona.edu>, 1996.
+ Based on public-domain C source by Linus Torvalds.
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
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., 675 Mass Ave,
- Cambridge, MA 02139, USA. */
+ 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. */
/* This version is much faster than generic sqrt implementation, but
it doesn't handle exceptional values or the inexact flag. Don't use
#ifndef _IEEE_FP
+#define _ERRNO_H
#include <errnos.h>
#include <sysdep.h>
#define _PATH_DRUM "/dev/drum"
#define _PATH_KMEM "/dev/kmem"
#define _PATH_MAILDIR "/var/mail"
+#define _PATH_LASTLOG "/var/log/lastlog"
#define _PATH_MAN "/usr/man"
#define _PATH_MEM "/dev/mem"
#define _PATH_MNTTAB "/etc/fstab"
#define _PATH_SHELLS "/etc/shells"
#define _PATH_TTY "/dev/tty"
#define _PATH_UNIX "/vmunix"
+#define _PATH_UTMP "/var/run/utmp"
#define _PATH_VI "/usr/bin/vi"
+#define _PATH_WTMP "/var/log/wtmp"
/* Provide trailing slash, since mostly used for building pathnames. */
#define _PATH_DEV "/dev/"
#if !defined (_SIGSET_H_fns) && defined (_SIGNAL_H)
#define _SIGSET_H_fns 1
+#ifndef _EXTERN_INLINE
+#define _EXTERN_INLINE extern __inline
+#endif
+
/* Return a mask that includes SIG only. The cast to `sigset_t' avoids
overflow if `sigset_t' is wider than `int'. */
#define __sigmask(sig) (((__sigset_t) 1) << ((sig) - 1))
#define __sigemptyset(set) ((*(set) = (__sigset_t) 0), 0)
#define __sigfillset(set) ((*(set) = ~(__sigset_t) 0), 0)
-/* These functions must check for a bogus signal number. We detect it by a
- zero sigmask, since a number too low or too high will have shifted the 1
- off the high end of the mask. If we find an error, we punt to a random
- call we know fails with EINVAL (kludge city!), so as to avoid referring
- to `errno' in this file (sigh). */
+/* These functions needn't check for a bogus signal number -- error
+ checking is done in the non __ versions. */
extern int __sigismember (__const __sigset_t *, int);
extern int __sigaddset (__sigset_t *, int);
extern int __sigdelset (__sigset_t *, int);
-#ifndef _EXTERN_INLINE
-#define _EXTERN_INLINE extern __inline
-#endif
#define __SIGSETFN(NAME, BODY, CONST) \
_EXTERN_INLINE int \
- __##NAME (CONST __sigset_t *__set, int __sig) \
+ NAME (CONST __sigset_t *__set, int __sig) \
{ \
- if (__sig < 1 || __sig > (int) sizeof (__sigset_t) * 8) \
- { \
- extern int raise (int); \
- return raise (-1); \
- } \
- else \
- { \
- __sigset_t __mask = __sigmask (__sig); \
- return BODY; \
- } \
+ __sigset_t __mask = __sigmask (__sig); \
+ return BODY; \
}
-__SIGSETFN (sigismember, (*__set & __mask) ? 1 : 0, __const)
-__SIGSETFN (sigaddset, ((*__set |= __mask), 0), )
-__SIGSETFN (sigdelset, ((*__set &= ~__mask), 0), )
+__SIGSETFN (__sigismember, (*__set & __mask) ? 1 : 0, __const)
+__SIGSETFN (__sigaddset, ((*__set |= __mask), 0), )
+__SIGSETFN (__sigdelset, ((*__set &= ~__mask), 0), )
#undef __SIGSETFN
/* The `struct utmp' type, describing entries in the utmp file. Generic/BSDish
-Copyright (C) 1993, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1996 Free Software Foundation, Inc.
-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 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.
+ 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. */
+ 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. */
#ifndef _UTMPBITS_H
#define _UTMPBITS_H 1
#include <features.h>
+#include <paths.h>
#include <time.h>
-#define _PATH_UTMP "/var/run/utmp"
-#define _PATH_WTMP "/var/log/wtmp"
-#define _PATH_LASTLOG "/var/log/lastlog"
#define UT_NAMESIZE 8
#define UT_LINESIZE 8
/* Nonzero if STATUS indicates termination by a signal. */
#ifdef __GNUC__
#define __WIFSIGNALED(status) \
- (__extension__ ({ int __stat = (status); \
- !__WIFSTOPPED(__stat) && !__WIFEXITED(__stat); }))
+ (__extension__ ({ int __status = (status); \
+ !__WIFSTOPPED(__status) && !__WIFEXITED(__status); }))
#else /* Not GCC. */
#define __WIFSIGNALED(status) (!__WIFSTOPPED(status) && !__WIFEXITED(status))
#endif /* GCC. */
/* The `struct utmp' type, describing entries in the utmp file. GNU version.
-Copyright (C) 1993, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1996 Free Software Foundation, Inc.
-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 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.
+ 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. */
+ 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. */
#ifndef _UTMPBITS_H
#define _UTMPBITS_H 1
#include <features.h>
+#include <paths.h>
#include <sys/time.h>
#include <sys/types.h>
-#define _PATH_UTMP "/var/run/utmp"
-#define _PATH_WTMP "/var/log/wtmp"
-#define _PATH_LASTLOG "/var/log/lastlog"
#define UT_UNKNOWN 0 /* for ut_type field */
#define LOGIN_PROCESS 6
#define USER_PROCESS 7
#define DEAD_PROCESS 8
+#define ACCOUNTING 9
#define UT_LINESIZE 32
#define UT_NAMESIZE 32
readv (fd, vector, count)
int fd;
const struct iovec *vector;
- size_t count;
+ int count;
{
char *buffer;
size_t bytes;
int bytes_read;
- register size_t i;
+ int i;
/* Find the total number of bytes to be read. */
bytes = 0;
-/* Copyright (C) 1991, 1994, 1995 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+/* Copyright (C) 1991, 1994, 1995, 1996 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 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.
+ 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., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ 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 <ansidecl.h>
#include <errno.h>
#include <signal.h>
/* Block signals in MASK, returning the old mask. */
int
-DEFUN(__sigblock, (mask), int mask)
+__sigblock (mask)
+ int mask;
{
register int sig;
sigset_t set, oset;
- if (__sigemptyset(&set) < 0)
+ if (__sigemptyset (&set) < 0)
return -1;
-
+
if (sizeof (mask) == sizeof (set))
*(int *) &set = mask;
+ else if (sizeof (unsigned long int) == sizeof (set))
+ *(unsigned long int *) &set = (unsigned int) mask;
else
for (sig = 1; sig < NSIG; ++sig)
- if ((mask & sigmask(sig)) &&
- __sigaddset(&set, sig) < 0)
+ if ((mask & sigmask (sig)) && __sigaddset (&set, sig) < 0)
return -1;
- if (sigprocmask(SIG_BLOCK, &set, &oset) < 0)
+ if (sigprocmask (SIG_BLOCK, &set, &oset) < 0)
return -1;
- mask = 0;
if (sizeof (mask) == sizeof (oset))
mask = *(int *) &oset;
+ else if (sizeof (unsigned long int) == sizeof (oset))
+ mask = *(unsigned long int*) &oset;
else
- for (sig = 1; sig < NSIG; ++sig)
- if (__sigismember(&oset, sig))
- mask |= sigmask(sig);
+ for (sig = 1, mask = 0; sig < NSIG; ++sig)
+ if (__sigismember (&oset, sig))
+ mask |= sigmask (sig);
return mask;
}
/* Copyright (C) 1992, 1994, 1996 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., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ 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 <stddef.h>
#include <signal.h>
/* Copyright (C) 1991, 1992, 1996 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+ 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 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.
+ 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., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ 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 <errno.h>
#include <signal.h>
{
struct sigaction act, oact;
- if (handler == SIG_ERR)
+ /* Check signal extents to protect __sigismember. */
+ if (handler == SIG_ERR || sig < 1 || sig >= NSIG)
{
__set_errno (EINVAL);
return SIG_ERR;
-/* Copyright (C) 1991, 1992, 1994, 1995 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+/* Copyright (C) 1991, 92, 94, 95, 96 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 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.
+ 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., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ 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 <ansidecl.h>
#include <errno.h>
#include <signal.h>
/* Set the mask of blocked signals to MASK,
wait for a signal to arrive, and then restore the mask. */
int
-DEFUN(__sigpause, (mask), int mask)
+__sigpause (mask)
+ int mask;
{
sigset_t set;
int sig;
if (sizeof (mask) == sizeof (set))
*(int *) &set = mask;
+ else if (sizeof (unsigned long int) == sizeof (set))
+ *(unsigned long int *) &set = (unsigned int) mask;
else
for (sig = 1; sig < NSIG; ++sig)
- if ((mask & sigmask(sig)) &&
- __sigaddset(&set, sig) < 0)
+ if ((mask & sigmask (sig)) && __sigaddset (&set, sig) < 0)
return -1;
return sigsuspend (&set);
/* Copyright (C) 1991, 1994, 1995, 1996 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+ 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 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.
+ 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., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ 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 <errno.h>
#include <signal.h>
if (sizeof (mask) == sizeof (set))
*(int *) &set = mask;
+ else if (sizeof (unsigned long int) == sizeof (set))
+ *(unsigned long int *) &set = (unsigned int) mask;
else
for (sig = 1; sig < NSIG; ++sig)
- if ((mask & sigmask(sig)) &&
- __sigaddset (&set, sig) < 0)
+ if ((mask & sigmask (sig)) && __sigaddset (&set, sig) < 0)
return -1;
if (__sigprocmask (SIG_SETMASK, &set, &oset) < 0)
return -1;
- mask = 0;
if (sizeof (mask) == sizeof (oset))
mask = *(int *) &oset;
+ else if (sizeof (unsigned long int) == sizeof (oset))
+ mask = *(unsigned long int *) &oset;
else
- for (sig = 1; sig < NSIG; ++sig)
+ for (sig = 1, mask = 0; sig < NSIG; ++sig)
if (__sigismember (&oset, sig))
mask |= sigmask (sig);
/* Copyright (C) 1991, 92, 94, 95, 96 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+ 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 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.
+ 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., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ 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 <signal.h>
#include <errno.h>
register int sig;
if (sizeof (*set) == sizeof (mask))
+ *(int *) set = mask;
+ else if (sizeof (*set) == sizeof (unsigned long int))
+ *(unsigned long int *) set = (unsigned int) mask;
+ else
{
- *(int *) set = mask;
- return 0;
- }
-
- if (__sigemptyset (set) < 0)
- return -1;
-
- for (sig = 1; sig < NSIG; ++sig)
- if (mask & sigmask (sig))
- if (__sigaddset (set, sig) < 0)
+ if (__sigemptyset (set) < 0)
return -1;
+ for (sig = 1; sig < NSIG; ++sig)
+ if ((mask & sigmask (sig)) && __sigaddset (set, sig) < 0)
+ return -1;
+ }
+
return 0;
}
if (sizeof (int) == sizeof (sigset_t))
mask = *(int *) &old.sa_mask;
+ else if (sizeof (unsigned long int) == sizeof (sigset_t))
+ mask = *(unsigned long int *) &old.sa_mask;
else
for (i = 1; i < NSIG; ++i)
if (__sigismember(&old.sa_mask, i))
int this;
/* Prepare set. */
- sigfillset (&tmp_mask);
+ __sigfillset (&tmp_mask);
/* Unblock all signals in the SET and register our nice handler. */
action.sa_handler = ignore_signal;
action.sa_flags = 0;
- sigfillset (&action.sa_mask); /* Block all signals for handler. */
+ __sigfillset (&action.sa_mask); /* Block all signals for handler. */
/* Make sure we recognize error conditions by setting WAS_SIG to a
value which does not describe a legal signal number. */
was_sig = -1;
for (this = 0; this < NSIG; ++this)
- if (sigismember (set, this))
+ if (__sigismember (set, this))
{
/* Unblock this signal. */
- sigdelset (&tmp_mask, this);
+ __sigdelset (&tmp_mask, this);
/* Register temporary action handler. */
- if (sigaction (this, &action, &saved[this]) != 0)
+ if (__sigaction (this, &action, &saved[this]) != 0)
goto restore_handler;
}
/* Now we can wait for signals. */
- sigsuspend (&tmp_mask);
+ __sigsuspend (&tmp_mask);
restore_handler:
save_errno = errno;
while (--this >= 0)
- if (sigismember (set, this))
+ if (__sigismember (set, this))
/* We ignore errors here since we must restore all handlers. */
- sigaction (this, &saved[this], NULL);
+ __sigaction (this, &saved[this], NULL);
__set_errno (save_errno);
writev (fd, vector, count)
int fd;
const struct iovec *vector;
- size_t count;
+ int count;
{
char *buffer;
register char *bp;
size_t bytes, to_copy;
- register size_t i;
+ int i;
/* Find the total number of bytes to be written. */
bytes = 0;