X-Git-Url: https://git.saurik.com/apple/libinfo.git/blobdiff_plain/ccd4a120fd72e1cd2071458320f7a1914ef55421..f64cfb2378dc3a60cd30c50180a366ec54b98781:/rpc.subproj/svc.c?ds=sidebyside diff --git a/rpc.subproj/svc.c b/rpc.subproj/svc.c index 696ffbf..9fc4c01 100644 --- a/rpc.subproj/svc.c +++ b/rpc.subproj/svc.c @@ -3,22 +3,21 @@ * * @APPLE_LICENSE_HEADER_START@ * - * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. - * - * This file contains Original Code and/or Modifications of Original Code - * as defined in and that are subject to the Apple Public Source License - * Version 2.0 (the 'License'). You may not use this file except in - * compliance with the License. Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this - * file. + * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights + * Reserved. This file contains Original Code and/or Modifications of + * Original Code as defined in and that are subject to the Apple Public + * Source License Version 1.1 (the "License"). You may not use this file + * except in compliance with the License. Please obtain a copy of the + * License at http://www.apple.com/publicsource and read it before using + * this file. * * The Original Code and all software distributed under the License are - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. - * Please see the License for the specific language governing rights and - * limitations under the License. + * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. * * @APPLE_LICENSE_HEADER_END@ */ @@ -90,8 +89,13 @@ static SVCXPRT **xports; */ static struct svc_callout { struct svc_callout *sc_next; +#ifdef __LP64__ + uint32_t sc_prog; + uint32_t sc_vers; +#else u_long sc_prog; u_long sc_vers; +#endif void (*sc_dispatch)(); } *svc_head; @@ -151,11 +155,19 @@ xprt_unregister(xprt) */ bool_t svc_register(xprt, prog, vers, dispatch, protocol) +#ifdef __LP64__ + SVCXPRT *xprt; + uint32_t prog; + uint32_t vers; + void (*dispatch)(); + int32_t protocol; +#else SVCXPRT *xprt; u_long prog; u_long vers; void (*dispatch)(); int protocol; +#endif { struct svc_callout *prev; register struct svc_callout *s; @@ -187,8 +199,13 @@ pmap_it: */ void svc_unregister(prog, vers) +#ifdef __LP64__ + uint32_t prog; + uint32_t vers; +#else u_long prog; u_long vers; +#endif { struct svc_callout *prev; register struct svc_callout *s; @@ -212,8 +229,13 @@ svc_unregister(prog, vers) */ static struct svc_callout * svc_find(prog, vers, prev) +#ifdef __LP64__ + uint32_t prog; + uint32_t vers; +#else u_long prog; u_long vers; +#endif struct svc_callout **prev; { register struct svc_callout *s, *p; @@ -348,9 +370,15 @@ svcerr_noprog(xprt) */ void svcerr_progvers(xprt, low_vers, high_vers) +#ifdef __LP64__ + register SVCXPRT *xprt; + uint32_t low_vers; + uint32_t high_vers; +#else register SVCXPRT *xprt; u_long low_vers; u_long high_vers; +#endif { struct rpc_msg rply; @@ -399,21 +427,37 @@ svc_getreqset(readfds) enum xprt_stat stat; struct rpc_msg msg; int prog_found; +#ifdef __LP64__ + uint32_t low_vers; + uint32_t high_vers; +#else u_long low_vers; u_long high_vers; +#endif struct svc_req r; register SVCXPRT *xprt; +#ifdef __LP64__ + register uint32_t mask; +#else register u_long mask; +#endif register int bit; +#ifdef __LP64__ + register uint32_t *maskp; +#else register u_long *maskp; +#endif register int sock; char cred_area[2*MAX_AUTH_BYTES + RQCRED_SIZE]; msg.rm_call.cb_cred.oa_base = cred_area; msg.rm_call.cb_verf.oa_base = &(cred_area[MAX_AUTH_BYTES]); r.rq_clntcred = &(cred_area[2*MAX_AUTH_BYTES]); - +#ifdef __LP64__ + maskp = (uint32_t *)readfds->fds_bits; +#else maskp = (u_long *)readfds->fds_bits; +#endif for (sock = 0; sock <= svc_maxfd; sock += NFDBITS) { for (mask = *maskp++; (bit = ffs(mask)); mask ^= (1 << (bit - 1))) { if ((sock + bit) > (svc_maxfd + 1))