From 8145a97443a708443ed2c39e80e681a5c5354e92 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 19 Oct 1996 23:33:00 +0000 Subject: [PATCH] update from main archive 961019 Sat Oct 19 17:42:24 1996 Ulrich Drepper * intl/locale.alias: Language for entry `czech' is `cs'. Fri Oct 17 13:20:35 1996 Thorsten Kukuk * sunrpc/etc.rpc: Update from ti-rpcsvc 2.3. Fri Oct 18 22:56:45 1996 Ulrich Drepper * sunrpc/Makefile (install-sbin): Remove portmap. This version is buggy and more competent people work on a usable version which is distributed separately. * sunrpc/portmap.c: Removed. Suggested by Thorsten Kukuk. Fri Oct 18 12:17:09 1996 Enrique Melero * sysdeps/libm-ieee754/s_finitel.c: Change function name to `finitel'. Fri Oct 18 00:01:10 1996 Ulrich Drepper * string/Makefile (tests): Add stratcliff. * string/stratcliff.c: New file. Test for string function at the edge of the usable memory. Thu Oct 17 22:10:19 1996 Ulrich Drepper * Makerules ($(libdir)/libc.so): Fix typo. * elf/ldd.sh.in: Test whether given file really exist and give better message if it is not available. Thu Oct 17 04:25:38 1996 Ulrich Drepper * sysdeps/unix/sysv/linux/sys/shm_buf.h: Add definition for SHM_R and SHM_W. * locale/programs/localedef.c (main): Test with -1 to find out --- ChangeLog | 41 ++- Makerules | 2 +- elf/ldd.sh.in | 8 +- intl/locale.alias | 2 +- string/Makefile | 3 +- sunrpc/Makefile | 2 +- sunrpc/etc.rpc | 44 ++- sunrpc/portmap.c | 480 -------------------------- sysdeps/libm-ieee754/s_finitel.c | 4 +- sysdeps/unix/sysv/linux/sys/shm_buf.h | 16 +- 10 files changed, 101 insertions(+), 501 deletions(-) delete mode 100644 sunrpc/portmap.c diff --git a/ChangeLog b/ChangeLog index f13faaf0b6..fe304de5bd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,42 @@ +Sat Oct 19 17:42:24 1996 Ulrich Drepper + + * intl/locale.alias: Language for entry `czech' is `cs'. + +Fri Oct 17 13:20:35 1996 Thorsten Kukuk + + * sunrpc/etc.rpc: Update from ti-rpcsvc 2.3. + +Fri Oct 18 22:56:45 1996 Ulrich Drepper + + * sunrpc/Makefile (install-sbin): Remove portmap. This version is + buggy and more competent people work on a usable version which is + distributed separately. + * sunrpc/portmap.c: Removed. + Suggested by Thorsten Kukuk. + +Fri Oct 18 12:17:09 1996 Enrique Melero + + * sysdeps/libm-ieee754/s_finitel.c: Change function name to + `finitel'. + +Fri Oct 18 00:01:10 1996 Ulrich Drepper + + * string/Makefile (tests): Add stratcliff. + * string/stratcliff.c: New file. Test for string function at + the edge of the usable memory. + +Thu Oct 17 22:10:19 1996 Ulrich Drepper + + * Makerules ($(libdir)/libc.so): Fix typo. + + * elf/ldd.sh.in: Test whether given file really exist and give + better message if it is not available. + +Thu Oct 17 04:25:38 1996 Ulrich Drepper + + * sysdeps/unix/sysv/linux/sys/shm_buf.h: Add definition for + SHM_R and SHM_W. + Thu Oct 17 01:55:34 1996 Ulrich Drepper * sunrpc/Makefile ($(objpfx)rpcsvc/%.h, $(objpfx)x%.c): Write @@ -33,7 +72,7 @@ Thu Oct 17 00:26:20 1996 NIIBE Yutaka Wed Oct 16 12:26:53 1996 Sven Verdoolaege - * locale/progams/localedef.c (main): Test with -1 to find out + * locale/programs/localedef.c (main): Test with -1 to find out whether read failed. Wed Oct 16 14:54:59 1996 Ulrich Drepper diff --git a/Makerules b/Makerules index 3d4d4d28b8..4269e48ce4 100644 --- a/Makerules +++ b/Makerules @@ -621,7 +621,7 @@ ifndef subdir install: $(libdir)/libc.so $(libdir)/libc.so: $(common-objpfx)libc.so$(libc.so-version) \ $(elfobjdir)/$(rtld-installed-name) \ - $(libdir)lib$(libc-name).a + $(libdir)/lib$(libc-name).a (echo '/* Use the shared library, but some functions are only in';\ echo ' the static library, so try that secondarily.'; \ echo ' The dynamic linker defines some functions used by $( -#include -#include -#include -#include -#include -#include -#include - -int reg_service(); -void reap(); -struct pmaplist *pmaplist; -static int debugging = 0; - -main() -{ - SVCXPRT *xprt; - int sock, pid, t; - struct sockaddr_in addr; - int len = sizeof(struct sockaddr_in); - register struct pmaplist *pml; - -#ifndef DEBUG - pid = fork(); - if (pid < 0) { - perror("portmap: fork"); - exit(1); - } - if (pid != 0) - exit(0); - for (t = 0; t < 20; t++) - close(t); - open("/", 0); - dup2(0, 1); - dup2(0, 2); - t = open("/dev/tty", 2); - if (t >= 0) { - ioctl(t, TIOCNOTTY, (char *)0); - close(t); - } -#endif - if ((sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) { - perror(_("portmap cannot create socket")); - exit(1); - } - - addr.sin_addr.s_addr = 0; - addr.sin_family = AF_INET; - addr.sin_port = htons(PMAPPORT); - if (bind(sock, (struct sockaddr *)&addr, len) != 0) { - perror(_("portmap cannot bind")); - exit(1); - } - - if ((xprt = svcudp_create(sock)) == (SVCXPRT *)NULL) { - fprintf(stderr, _("couldn't do udp_create\n")); - exit(1); - } - /* make an entry for ourself */ - pml = (struct pmaplist *)malloc((u_int)sizeof(struct pmaplist)); - pml->pml_next = 0; - pml->pml_map.pm_prog = PMAPPROG; - pml->pml_map.pm_vers = PMAPVERS; - pml->pml_map.pm_prot = IPPROTO_UDP; - pml->pml_map.pm_port = PMAPPORT; - pmaplist = pml; - - if ((sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) { - perror(_("portmap cannot create socket")); - exit(1); - } - if (bind(sock, (struct sockaddr *)&addr, len) != 0) { - perror(_("portmap cannot bind")); - exit(1); - } - if ((xprt = svctcp_create(sock, RPCSMALLMSGSIZE, RPCSMALLMSGSIZE)) - == (SVCXPRT *)NULL) { - fprintf(stderr, _("couldn't do tcp_create\n")); - exit(1); - } - /* make an entry for ourself */ - pml = (struct pmaplist *)malloc((u_int)sizeof(struct pmaplist)); - pml->pml_map.pm_prog = PMAPPROG; - pml->pml_map.pm_vers = PMAPVERS; - pml->pml_map.pm_prot = IPPROTO_TCP; - pml->pml_map.pm_port = PMAPPORT; - pml->pml_next = pmaplist; - pmaplist = pml; - - (void)svc_register(xprt, PMAPPROG, PMAPVERS, reg_service, FALSE); - - (void)signal(SIGCHLD, reap); - svc_run(); - fprintf(stderr, _("run_svc returned unexpectedly\n")); - abort(); -} - -static struct pmaplist * -find_service(prog, vers, prot) - u_long prog; - u_long vers; -{ - register struct pmaplist *hit = NULL; - register struct pmaplist *pml; - - for (pml = pmaplist; pml != NULL; pml = pml->pml_next) { - if ((pml->pml_map.pm_prog != prog) || - (pml->pml_map.pm_prot != prot)) - continue; - hit = pml; - if (pml->pml_map.pm_vers == vers) - break; - } - return (hit); -} - -/* - * 1 OK, 0 not - */ -reg_service(rqstp, xprt) - struct svc_req *rqstp; - SVCXPRT *xprt; -{ - struct pmap reg; - struct pmaplist *pml, *prevpml, *fnd; - long ans, port; - caddr_t t; - -#ifdef DEBUG - fprintf(stderr, "server: about do a switch\n"); -#endif - switch (rqstp->rq_proc) { - - case PMAPPROC_NULL: - /* - * Null proc call - */ - if ((!svc_sendreply(xprt, xdr_void, NULL)) && debugging) { - abort(); - } - break; - - case PMAPPROC_SET: - /* - * Set a program,version to port mapping - */ - if (!svc_getargs(xprt, xdr_pmap, ®)) - svcerr_decode(xprt); - else { - /* - * check to see if already used - * find_service returns a hit even if - * the versions don't match, so check for it - */ - fnd = find_service(reg.pm_prog, reg.pm_vers, reg.pm_prot); - if (fnd && fnd->pml_map.pm_vers == reg.pm_vers) { - if (fnd->pml_map.pm_port == reg.pm_port) { - ans = 1; - goto done; - } - else { - ans = 0; - goto done; - } - } else { - /* - * add to END of list - */ - pml = (struct pmaplist *) - malloc((u_int)sizeof(struct pmaplist)); - pml->pml_map = reg; - pml->pml_next = 0; - if (pmaplist == 0) { - pmaplist = pml; - } else { - for (fnd= pmaplist; fnd->pml_next != 0; - fnd = fnd->pml_next); - fnd->pml_next = pml; - } - ans = 1; - } - done: - if ((!svc_sendreply(xprt, xdr_long, (caddr_t)&ans)) && - debugging) { - fprintf(stderr, "svc_sendreply\n"); - abort(); - } - } - break; - - case PMAPPROC_UNSET: - /* - * Remove a program,version to port mapping. - */ - if (!svc_getargs(xprt, xdr_pmap, ®)) - svcerr_decode(xprt); - else { - ans = 0; - for (prevpml = NULL, pml = pmaplist; pml != NULL; ) { - if ((pml->pml_map.pm_prog != reg.pm_prog) || - (pml->pml_map.pm_vers != reg.pm_vers)) { - /* both pml & prevpml move forwards */ - prevpml = pml; - pml = pml->pml_next; - continue; - } - /* found it; pml moves forward, prevpml stays */ - ans = 1; - t = (caddr_t)pml; - pml = pml->pml_next; - if (prevpml == NULL) - pmaplist = pml; - else - prevpml->pml_next = pml; - free(t); - } - if ((!svc_sendreply(xprt, xdr_long, (caddr_t)&ans)) && - debugging) { - fprintf(stderr, "svc_sendreply\n"); - abort(); - } - } - break; - - case PMAPPROC_GETPORT: - /* - * Lookup the mapping for a program,version and return its port - */ - if (!svc_getargs(xprt, xdr_pmap, ®)) - svcerr_decode(xprt); - else { - fnd = find_service(reg.pm_prog, reg.pm_vers, reg.pm_prot); - if (fnd) - port = fnd->pml_map.pm_port; - else - port = 0; - if ((!svc_sendreply(xprt, xdr_long, (caddr_t)&port)) && - debugging) { - fprintf(stderr, "svc_sendreply\n"); - abort(); - } - } - break; - - case PMAPPROC_DUMP: - /* - * Return the current set of mapped program,version - */ - if (!svc_getargs(xprt, xdr_void, NULL)) - svcerr_decode(xprt); - else { - if ((!svc_sendreply(xprt, xdr_pmaplist, - (caddr_t)&pmaplist)) && debugging) { - fprintf(stderr, "svc_sendreply\n"); - abort(); - } - } - break; - - case PMAPPROC_CALLIT: - /* - * Calls a procedure on the local machine. If the requested - * procedure is not registered this procedure does not return - * error information!! - * This procedure is only supported on rpc/udp and calls via - * rpc/udp. It passes null authentication parameters. - */ - callit(rqstp, xprt); - break; - - default: - svcerr_noproc(xprt); - break; - } -} - - -/* - * Stuff for the rmtcall service - */ -#define ARGSIZE 9000 - -typedef struct encap_parms { - u_long arglen; - char *args; -}; - -static bool_t -xdr_encap_parms(xdrs, epp) - XDR *xdrs; - struct encap_parms *epp; -{ - - return (xdr_bytes(xdrs, &(epp->args), &(epp->arglen), ARGSIZE)); -} - -typedef struct rmtcallargs { - u_long rmt_prog; - u_long rmt_vers; - u_long rmt_port; - u_long rmt_proc; - struct encap_parms rmt_args; -}; - -static bool_t -xdr_rmtcall_args(xdrs, cap) - register XDR *xdrs; - register struct rmtcallargs *cap; -{ - - /* does not get a port number */ - if (xdr_u_long(xdrs, &(cap->rmt_prog)) && - xdr_u_long(xdrs, &(cap->rmt_vers)) && - xdr_u_long(xdrs, &(cap->rmt_proc))) { - return (xdr_encap_parms(xdrs, &(cap->rmt_args))); - } - return (FALSE); -} - -static bool_t -xdr_rmtcall_result(xdrs, cap) - register XDR *xdrs; - register struct rmtcallargs *cap; -{ - if (xdr_u_long(xdrs, &(cap->rmt_port))) - return (xdr_encap_parms(xdrs, &(cap->rmt_args))); - return (FALSE); -} - -/* - * only worries about the struct encap_parms part of struct rmtcallargs. - * The arglen must already be set!! - */ -static bool_t -xdr_opaque_parms(xdrs, cap) - XDR *xdrs; - struct rmtcallargs *cap; -{ - - return (xdr_opaque(xdrs, cap->rmt_args.args, cap->rmt_args.arglen)); -} - -/* - * This routine finds and sets the length of incoming opaque paraters - * and then calls xdr_opaque_parms. - */ -static bool_t -xdr_len_opaque_parms(xdrs, cap) - register XDR *xdrs; - struct rmtcallargs *cap; -{ - register u_int beginpos, lowpos, highpos, currpos, pos; - - beginpos = lowpos = pos = xdr_getpos(xdrs); - highpos = lowpos + ARGSIZE; - while ((int)(highpos - lowpos) >= 0) { - currpos = (lowpos + highpos) / 2; - if (xdr_setpos(xdrs, currpos)) { - pos = currpos; - lowpos = currpos + 1; - } else { - highpos = currpos - 1; - } - } - xdr_setpos(xdrs, beginpos); - cap->rmt_args.arglen = pos - beginpos; - return (xdr_opaque_parms(xdrs, cap)); -} - -/* - * Call a remote procedure service - * This procedure is very quiet when things go wrong. - * The proc is written to support broadcast rpc. In the broadcast case, - * a machine should shut-up instead of complain, less the requestor be - * overrun with complaints at the expense of not hearing a valid reply ... - * - * This now forks so that the program & process that it calls can call - * back to the portmapper. - */ -static -callit(rqstp, xprt) - struct svc_req *rqstp; - SVCXPRT *xprt; -{ - struct rmtcallargs a; - struct pmaplist *pml; - u_short port; - struct sockaddr_in me; - int pid, socket = -1; - CLIENT *client; - struct authunix_parms *au = (struct authunix_parms *)rqstp->rq_clntcred; - struct timeval timeout; - char buf[ARGSIZE]; - - timeout.tv_sec = 5; - timeout.tv_usec = 0; - a.rmt_args.args = buf; - if (!svc_getargs(xprt, xdr_rmtcall_args, &a)) - return; - if ((pml = find_service(a.rmt_prog, a.rmt_vers, IPPROTO_UDP)) == NULL) - return; - /* - * fork a child to do the work. Parent immediately returns. - * Child exits upon completion. - */ - if ((pid = fork()) != 0) { - if (debugging && (pid < 0)) { - fprintf(stderr, _("portmap CALLIT: cannot fork.\n")); - } - return; - } - port = pml->pml_map.pm_port; - get_myaddress(&me); - me.sin_port = htons(port); - client = clntudp_create(&me, a.rmt_prog, a.rmt_vers, timeout, &socket); - if (client != (CLIENT *)NULL) { - if (rqstp->rq_cred.oa_flavor == AUTH_UNIX) { - client->cl_auth = authunix_create(au->aup_machname, - au->aup_uid, au->aup_gid, au->aup_len, au->aup_gids); - } - a.rmt_port = (u_long)port; - if (clnt_call(client, a.rmt_proc, xdr_opaque_parms, &a, - xdr_len_opaque_parms, &a, timeout) == RPC_SUCCESS) { - svc_sendreply(xprt, xdr_rmtcall_result, &a); - } - AUTH_DESTROY(client->cl_auth); - clnt_destroy(client); - } - /* (void)close(socket); clnt_destroy already closed it */ - exit(0); -} - -void -reap() -{ - while (wait3(NULL, WNOHANG, NULL) > 0); -} diff --git a/sysdeps/libm-ieee754/s_finitel.c b/sysdeps/libm-ieee754/s_finitel.c index 02487c610d..4423726645 100644 --- a/sysdeps/libm-ieee754/s_finitel.c +++ b/sysdeps/libm-ieee754/s_finitel.c @@ -27,9 +27,9 @@ static char rcsid[] = "$NetBSD: $"; #include "math_private.h" #ifdef __STDC__ - int __finite(long double x) + int __finitel(long double x) #else - int __finite(x) + int __finitel(x) long double x; #endif { diff --git a/sysdeps/unix/sysv/linux/sys/shm_buf.h b/sysdeps/unix/sysv/linux/sys/shm_buf.h index 048aa64dc2..16cc0c5bb4 100644 --- a/sysdeps/unix/sysv/linux/sys/shm_buf.h +++ b/sysdeps/unix/sysv/linux/sys/shm_buf.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1995 Free Software Foundation, Inc. +/* Copyright (C) 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , August 1995. @@ -23,6 +23,10 @@ Boston, MA 02111-1307, USA. */ #include #include +/* Permission flag for shmget. */ +#define SHM_R 0400 /* or S_IRUGO from */ +#define SHM_W 0200 /* or S_IWUGO from */ + /* Flags for `shmat'. */ #define SHM_RDONLY 010000 /* attach read-only else read-write */ #define SHM_RND 020000 /* round attach address to SHMLBA */ @@ -62,11 +66,11 @@ struct shmid_ds #define SHM_LOCKED 02000 /* segment will not be swapped */ struct shminfo { - int shmmax; - int shmmin; - int shmmni; - int shmseg; - int shmall; + int shmmax; + int shmmin; + int shmmni; + int shmseg; + int shmall; }; struct shm_info {