*
* @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@
*/
register XDR *xdrs;
register struct rpc_msg *cmsg;
{
+#ifdef __LP64__
+ int *buf;
+#else
register long *buf;
+#endif
register struct opaque_auth *oa;
if (xdrs->x_op == XDR_ENCODE) {
if (cmsg->rm_call.cb_verf.oa_length > MAX_AUTH_BYTES) {
return (FALSE);
}
+#ifdef __LP64__
+ buf = (int *)XDR_INLINE(xdrs, 8 * BYTES_PER_XDR_UNIT
+ + RNDUP(cmsg->rm_call.cb_cred.oa_length)
+ + 2 * BYTES_PER_XDR_UNIT
+ + RNDUP(cmsg->rm_call.cb_verf.oa_length));
+#else
buf = (long *)XDR_INLINE(xdrs, 8 * BYTES_PER_XDR_UNIT
- + RNDUP(cmsg->rm_call.cb_cred.oa_length)
- + 2 * BYTES_PER_XDR_UNIT
- + RNDUP(cmsg->rm_call.cb_verf.oa_length));
+ + RNDUP(cmsg->rm_call.cb_cred.oa_length)
+ + 2 * BYTES_PER_XDR_UNIT
+ + RNDUP(cmsg->rm_call.cb_verf.oa_length));
+#endif
if (buf != NULL) {
IXDR_PUT_LONG(buf, cmsg->rm_xid);
IXDR_PUT_ENUM(buf, cmsg->rm_direction);
IXDR_PUT_LONG(buf, oa->oa_length);
if (oa->oa_length) {
bcopy(oa->oa_base, (caddr_t)buf, oa->oa_length);
+#ifdef __LP64__
+ buf += RNDUP(oa->oa_length) / sizeof (int);
+#else
buf += RNDUP(oa->oa_length) / sizeof (long);
+#endif
}
oa = &cmsg->rm_call.cb_verf;
IXDR_PUT_ENUM(buf, oa->oa_flavor);
if (oa->oa_length) {
bcopy(oa->oa_base, (caddr_t)buf, oa->oa_length);
/* no real need....
+ * N.B. Fix this for __LP64__ if it is uncommented *
buf += RNDUP(oa->oa_length) / sizeof (long);
*/
}
}
}
if (xdrs->x_op == XDR_DECODE) {
+#ifdef __LP64__
+ buf = (int *)XDR_INLINE(xdrs, 8 * BYTES_PER_XDR_UNIT);
+#else
buf = (long *)XDR_INLINE(xdrs, 8 * BYTES_PER_XDR_UNIT);
+#endif
if (buf != NULL) {
cmsg->rm_xid = IXDR_GET_LONG(buf);
cmsg->rm_direction = IXDR_GET_ENUM(buf, enum msg_type);
oa->oa_base = (caddr_t)
mem_alloc(oa->oa_length);
}
+#ifdef __LP64__
+ buf = (int *)XDR_INLINE(xdrs, RNDUP(oa->oa_length));
+#else
buf = (long *)XDR_INLINE(xdrs, RNDUP(oa->oa_length));
+#endif
if (buf == NULL) {
if (xdr_opaque(xdrs, oa->oa_base,
oa->oa_length) == FALSE) {
bcopy((caddr_t)buf, oa->oa_base,
oa->oa_length);
/* no real need....
- buf += RNDUP(oa->oa_length) /
- sizeof (long);
+ * N.B. Fix this for __LP64__ if it is uncommented *
+ buf += RNDUP(oa->oa_length) / sizeof (long);
*/
}
}
oa = &cmsg->rm_call.cb_verf;
+#ifdef __LP64__
+ buf = (int *)XDR_INLINE(xdrs, 2 * BYTES_PER_XDR_UNIT);
+#else
buf = (long *)XDR_INLINE(xdrs, 2 * BYTES_PER_XDR_UNIT);
+#endif
if (buf == NULL) {
if (xdr_enum(xdrs, &oa->oa_flavor) == FALSE ||
xdr_u_int(xdrs, &oa->oa_length) == FALSE) {
oa->oa_base = (caddr_t)
mem_alloc(oa->oa_length);
}
+#ifdef __LP64__
+ buf = (int *)XDR_INLINE(xdrs, RNDUP(oa->oa_length));
+#else
buf = (long *)XDR_INLINE(xdrs, RNDUP(oa->oa_length));
+#endif
if (buf == NULL) {
if (xdr_opaque(xdrs, oa->oa_base,
oa->oa_length) == FALSE) {
bcopy((caddr_t)buf, oa->oa_base,
oa->oa_length);
/* no real need...
- buf += RNDUP(oa->oa_length) /
- sizeof (long);
+ * N.B. Fix this for __LP64__ if it is uncommented *
+ buf += RNDUP(oa->oa_length) / sizeof (long);
*/
}
}