Module Name: src Committed By: hannken Date: Tue Jun 4 08:44:08 UTC 2019
Modified Files: src/distrib/sets/lists/base: shl.mi src/distrib/sets/lists/debug: shl.mi src/include/rpc: xdr.h src/lib/libc: shlib_version src/lib/libc/rpc: xdr_mem.c Log Message: Implement xdrmem_control(), used as xdr_control(xdr, XDR_GET_BYTES_AVAIL ... and bump libc minor number. Final goal is to remove the unmaintained XDR implementation at external/cddl/osnet/dist/uts/common/rpc. To generate a diff of this commit: cvs rdiff -u -r1.864 -r1.865 src/distrib/sets/lists/base/shl.mi cvs rdiff -u -r1.223 -r1.224 src/distrib/sets/lists/debug/shl.mi cvs rdiff -u -r1.30 -r1.31 src/include/rpc/xdr.h cvs rdiff -u -r1.283 -r1.284 src/lib/libc/shlib_version cvs rdiff -u -r1.19 -r1.20 src/lib/libc/rpc/xdr_mem.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/distrib/sets/lists/base/shl.mi diff -u src/distrib/sets/lists/base/shl.mi:1.864 src/distrib/sets/lists/base/shl.mi:1.865 --- src/distrib/sets/lists/base/shl.mi:1.864 Sun Apr 28 00:03:46 2019 +++ src/distrib/sets/lists/base/shl.mi Tue Jun 4 08:44:08 2019 @@ -1,4 +1,4 @@ -# $NetBSD: shl.mi,v 1.864 2019/04/28 00:03:46 christos Exp $ +# $NetBSD: shl.mi,v 1.865 2019/06/04 08:44:08 hannken Exp $ # # Note: Don't delete entries from here - mark them as "obsolete" instead, # unless otherwise stated below. @@ -18,7 +18,7 @@ ./lib/libblacklist.so.0.0 base-sys-shlib dynamicroot ./lib/libc.so base-sys-shlib dynamicroot ./lib/libc.so.12 base-sys-shlib dynamicroot -./lib/libc.so.12.212 base-sys-shlib dynamicroot +./lib/libc.so.12.213 base-sys-shlib dynamicroot ./lib/libcrypt.so base-sys-shlib dynamicroot ./lib/libcrypt.so.1 base-sys-shlib dynamicroot ./lib/libcrypt.so.1.0 base-sys-shlib dynamicroot @@ -221,7 +221,7 @@ ./usr/lib/libc++.so.1.0 base-sys-shlib compatfile,libcxx ./usr/lib/libc.so base-sys-shlib compatfile ./usr/lib/libc.so.12 base-sys-shlib compatfile -./usr/lib/libc.so.12.212 base-sys-shlib compatfile +./usr/lib/libc.so.12.213 base-sys-shlib compatfile ./usr/lib/libcdk.so base-obsolete compatfile,obsolete ./usr/lib/libcom_err.so base-krb5-shlib compatfile,kerberos ./usr/lib/libcom_err.so.8 base-krb5-shlib compatfile,kerberos Index: src/distrib/sets/lists/debug/shl.mi diff -u src/distrib/sets/lists/debug/shl.mi:1.223 src/distrib/sets/lists/debug/shl.mi:1.224 --- src/distrib/sets/lists/debug/shl.mi:1.223 Sun Apr 28 00:03:46 2019 +++ src/distrib/sets/lists/debug/shl.mi Tue Jun 4 08:44:08 2019 @@ -1,8 +1,8 @@ -# $NetBSD: shl.mi,v 1.223 2019/04/28 00:03:46 christos Exp $ +# $NetBSD: shl.mi,v 1.224 2019/06/04 08:44:08 hannken Exp $ ./usr/lib/libbfd_g.a comp-c-debuglib debuglib,compatfile,binutils ./usr/libdata/debug/lib base-sys-usr debug,dynamicroot,compatdir ./usr/libdata/debug/lib/libblacklist.so.0.0.debug comp-sys-debug debug,dynamicroot -./usr/libdata/debug/lib/libc.so.12.212.debug comp-sys-debug debug,dynamicroot +./usr/libdata/debug/lib/libc.so.12.213.debug comp-sys-debug debug,dynamicroot ./usr/libdata/debug/lib/libcrypt.so.1.0.debug comp-sys-debug debug,dynamicroot ./usr/libdata/debug/lib/libcrypto.so.12.0.debug comp-sys-debug debug,dynamicroot,openssl=10 ./usr/libdata/debug/lib/libcrypto.so.14.0.debug comp-sys-debug debug,dynamicroot,openssl=11 @@ -71,7 +71,7 @@ ./usr/libdata/debug/usr/lib/libbsdmalloc.so.0.0.debug comp-sys-debug debug,compatfile ./usr/libdata/debug/usr/lib/libbz2.so.1.1.debug comp-sys-debug debug,compatfile ./usr/libdata/debug/usr/lib/libc++.so.1.0.debug comp-sys-debug debug,compatfile,libcxx -./usr/libdata/debug/usr/lib/libc.so.12.212.debug comp-sys-debug debug,compatfile +./usr/libdata/debug/usr/lib/libc.so.12.213.debug comp-sys-debug debug,compatfile ./usr/libdata/debug/usr/lib/libcom_err.so.8.0.debug comp-krb5-debug debug,compatfile,kerberos ./usr/libdata/debug/usr/lib/libcrypt.so.1.0.debug comp-sys-debug debug,compatfile ./usr/libdata/debug/usr/lib/libcrypto.so.12.0.debug comp-crypto-debug debug,compatfile,openssl=10 Index: src/include/rpc/xdr.h diff -u src/include/rpc/xdr.h:1.30 src/include/rpc/xdr.h:1.31 --- src/include/rpc/xdr.h:1.30 Wed Aug 16 08:35:48 2017 +++ src/include/rpc/xdr.h Tue Jun 4 08:44:08 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: xdr.h,v 1.30 2017/08/16 08:35:48 christos Exp $ */ +/* $NetBSD: xdr.h,v 1.31 2019/06/04 08:44:08 hannken Exp $ */ /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for @@ -209,8 +209,8 @@ xdr_putint32(XDR *xdrs, int32_t *ip) (*(xdrs)->x_ops->x_destroy)(xdrs) #define XDR_CONTROL(xdrs, req, op) \ - if ((xdrs)->x_ops->x_control) \ - (*(xdrs)->x_ops->x_control)(xdrs, req, op) + (((xdrs)->x_ops->x_control == NULL) ? (FALSE) : \ + (*(xdrs)->x_ops->x_control)(xdrs, req, op)) #define xdr_control(xdrs, req, op) XDR_CONTROL(xdrs, req, op) #define xdr_rpcvers(xdrs, versp) xdr_u_int32_t(xdrs, versp) @@ -326,6 +326,19 @@ typedef struct netobj netobj; extern bool_t xdr_netobj(XDR *, struct netobj *); /* + * These are XDR control operators + */ + +#define XDR_GET_BYTES_AVAIL 1 + +struct xdr_bytesrec { + bool_t xc_is_last_record; + size_t xc_num_avail; +}; + +typedef struct xdr_bytesrec xdr_bytesrec; + +/* * These are the public routines for the various implementations of * xdr streams. */ Index: src/lib/libc/shlib_version diff -u src/lib/libc/shlib_version:1.283 src/lib/libc/shlib_version:1.284 --- src/lib/libc/shlib_version:1.283 Mon Mar 4 19:20:12 2019 +++ src/lib/libc/shlib_version Tue Jun 4 08:44:08 2019 @@ -1,4 +1,4 @@ -# $NetBSD: shlib_version,v 1.283 2019/03/04 19:20:12 christos Exp $ +# $NetBSD: shlib_version,v 1.284 2019/06/04 08:44:08 hannken Exp $ # Remember to update distrib/sets/lists/base/shl.* when changing # # things we wish to do on next major version bump: @@ -54,4 +54,4 @@ # - move statfs() to libcompat since we have statvfs() # - the syscall stubs for the (obsolete) lfs syscalls should be removed major=12 -minor=212 +minor=213 Index: src/lib/libc/rpc/xdr_mem.c diff -u src/lib/libc/rpc/xdr_mem.c:1.19 src/lib/libc/rpc/xdr_mem.c:1.20 --- src/lib/libc/rpc/xdr_mem.c:1.19 Mon Mar 11 20:19:30 2013 +++ src/lib/libc/rpc/xdr_mem.c Tue Jun 4 08:44:08 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: xdr_mem.c,v 1.19 2013/03/11 20:19:30 tron Exp $ */ +/* $NetBSD: xdr_mem.c,v 1.20 2019/06/04 08:44:08 hannken Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -37,7 +37,7 @@ static char *sccsid = "@(#)xdr_mem.c 1.19 87/08/11 Copyr 1984 Sun Micro"; static char *sccsid = "@(#)xdr_mem.c 2.1 88/07/29 4.0 RPCSRC"; #else -__RCSID("$NetBSD: xdr_mem.c,v 1.19 2013/03/11 20:19:30 tron Exp $"); +__RCSID("$NetBSD: xdr_mem.c,v 1.20 2019/06/04 08:44:08 hannken Exp $"); #endif #endif @@ -79,6 +79,7 @@ static u_int xdrmem_getpos(XDR *); static bool_t xdrmem_setpos(XDR *, u_int); static int32_t *xdrmem_inline_aligned(XDR *, u_int); static int32_t *xdrmem_inline_unaligned(XDR *, u_int); +static bool_t xdrmem_control(XDR *xdrs, int request, void *info); static const struct xdr_ops xdrmem_ops_aligned = { xdrmem_getlong_aligned, @@ -89,7 +90,7 @@ static const struct xdr_ops xdrmem_ops_a xdrmem_setpos, xdrmem_inline_aligned, xdrmem_destroy, - NULL, /* xdrmem_control */ + xdrmem_control }; static const struct xdr_ops xdrmem_ops_unaligned = { @@ -101,7 +102,7 @@ static const struct xdr_ops xdrmem_ops_u xdrmem_setpos, xdrmem_inline_unaligned, xdrmem_destroy, - NULL, /* xdrmem_control */ + xdrmem_control }; /* @@ -243,3 +244,20 @@ xdrmem_inline_unaligned(XDR *xdrs, u_int return (0); } + +static bool_t +xdrmem_control(XDR *xdrs, int request, void *info) +{ + xdr_bytesrec *xptr; + + switch (request) { + + case XDR_GET_BYTES_AVAIL: + xptr = (xdr_bytesrec *)info; + xptr->xc_is_last_record = TRUE; + xptr->xc_num_avail = xdrs->x_handy; + return (TRUE); + + } + return (FALSE); +}