Home | History | Annotate | only in /src/lib/libc/rpc
History log of /src/lib/libc/rpc
RevisionDateAuthorComments
 1.3 11-Mar-2013  tron Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.

This fixes PR lib/45293 by Pedro Giffuni.
 1.2 09-Jan-1998  perry branches: 1.2.70; 1.2.72; 1.2.76;
RCS Id Police.
 1.1 07-Oct-1993  cgd move the rpc code into libc
 1.2.76.1 23-Jun-2013  tls resync from head
 1.2.72.1 14-Mar-2013  riz Pull up following revision(s) (requested by tron in ticket #843):
lib/libc/rpc/clnt_dg.c: revision 1.28
lib/libc/rpc/xdr_sizeof.c: revision 1.5
lib/libc/rpc/pmap_getport.c: revision 1.19
lib/libc/rpc/xdr_mem.c: revision 1.19
lib/libc/rpc/svc_run.c: revision 1.22
lib/libc/rpc/bindresvport.c: revision 1.25
lib/libc/rpc/svc_raw.c: revision 1.24
lib/libc/rpc/svc_dg.c: revision 1.17
lib/libc/rpc/getnetconfig.c: revision 1.21
lib/libc/rpc/auth_unix.c: revision 1.25
lib/libc/rpc/svc_auth.c: revision 1.17
lib/libc/rpc/clnt_vc.c: revision 1.21
lib/libc/rpc/svc_auth_unix.c: revision 1.21
lib/libc/rpc/rpcb_st_xdr.c: revision 1.10
lib/libc/rpc/pmap_getmaps.c: revision 1.18
lib/libc/rpc/getnetpath.c: revision 1.17
lib/libc/rpc/clnt_simple.c: revision 1.32
lib/libc/rpc/authunix_prot.c: revision 1.16
lib/libc/rpc/svc_dg.h: revision 1.2
lib/libc/rpc/svc_generic.c: revision 1.15
lib/libc/rpc/clnt_raw.c: revision 1.32
lib/libc/rpc/xdr_array.c: revision 1.19
lib/libc/rpc/pmap_prot.c: revision 1.12
lib/libc/rpc/clnt_bcast.c: revision 1.26
lib/libc/rpc/xdr_rec.c: revision 1.35
lib/libc/rpc/svc.c: revision 1.34
lib/libc/rpc/DISCLAIMER: revision 1.3
lib/libc/rpc/clnt_generic.c: revision 1.30
lib/libc/rpc/xdr.c: revision 1.33
lib/libc/rpc/auth_none.c: revision 1.16
lib/libc/rpc/pmap_rmt.c: revision 1.34
lib/libc/rpc/rpc_callmsg.c: revision 1.20
lib/libc/rpc/clnt_perror.c: revision 1.30
lib/libc/rpc/xdr_stdio.c: revision 1.19
lib/libc/rpc/rpc_commondata.c: revision 1.9
lib/libc/rpc/pmap_prot2.c: revision 1.17
lib/libc/rpc/pmap_clnt.c: revision 1.19
lib/libc/rpc/svc_simple.c: revision 1.33
lib/libc/rpc/rpcb_clnt.c: revision 1.29
lib/libc/rpc/rpc_prot.c: revision 1.21
lib/libc/rpc/rpc_dtablesize.c: revision 1.16
lib/libc/rpc/rpc_generic.c: revision 1.28
lib/libc/rpc/xdr_reference.c: revision 1.18
lib/libc/rpc/rpc_soc.c: revision 1.18
lib/libc/rpc/svc_vc.c: revision 1.30
lib/libc/rpc/getrpcent.c: revision 1.23
lib/libc/rpc/xdr_float.c: revision 1.38
lib/libc/rpc/rpcb_prot.c: revision 1.11
lib/libc/rpc/getrpcport.c: revision 1.18
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.
This fixes PR lib/45293 by Pedro Giffuni.
 1.2.70.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.28 03-Jun-2023  lukem bsd.own.mk: rename GCC_NO_* to CC_WNO_*

Rename compiler-warning-disable variables from
GCC_NO_warning
to
CC_WNO_warning
where warning is the full warning name as used by the compiler.

GCC_NO_IMPLICIT_FALLTHRU is CC_WNO_IMPLICIT_FALLTHROUGH

Using the convention CC_compilerflag, where compilerflag
is based on the full compiler flag name.
 1.27 03-Oct-2020  christos Add set_rpc_maxgrouplist
 1.26 13-Oct-2019  mrg introduce some common variables for use in GCC warning disables:

GCC_NO_FORMAT_TRUNCATION -Wno-format-truncation (GCC 7/8)
GCC_NO_STRINGOP_TRUNCATION -Wno-stringop-truncation (GCC 8)
GCC_NO_STRINGOP_OVERFLOW -Wno-stringop-overflow (GCC 8)
GCC_NO_CAST_FUNCTION_TYPE -Wno-cast-function-type (GCC 8)

use these to turn off warnings for most GCC-8 complaints. many
of these are false positives, most of the real bugs are already
commited, or are yet to come.


we plan to introduce versions of (some?) of these that use the
"-Wno-error=" form, which still displays the warnings but does
not make it an error, and all of the above will be re-considered
as either being "fix me" (warning still displayed) or "warning
is wrong."
 1.25 10-Oct-2019  kre More cases to disable gcc-8 warnings only when we're using gcc>=8
 1.24 09-Oct-2019  christos Add -Wno-error for gcc-8 warnings
 1.23 06-Nov-2015  christos branches: 1.23.16;
- Provide multi-threaded fdset's for everyone not just rump if requested.
- Abstract fd_set access, and don't limit the fd_set size.
- Maintain binary compatibility by keeping the old global variables around.
 1.22 15-Apr-2015  mrg remove various HAVE_GCC=45 fragments.
 1.21 10-Aug-2012  joerg Don't depend on HAVE_GCC being always defined.
 1.20 04-Jul-2011  manu branches: 1.20.2;
Add documentation link xdr_sizeof(3) -> xdr(3)
 1.19 04-Jul-2011  manu Import xdr_sizeof() from FreeBSD
 1.18 22-Jun-2011  mrg apply some -Wno-error and/or -fno-strict-aliasing.


all of this should be looked at closer, but some of them are not
very trivial.
 1.17 25-Oct-2008  mrg branches: 1.17.4;
remove an unncessary .PATH element that doesn't exist (and never did?)
 1.16 16-Feb-2004  lukem document svcudp_create
 1.15 09-Sep-2003  itojun have __rpc_getxid.c
 1.14 03-Jun-2000  fvdl Move rpcb_prot.x to include/rpc instead.
 1.13 03-Jun-2000  fvdl Fix rpcb_prot.h target.
 1.12 02-Jun-2000  fvdl Add new RPC code, based on Sun's TI-RPC code. Adapted to not use XTI,
but sockets instead, internally. Old, backward compatible interfaces
maintained.
 1.11 26-Jan-2000  itojun branches: 1.11.2;
implement bindresvport_sa(), which is necessary for IPv6 support in certain
programs (like rshd or rlogind).

bindresvport() and bindresvport_sa() exhibits exactly the same functionality,
with different function prototype (sockaddr_in * and sockaddr *).

The behavior and prototype was discussed and agreed among shin@kame.net
(who is doing freebsd-current kame merge), deraadt@openbsd.org, and
Jean-Luc.Richier@imag.fr (INRIA IPv6/IPv6 RPC support). so it will be
portable across *bsd.
 1.10 18-Mar-1998  jtc regsterrpc.3 -> registerrpc.3
 1.9 14-Nov-1997  mrg add missing .Nm entries. from spz@serpens.swb.de.
 1.8 25-Feb-1995  cgd branches: 1.8.10;
save my sanity; stop using Id.
 1.7 22-Dec-1994  cgd specify man pages the new way.
 1.6 19-Oct-1993  cgd fixes from Thomas Eberhardt <thomas@mathematik.uni-Bremen.de> to:
(1) don't clobber the MLINKS variable in rpc
(2) install the rand48 man page in stdlib
 1.5 15-Oct-1993  jtc Change ``MAN3 = ...'' to ``MAN3 += ...'', so other manpages are built.
 1.4 07-Oct-1993  cgd move the rpc code into libc
 1.3 01-Aug-1993  mycroft Add RCS identifiers.
 1.2 16-Jun-1993  jtc include xdr_float & xdr_double with all the other rpc/xdr code in libc.a
 1.1 26-Apr-1993  deraadt cruel hack to get librpc contents into libc (for yp)
 1.8.10.1 14-Nov-1997  mrg pull up from trunk: add missing .Nm entries. from spz@serpens.swb.de.
 1.11.2.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.17.4.2 25-Oct-2008  mrg remove an unncessary .PATH element that doesn't exist (and never did?)
 1.17.4.1 25-Oct-2008  mrg file Makefile.inc was added on branch christos-time_t on 2008-10-25 19:07:27 +0000
 1.20.2.1 30-Oct-2012  yamt sync with head
 1.23.16.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.2 09-Jan-1998  perry RCS Id Police.
 1.1 07-Oct-1993  cgd move the rpc code into libc
 1.4 23-Jan-2024  christos fix nested extern warnings
 1.3 13-Sep-2003  itojun use internal names for randomid()
 1.2 09-Sep-2003  itojun use randomid(3). actually generate random ID for DNS queries (previous
fix was incomplete)
 1.1 09-Sep-2003  itojun have __rpc_getxid.c
 1.16 11-Mar-2013  tron Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.

This fixes PR lib/45293 by Pedro Giffuni.
 1.15 20-Mar-2012  matt branches: 1.15.2;
Use C89 definitions
Remove use of __P
 1.14 16-Jan-2001  lukem branches: 1.14.60; 1.14.62;
rename MAX_MARSHEL_SIZE to MAX_MARSHAL_SIZE
 1.13 22-Jan-2000  mycroft Delint.
Remove trailing ; from uses of __weak_alias(). The macro inserts this if
needed.
 1.12 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.11 20-Jan-1999  lukem * ensure memory is released if operations fail (in authunix_create(),
xdr_callmsg(), xprt_register(), svc_tcp(), svc_udp(), etc)
* don't attempt to close a socket filedescriptor if it's -1 (some from
freebsd, some i found)
* make the initial xid a little more random (from freebsd)
* fix some spelos and tyops in comments (some from freebsd)
* use warn() instead of warnx() for many errors; the user probably
wants to know what the error code was.
* knf & whitespace nitpicks
 1.10 26-Jul-1998  mycroft constify some tables.
 1.9 13-Feb-1998  lukem * in get_myaddress(); always return sockaddr_in containing localhost:PMAP_PORT.
(as recommended in Weiste Venema's portmap5_beta distribution)
* deprecate register
* use memmove instead of bcopy
* KNF includes
* use err/warn() instead of perror/fprintf(stderr,)
* fix some typos
 1.8 12-Feb-1998  lukem revert; we can't break the existing ABI and API
 1.7 11-Feb-1998  lukem use u_int32_t instead of size_t...
 1.6 10-Feb-1998  lukem major cleanup (to sync with changes made in include/rpc/*.h):
* use int32_t, size_t, in_port_t instead of long, u_int, u_short as appropriate
* use uid_t and gid_t instead of int
* KNF, fix typos and spellos
* use const as appropriate
* deprecate register
* use memmove instead of bcopy
* use err/warn()
 1.5 21-Jul-1997  jtc If port provides __weak_alias(), provide an Standard C and POSIX pure
identifier namespace by renaming non standard functions and variables
such that they have a leading underscore. The library will use those
names internally. Weak aliases are used to provide the original names
to the API.

This is only the first part of this change. It is most of the functions
which are implemented in C for all NetBSD ports. Subsequent changes are
to add the same support to the remaining C files, to assembly files, and
to the automagically generated assembly source used for system calls.
When all of the above is done, ports with weak alias support should add
a definition for __weak_alias to <sys/cdefs.h>.
 1.4 13-Jul-1997  christos Fix RCSID's
Fix gcc warnings.
Add missing prototypes
 1.3 25-Feb-1995  cgd branches: 1.3.4;
save my sanity; stop using Id.
 1.2 04-Dec-1994  cgd be much more careful with types, and add prototype everything.
 1.1 07-Oct-1993  cgd move the rpc code into libc
 1.3.4.1 16-Sep-1996  jtc snapshot namespace cleanup: rpc & xdr
 1.14.62.1 14-Mar-2013  riz Pull up following revision(s) (requested by tron in ticket #843):
lib/libc/rpc/clnt_dg.c: revision 1.28
lib/libc/rpc/xdr_sizeof.c: revision 1.5
lib/libc/rpc/pmap_getport.c: revision 1.19
lib/libc/rpc/xdr_mem.c: revision 1.19
lib/libc/rpc/svc_run.c: revision 1.22
lib/libc/rpc/bindresvport.c: revision 1.25
lib/libc/rpc/svc_raw.c: revision 1.24
lib/libc/rpc/svc_dg.c: revision 1.17
lib/libc/rpc/getnetconfig.c: revision 1.21
lib/libc/rpc/auth_unix.c: revision 1.25
lib/libc/rpc/svc_auth.c: revision 1.17
lib/libc/rpc/clnt_vc.c: revision 1.21
lib/libc/rpc/svc_auth_unix.c: revision 1.21
lib/libc/rpc/rpcb_st_xdr.c: revision 1.10
lib/libc/rpc/pmap_getmaps.c: revision 1.18
lib/libc/rpc/getnetpath.c: revision 1.17
lib/libc/rpc/clnt_simple.c: revision 1.32
lib/libc/rpc/authunix_prot.c: revision 1.16
lib/libc/rpc/svc_dg.h: revision 1.2
lib/libc/rpc/svc_generic.c: revision 1.15
lib/libc/rpc/clnt_raw.c: revision 1.32
lib/libc/rpc/xdr_array.c: revision 1.19
lib/libc/rpc/pmap_prot.c: revision 1.12
lib/libc/rpc/clnt_bcast.c: revision 1.26
lib/libc/rpc/xdr_rec.c: revision 1.35
lib/libc/rpc/svc.c: revision 1.34
lib/libc/rpc/DISCLAIMER: revision 1.3
lib/libc/rpc/clnt_generic.c: revision 1.30
lib/libc/rpc/xdr.c: revision 1.33
lib/libc/rpc/auth_none.c: revision 1.16
lib/libc/rpc/pmap_rmt.c: revision 1.34
lib/libc/rpc/rpc_callmsg.c: revision 1.20
lib/libc/rpc/clnt_perror.c: revision 1.30
lib/libc/rpc/xdr_stdio.c: revision 1.19
lib/libc/rpc/rpc_commondata.c: revision 1.9
lib/libc/rpc/pmap_prot2.c: revision 1.17
lib/libc/rpc/pmap_clnt.c: revision 1.19
lib/libc/rpc/svc_simple.c: revision 1.33
lib/libc/rpc/rpcb_clnt.c: revision 1.29
lib/libc/rpc/rpc_prot.c: revision 1.21
lib/libc/rpc/rpc_dtablesize.c: revision 1.16
lib/libc/rpc/rpc_generic.c: revision 1.28
lib/libc/rpc/xdr_reference.c: revision 1.18
lib/libc/rpc/rpc_soc.c: revision 1.18
lib/libc/rpc/svc_vc.c: revision 1.30
lib/libc/rpc/getrpcent.c: revision 1.23
lib/libc/rpc/xdr_float.c: revision 1.38
lib/libc/rpc/rpcb_prot.c: revision 1.11
lib/libc/rpc/getrpcport.c: revision 1.18
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.
This fixes PR lib/45293 by Pedro Giffuni.
 1.14.60.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.14.60.1 17-Apr-2012  yamt sync with head
 1.15.2.1 23-Jun-2013  tls resync from head
 1.28 23-Jan-2024  christos fix nested extern warnings
 1.27 03-Oct-2020  christos Add set_rpc_maxgrouplist
 1.26 18-Oct-2014  snj src is too big these days to tolerate superfluous apostrophes. It's
"its", people!
 1.25 11-Mar-2013  tron Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.

This fixes PR lib/45293 by Pedro Giffuni.
 1.24 04-Mar-2013  christos fix error messages and warnings.
 1.23 20-Mar-2012  matt branches: 1.23.2;
Use C89 definitions
Remove use of __P
 1.22 11-Jan-2009  christos branches: 1.22.8; 1.22.10;
merge christos-time_t
 1.21 25-Apr-2008  christos branches: 1.21.8;
- always check malloc results
- don't leak fds on error
- don't cast malloc
- don't cast NULL
 1.20 11-Feb-2005  simonb branches: 1.20.24;
White space nit- don't put a space before/after increment/decrement
operators.
 1.19 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.18 06-Jul-2000  christos branches: 1.18.2;
remove unnecessary casts to NULL
 1.17 02-Jun-2000  fvdl Add new RPC code, based on Sun's TI-RPC code. Adapted to not use XTI,
but sockets instead, internally. Old, backward compatible interfaces
maintained.
 1.16 22-Jan-2000  mycroft branches: 1.16.2;
Delint.
Remove trailing ; from uses of __weak_alias(). The macro inserts this if
needed.
 1.15 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.14 20-Jan-1999  lukem * ensure memory is released if operations fail (in authunix_create(),
xdr_callmsg(), xprt_register(), svc_tcp(), svc_udp(), etc)
* don't attempt to close a socket filedescriptor if it's -1 (some from
freebsd, some i found)
* make the initial xid a little more random (from freebsd)
* fix some spelos and tyops in comments (some from freebsd)
* use warn() instead of warnx() for many errors; the user probably
wants to know what the error code was.
* knf & whitespace nitpicks
 1.13 15-Nov-1998  christos int -> uid_t, gid_t
 1.12 26-Jul-1998  mycroft constify some tables.
 1.11 06-Jul-1998  mrg - use an array MAXHOSTNAMELEN+1 size to hold hostnames
- ensure hostname from gethostname() is nul-terminated in all cases
- minor KNF
- use MAXHOSTNAMELEN over various other values/defines
- be safe will buffers that hold hostnames
 1.10 13-Feb-1998  lukem * in get_myaddress(); always return sockaddr_in containing localhost:PMAP_PORT.
(as recommended in Weiste Venema's portmap5_beta distribution)
* deprecate register
* use memmove instead of bcopy
* KNF includes
* use err/warn() instead of perror/fprintf(stderr,)
* fix some typos
 1.9 12-Feb-1998  lukem revert; we can't break the existing ABI and API
 1.8 11-Feb-1998  lukem use u_int32_t instead of size_t...
 1.7 10-Feb-1998  lukem major cleanup (to sync with changes made in include/rpc/*.h):
* use int32_t, size_t, in_port_t instead of long, u_int, u_short as appropriate
* use uid_t and gid_t instead of int
* KNF, fix typos and spellos
* use const as appropriate
* deprecate register
* use memmove instead of bcopy
* use err/warn()
 1.6 21-Jul-1997  jtc If port provides __weak_alias(), provide an Standard C and POSIX pure
identifier namespace by renaming non standard functions and variables
such that they have a leading underscore. The library will use those
names internally. Weak aliases are used to provide the original names
to the API.

This is only the first part of this change. It is most of the functions
which are implemented in C for all NetBSD ports. Subsequent changes are
to add the same support to the remaining C files, to assembly files, and
to the automagically generated assembly source used for system calls.
When all of the above is done, ports with weak alias support should add
a definition for __weak_alias to <sys/cdefs.h>.
 1.5 13-Jul-1997  christos Fix incorrect arguments in authunix_validate
Add prototypes
Fix gcc warnings
Fix RCSID's
 1.4 20-Dec-1996  cgd pull in unistd.h for prototypes
 1.3 29-Mar-1996  jtc branches: 1.3.2;
Add explict function return types
 1.2 25-Feb-1995  cgd save my sanity; stop using Id.
 1.1 07-Oct-1993  cgd branches: 1.1.4;
move the rpc code into libc
 1.1.4.1 02-May-1995  jtc #include "namespace.h"
 1.3.2.1 16-Sep-1996  jtc snapshot namespace cleanup: rpc & xdr
 1.16.2.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.18.2.1 08-Aug-2001  nathanw Convert to our threading style.
__REENT -> _REENTRANT
Statically initialize mutexes.
Use pthread thread-specific data semantics and once_t instead of Sun thread
semantics.
Use __isthreaded to detect presence of thread universe instead of _thr_main().
 1.20.24.1 18-May-2008  yamt sync with head.
 1.21.8.2 08-Nov-2008  christos time_t changes
 1.21.8.1 25-Apr-2008  christos file auth_unix.c was added on branch christos-time_t on 2008-11-08 21:45:38 +0000
 1.22.10.1 14-Mar-2013  riz Pull up following revision(s) (requested by tron in ticket #843):
lib/libc/rpc/clnt_dg.c: revision 1.28
lib/libc/rpc/xdr_sizeof.c: revision 1.5
lib/libc/rpc/pmap_getport.c: revision 1.19
lib/libc/rpc/xdr_mem.c: revision 1.19
lib/libc/rpc/svc_run.c: revision 1.22
lib/libc/rpc/bindresvport.c: revision 1.25
lib/libc/rpc/svc_raw.c: revision 1.24
lib/libc/rpc/svc_dg.c: revision 1.17
lib/libc/rpc/getnetconfig.c: revision 1.21
lib/libc/rpc/auth_unix.c: revision 1.25
lib/libc/rpc/svc_auth.c: revision 1.17
lib/libc/rpc/clnt_vc.c: revision 1.21
lib/libc/rpc/svc_auth_unix.c: revision 1.21
lib/libc/rpc/rpcb_st_xdr.c: revision 1.10
lib/libc/rpc/pmap_getmaps.c: revision 1.18
lib/libc/rpc/getnetpath.c: revision 1.17
lib/libc/rpc/clnt_simple.c: revision 1.32
lib/libc/rpc/authunix_prot.c: revision 1.16
lib/libc/rpc/svc_dg.h: revision 1.2
lib/libc/rpc/svc_generic.c: revision 1.15
lib/libc/rpc/clnt_raw.c: revision 1.32
lib/libc/rpc/xdr_array.c: revision 1.19
lib/libc/rpc/pmap_prot.c: revision 1.12
lib/libc/rpc/clnt_bcast.c: revision 1.26
lib/libc/rpc/xdr_rec.c: revision 1.35
lib/libc/rpc/svc.c: revision 1.34
lib/libc/rpc/DISCLAIMER: revision 1.3
lib/libc/rpc/clnt_generic.c: revision 1.30
lib/libc/rpc/xdr.c: revision 1.33
lib/libc/rpc/auth_none.c: revision 1.16
lib/libc/rpc/pmap_rmt.c: revision 1.34
lib/libc/rpc/rpc_callmsg.c: revision 1.20
lib/libc/rpc/clnt_perror.c: revision 1.30
lib/libc/rpc/xdr_stdio.c: revision 1.19
lib/libc/rpc/rpc_commondata.c: revision 1.9
lib/libc/rpc/pmap_prot2.c: revision 1.17
lib/libc/rpc/pmap_clnt.c: revision 1.19
lib/libc/rpc/svc_simple.c: revision 1.33
lib/libc/rpc/rpcb_clnt.c: revision 1.29
lib/libc/rpc/rpc_prot.c: revision 1.21
lib/libc/rpc/rpc_dtablesize.c: revision 1.16
lib/libc/rpc/rpc_generic.c: revision 1.28
lib/libc/rpc/xdr_reference.c: revision 1.18
lib/libc/rpc/rpc_soc.c: revision 1.18
lib/libc/rpc/svc_vc.c: revision 1.30
lib/libc/rpc/getrpcent.c: revision 1.23
lib/libc/rpc/xdr_float.c: revision 1.38
lib/libc/rpc/rpcb_prot.c: revision 1.11
lib/libc/rpc/getrpcport.c: revision 1.18
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.
This fixes PR lib/45293 by Pedro Giffuni.
 1.22.8.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.22.8.1 17-Apr-2012  yamt sync with head
 1.23.2.1 23-Jun-2013  tls resync from head
 1.16 11-Mar-2013  tron Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.

This fixes PR lib/45293 by Pedro Giffuni.
 1.15 20-Mar-2012  matt branches: 1.15.2;
Use C89 definitions
Remove use of __P
 1.14 13-Mar-2012  christos PR/45989: Martin Husemann: lint invocation does include -w only on i386

- turn lint -w for all the platforms after fixing the lint warnings.
- add _DIAGASSERTS() for casts that would assign values to types that
would not fit.
- change types, add casts
- change into ansii prototypes
- turn on _DIAGNOSTIC for libc (during current, to be eliminated for release
builds)

approved by core@
 1.13 11-May-2006  mrg branches: 1.13.44; 1.13.46;
xdr sucks. sprinkle some (void *) casts into it's functions taking void **,
and shut up GCC4.
 1.12 22-Jan-2000  mycroft Delint.
Remove trailing ; from uses of __weak_alias(). The macro inserts this if
needed.
 1.11 20-Sep-1999  lukem back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.10 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.9 31-Jan-1999  christos xdrproc_t casts.
 1.8 20-Jan-1999  lukem * ensure memory is released if operations fail (in authunix_create(),
xdr_callmsg(), xprt_register(), svc_tcp(), svc_udp(), etc)
* don't attempt to close a socket filedescriptor if it's -1 (some from
freebsd, some i found)
* make the initial xid a little more random (from freebsd)
* fix some spelos and tyops in comments (some from freebsd)
* use warn() instead of warnx() for many errors; the user probably
wants to know what the error code was.
* knf & whitespace nitpicks
 1.7 13-Feb-1998  lukem * in get_myaddress(); always return sockaddr_in containing localhost:PMAP_PORT.
(as recommended in Weiste Venema's portmap5_beta distribution)
* deprecate register
* use memmove instead of bcopy
* KNF includes
* use err/warn() instead of perror/fprintf(stderr,)
* fix some typos
 1.6 12-Feb-1998  lukem revert; we can't break the existing ABI and API
 1.5 10-Feb-1998  lukem major cleanup (to sync with changes made in include/rpc/*.h):
* use int32_t, size_t, in_port_t instead of long, u_int, u_short as appropriate
* use uid_t and gid_t instead of int
* KNF, fix typos and spellos
* use const as appropriate
* deprecate register
* use memmove instead of bcopy
* use err/warn()
 1.4 21-Jul-1997  jtc If port provides __weak_alias(), provide an Standard C and POSIX pure
identifier namespace by renaming non standard functions and variables
such that they have a leading underscore. The library will use those
names internally. Weak aliases are used to provide the original names
to the API.

This is only the first part of this change. It is most of the functions
which are implemented in C for all NetBSD ports. Subsequent changes are
to add the same support to the remaining C files, to assembly files, and
to the automagically generated assembly source used for system calls.
When all of the above is done, ports with weak alias support should add
a definition for __weak_alias to <sys/cdefs.h>.
 1.3 13-Jul-1997  christos Fix RCSID's
Fix gcc warnings.
Add missing prototypes
 1.2 25-Feb-1995  cgd branches: 1.2.4;
save my sanity; stop using Id.
 1.1 07-Oct-1993  cgd move the rpc code into libc
 1.2.4.1 16-Sep-1996  jtc snapshot namespace cleanup: rpc & xdr
 1.13.46.1 14-Mar-2013  riz Pull up following revision(s) (requested by tron in ticket #843):
lib/libc/rpc/clnt_dg.c: revision 1.28
lib/libc/rpc/xdr_sizeof.c: revision 1.5
lib/libc/rpc/pmap_getport.c: revision 1.19
lib/libc/rpc/xdr_mem.c: revision 1.19
lib/libc/rpc/svc_run.c: revision 1.22
lib/libc/rpc/bindresvport.c: revision 1.25
lib/libc/rpc/svc_raw.c: revision 1.24
lib/libc/rpc/svc_dg.c: revision 1.17
lib/libc/rpc/getnetconfig.c: revision 1.21
lib/libc/rpc/auth_unix.c: revision 1.25
lib/libc/rpc/svc_auth.c: revision 1.17
lib/libc/rpc/clnt_vc.c: revision 1.21
lib/libc/rpc/svc_auth_unix.c: revision 1.21
lib/libc/rpc/rpcb_st_xdr.c: revision 1.10
lib/libc/rpc/pmap_getmaps.c: revision 1.18
lib/libc/rpc/getnetpath.c: revision 1.17
lib/libc/rpc/clnt_simple.c: revision 1.32
lib/libc/rpc/authunix_prot.c: revision 1.16
lib/libc/rpc/svc_dg.h: revision 1.2
lib/libc/rpc/svc_generic.c: revision 1.15
lib/libc/rpc/clnt_raw.c: revision 1.32
lib/libc/rpc/xdr_array.c: revision 1.19
lib/libc/rpc/pmap_prot.c: revision 1.12
lib/libc/rpc/clnt_bcast.c: revision 1.26
lib/libc/rpc/xdr_rec.c: revision 1.35
lib/libc/rpc/svc.c: revision 1.34
lib/libc/rpc/DISCLAIMER: revision 1.3
lib/libc/rpc/clnt_generic.c: revision 1.30
lib/libc/rpc/xdr.c: revision 1.33
lib/libc/rpc/auth_none.c: revision 1.16
lib/libc/rpc/pmap_rmt.c: revision 1.34
lib/libc/rpc/rpc_callmsg.c: revision 1.20
lib/libc/rpc/clnt_perror.c: revision 1.30
lib/libc/rpc/xdr_stdio.c: revision 1.19
lib/libc/rpc/rpc_commondata.c: revision 1.9
lib/libc/rpc/pmap_prot2.c: revision 1.17
lib/libc/rpc/pmap_clnt.c: revision 1.19
lib/libc/rpc/svc_simple.c: revision 1.33
lib/libc/rpc/rpcb_clnt.c: revision 1.29
lib/libc/rpc/rpc_prot.c: revision 1.21
lib/libc/rpc/rpc_dtablesize.c: revision 1.16
lib/libc/rpc/rpc_generic.c: revision 1.28
lib/libc/rpc/xdr_reference.c: revision 1.18
lib/libc/rpc/rpc_soc.c: revision 1.18
lib/libc/rpc/svc_vc.c: revision 1.30
lib/libc/rpc/getrpcent.c: revision 1.23
lib/libc/rpc/xdr_float.c: revision 1.38
lib/libc/rpc/rpcb_prot.c: revision 1.11
lib/libc/rpc/getrpcport.c: revision 1.18
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.
This fixes PR lib/45293 by Pedro Giffuni.
 1.13.44.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.13.44.1 17-Apr-2012  yamt sync with head
 1.15.2.1 23-Jun-2013  tls resync from head
 1.14 03-Jul-2017  wiz Remove workaround for ancient HTML generation code.
 1.13 27-Jan-2007  cbiere * Don't use the term "anonymous"; this is confusing.
* Mention "reserved", that's what it's stands for after all.
* Mention getsockname() to determine the assigned port in any case.
 1.12 16-Apr-2003  wiz Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
 1.11 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.10 07-Feb-2002  ross Generate <>& symbolically.
 1.9 16-Sep-2001  wiz Boring whitespace fixes.
 1.8 05-Jul-2000  msaitoh branches: 1.8.2;
remove extra period in SEE ALL section
 1.7 26-Jan-2000  itojun implement bindresvport_sa(), which is necessary for IPv6 support in certain
programs (like rshd or rlogind).

bindresvport() and bindresvport_sa() exhibits exactly the same functionality,
with different function prototype (sockaddr_in * and sockaddr *).

The behavior and prototype was discussed and agreed among shin@kame.net
(who is doing freebsd-current kame merge), deraadt@openbsd.org, and
Jean-Luc.Richier@imag.fr (INRIA IPv6/IPv6 RPC support). so it will be
portable across *bsd.
 1.6 26-Jan-2000  itojun fix include file. bindresvport() is declared in rpc/rpc.h, not netinet/in.h.
 1.5 05-Feb-1998  perry add LIBRARY section to man page
 1.4 14-Jan-1998  lukem * use setsockopt(IP_PORTRANGE_LOW) instead of looping through the
address range (from freebsd).
* enhance the man page to be a bit more useful.
 1.3 01-Jul-1997  mikel add missing #; noted by Todd Miller
 1.2 25-Feb-1995  cgd save my sanity; stop using Id.
 1.1 07-Oct-1993  cgd move the rpc code into libc
 1.8.2.3 22-Mar-2002  nathanw Catch up to -current.
 1.8.2.2 08-Mar-2002  nathanw Catch up to -current.
 1.8.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.25 11-Mar-2013  tron Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.

This fixes PR lib/45293 by Pedro Giffuni.
 1.24 05-Mar-2013  christos make this usable from RUMP
 1.23 20-Mar-2012  matt branches: 1.23.2;
Use C89 definitions
Remove use of __P
 1.22 13-Mar-2012  christos PR/45989: Martin Husemann: lint invocation does include -w only on i386

- turn lint -w for all the platforms after fixing the lint warnings.
- add _DIAGASSERTS() for casts that would assign values to types that
would not fit.
- change types, add casts
- change into ansii prototypes
- turn on _DIAGNOSTIC for libc (during current, to be eliminated for release
builds)

approved by core@
 1.21 18-Jan-2003  thorpej branches: 1.21.56; 1.21.58;
Merge the nathanw_sa branch.
 1.20 04-Nov-2001  lukem fix WARNS=2 (-Wshadow) warnings
 1.19 06-Jul-2000  christos branches: 1.19.2;
elide non-portable casts
 1.18 02-Jun-2000  fvdl Add new RPC code, based on Sun's TI-RPC code. Adapted to not use XTI,
but sockets instead, internally. Old, backward compatible interfaces
maintained.
 1.17 26-Jan-2000  itojun branches: 1.17.2;
implement bindresvport_sa(), which is necessary for IPv6 support in certain
programs (like rshd or rlogind).

bindresvport() and bindresvport_sa() exhibits exactly the same functionality,
with different function prototype (sockaddr_in * and sockaddr *).

The behavior and prototype was discussed and agreed among shin@kame.net
(who is doing freebsd-current kame merge), deraadt@openbsd.org, and
Jean-Luc.Richier@imag.fr (INRIA IPv6/IPv6 RPC support). so it will be
portable across *bsd.
 1.16 22-Jan-2000  mycroft Delint.
Remove trailing ; from uses of __weak_alias(). The macro inserts this if
needed.
 1.15 03-May-1999  christos int -> socklen_t
 1.14 20-Jan-1999  lukem * ensure memory is released if operations fail (in authunix_create(),
xdr_callmsg(), xprt_register(), svc_tcp(), svc_udp(), etc)
* don't attempt to close a socket filedescriptor if it's -1 (some from
freebsd, some i found)
* make the initial xid a little more random (from freebsd)
* fix some spelos and tyops in comments (some from freebsd)
* use warn() instead of warnx() for many errors; the user probably
wants to know what the error code was.
* knf & whitespace nitpicks
 1.13 15-Nov-1998  christos delint
 1.12 13-Feb-1998  lukem * in get_myaddress(); always return sockaddr_in containing localhost:PMAP_PORT.
(as recommended in Weiste Venema's portmap5_beta distribution)
* deprecate register
* use memmove instead of bcopy
* KNF includes
* use err/warn() instead of perror/fprintf(stderr,)
* fix some typos
 1.11 12-Feb-1998  lukem revert; we can't break the existing ABI and API
 1.10 10-Feb-1998  lukem major cleanup (to sync with changes made in include/rpc/*.h):
* use int32_t, size_t, in_port_t instead of long, u_int, u_short as appropriate
* use uid_t and gid_t instead of int
* KNF, fix typos and spellos
* use const as appropriate
* deprecate register
* use memmove instead of bcopy
* use err/warn()
 1.9 14-Jan-1998  lukem * use setsockopt(IP_PORTRANGE_LOW) instead of looping through the
address range (from freebsd).
* enhance the man page to be a bit more useful.
 1.8 21-Jul-1997  jtc If port provides __weak_alias(), provide an Standard C and POSIX pure
identifier namespace by renaming non standard functions and variables
such that they have a leading underscore. The library will use those
names internally. Weak aliases are used to provide the original names
to the API.

This is only the first part of this change. It is most of the functions
which are implemented in C for all NetBSD ports. Subsequent changes are
to add the same support to the remaining C files, to assembly files, and
to the automagically generated assembly source used for system calls.
When all of the above is done, ports with weak alias support should add
a definition for __weak_alias to <sys/cdefs.h>.
 1.7 13-Jul-1997  christos Fix RCSID's
Fix gcc warnings.
Add missing prototypes
 1.6 29-Mar-1996  jtc branches: 1.6.2;
Add explict function return types
 1.5 03-Jun-1995  mycroft Fill in sin_len.
 1.4 14-Apr-1995  jtc Changed bzero to memset.
Changed bcmp to memcmp.
Added #include <string.h> to bring prototypes into scope.
 1.3 25-Feb-1995  cgd save my sanity; stop using Id.
 1.2 04-Dec-1994  cgd branches: 1.2.2;
be much more careful with types, and add prototype everything.
 1.1 07-Oct-1993  cgd move the rpc code into libc
 1.2.2.1 02-May-1995  jtc #include "namespace.h"
 1.6.2.1 16-Sep-1996  jtc snapshot namespace cleanup: rpc & xdr
 1.17.2.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.19.2.1 14-Nov-2001  nathanw Catch up to -current.
 1.21.58.1 14-Mar-2013  riz Pull up following revision(s) (requested by tron in ticket #843):
lib/libc/rpc/clnt_dg.c: revision 1.28
lib/libc/rpc/xdr_sizeof.c: revision 1.5
lib/libc/rpc/pmap_getport.c: revision 1.19
lib/libc/rpc/xdr_mem.c: revision 1.19
lib/libc/rpc/svc_run.c: revision 1.22
lib/libc/rpc/bindresvport.c: revision 1.25
lib/libc/rpc/svc_raw.c: revision 1.24
lib/libc/rpc/svc_dg.c: revision 1.17
lib/libc/rpc/getnetconfig.c: revision 1.21
lib/libc/rpc/auth_unix.c: revision 1.25
lib/libc/rpc/svc_auth.c: revision 1.17
lib/libc/rpc/clnt_vc.c: revision 1.21
lib/libc/rpc/svc_auth_unix.c: revision 1.21
lib/libc/rpc/rpcb_st_xdr.c: revision 1.10
lib/libc/rpc/pmap_getmaps.c: revision 1.18
lib/libc/rpc/getnetpath.c: revision 1.17
lib/libc/rpc/clnt_simple.c: revision 1.32
lib/libc/rpc/authunix_prot.c: revision 1.16
lib/libc/rpc/svc_dg.h: revision 1.2
lib/libc/rpc/svc_generic.c: revision 1.15
lib/libc/rpc/clnt_raw.c: revision 1.32
lib/libc/rpc/xdr_array.c: revision 1.19
lib/libc/rpc/pmap_prot.c: revision 1.12
lib/libc/rpc/clnt_bcast.c: revision 1.26
lib/libc/rpc/xdr_rec.c: revision 1.35
lib/libc/rpc/svc.c: revision 1.34
lib/libc/rpc/DISCLAIMER: revision 1.3
lib/libc/rpc/clnt_generic.c: revision 1.30
lib/libc/rpc/xdr.c: revision 1.33
lib/libc/rpc/auth_none.c: revision 1.16
lib/libc/rpc/pmap_rmt.c: revision 1.34
lib/libc/rpc/rpc_callmsg.c: revision 1.20
lib/libc/rpc/clnt_perror.c: revision 1.30
lib/libc/rpc/xdr_stdio.c: revision 1.19
lib/libc/rpc/rpc_commondata.c: revision 1.9
lib/libc/rpc/pmap_prot2.c: revision 1.17
lib/libc/rpc/pmap_clnt.c: revision 1.19
lib/libc/rpc/svc_simple.c: revision 1.33
lib/libc/rpc/rpcb_clnt.c: revision 1.29
lib/libc/rpc/rpc_prot.c: revision 1.21
lib/libc/rpc/rpc_dtablesize.c: revision 1.16
lib/libc/rpc/rpc_generic.c: revision 1.28
lib/libc/rpc/xdr_reference.c: revision 1.18
lib/libc/rpc/rpc_soc.c: revision 1.18
lib/libc/rpc/svc_vc.c: revision 1.30
lib/libc/rpc/getrpcent.c: revision 1.23
lib/libc/rpc/xdr_float.c: revision 1.38
lib/libc/rpc/rpcb_prot.c: revision 1.11
lib/libc/rpc/getrpcport.c: revision 1.18
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.
This fixes PR lib/45293 by Pedro Giffuni.
 1.21.56.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.21.56.1 17-Apr-2012  yamt sync with head
 1.23.2.1 23-Jun-2013  tls resync from head
 1.27 23-Jan-2024  christos fix nested extern warnings
 1.26 11-Mar-2013  tron Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.

This fixes PR lib/45293 by Pedro Giffuni.
 1.25 05-Mar-2013  christos make this usable from RUMP
 1.24 20-Mar-2012  matt branches: 1.24.2;
Use C89 definitions
Remove use of __P
 1.23 13-Mar-2012  christos PR/45989: Martin Husemann: lint invocation does include -w only on i386

- turn lint -w for all the platforms after fixing the lint warnings.
- add _DIAGASSERTS() for casts that would assign values to types that
would not fit.
- change types, add casts
- change into ansii prototypes
- turn on _DIAGNOSTIC for libc (during current, to be eliminated for release
builds)

approved by core@
 1.22 07-Mar-2010  dholland branches: 1.22.6; 1.22.8;
indentation/whitespace
 1.21 07-Mar-2010  dholland remove stray semicolon
 1.20 12-Feb-2009  lukem sign-compare fixes
 1.19 25-Apr-2008  christos branches: 1.19.8; 1.19.10;
- always check malloc results
- don't leak fds on error
- don't cast malloc
- don't cast NULL
 1.18 03-Nov-2006  christos branches: 1.18.16;
nuke useless perror
 1.17 18-May-2006  christos Coverity CID 3651: Don't leak ifaddrs on getaddrinfo failure.
 1.16 19-Mar-2006  christos Coverity CID 2283: Don't leak sys_auth on error.
 1.15 03-Dec-2005  yamt - constify and remove __UNCONST from caller of clnt_call().
- use __UNCONST where approproate.
 1.14 09-Sep-2005  christos Convert the rest of the code to use pollts for consistency. XXX: We should
really use kqueue.
 1.13 01-Jun-2005  lukem appease gcc -Wuninitialized
 1.12 09-Sep-2003  itojun __RCSID police
 1.11 09-Sep-2003  itojun use niels provos' random sequence number generator to initialize RPC XID.
 1.10 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.9 08-Nov-2002  fvdl * Adapt include files for rpc_com.h/rpc_internal.h split.
* Add rpc_control to svc.c
* Implement non-blocking connections.
 1.8 23-Sep-2002  mycroft Make this work in the !INET6 case -- if we mismatch the AF, don't return a
bogus (uninitialized) structure.
Also, ignore v4 ifa's with no broadcast address (rather than core dumping).
 1.7 04-Nov-2001  lukem branches: 1.7.2;
fix WARNS=2 (-Wshadow) warnings
 1.6 28-Sep-2001  yamt check pmap_flag before sendto.
 1.5 08-May-2001  lukem missing space in a warning
 1.4 04-Jan-2001  lukem branches: 1.4.2;
sprinkle _DIAGASSERT() appropriately. minor other cleanups
 1.3 06-Jul-2000  christos get prototypes from rpc/nettype.h
avoid non-portable casts
add explicit casts
 1.2 03-Jun-2000  fvdl branches: 1.2.4;
include <string.h> for mem* prototypes.
 1.1 02-Jun-2000  fvdl Add new RPC code, based on Sun's TI-RPC code. Adapted to not use XTI,
but sockets instead, internally. Old, backward compatible interfaces
maintained.
 1.2.4.2 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.2.4.1 03-Jun-2000  minoura file clnt_bcast.c was added on branch minoura-xpg4dl on 2000-06-23 16:17:40 +0000
 1.4.2.4 11-Nov-2002  nathanw Catch up to -current
 1.4.2.3 18-Oct-2002  nathanw Catch up to -current.
 1.4.2.2 14-Nov-2001  nathanw Catch up to -current.
 1.4.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.7.2.1 06-Jan-2003  jmc Pull up revisions 1.8-1.9 (requested by fvdl in ticket #1037)
* Adapt include files for rpc_com.h/rpc_internal.h split.
* Implement non-blocking connections.
* Add rpc_control to svc.c
 1.18.16.1 18-May-2008  yamt sync with head.
 1.19.10.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.19.8.2 25-Apr-2008  christos - always check malloc results
- don't leak fds on error
- don't cast malloc
- don't cast NULL
 1.19.8.1 25-Apr-2008  christos file clnt_bcast.c was added on branch christos-time_t on 2008-04-25 17:44:45 +0000
 1.22.8.1 14-Mar-2013  riz Pull up following revision(s) (requested by tron in ticket #843):
lib/libc/rpc/clnt_dg.c: revision 1.28
lib/libc/rpc/xdr_sizeof.c: revision 1.5
lib/libc/rpc/pmap_getport.c: revision 1.19
lib/libc/rpc/xdr_mem.c: revision 1.19
lib/libc/rpc/svc_run.c: revision 1.22
lib/libc/rpc/bindresvport.c: revision 1.25
lib/libc/rpc/svc_raw.c: revision 1.24
lib/libc/rpc/svc_dg.c: revision 1.17
lib/libc/rpc/getnetconfig.c: revision 1.21
lib/libc/rpc/auth_unix.c: revision 1.25
lib/libc/rpc/svc_auth.c: revision 1.17
lib/libc/rpc/clnt_vc.c: revision 1.21
lib/libc/rpc/svc_auth_unix.c: revision 1.21
lib/libc/rpc/rpcb_st_xdr.c: revision 1.10
lib/libc/rpc/pmap_getmaps.c: revision 1.18
lib/libc/rpc/getnetpath.c: revision 1.17
lib/libc/rpc/clnt_simple.c: revision 1.32
lib/libc/rpc/authunix_prot.c: revision 1.16
lib/libc/rpc/svc_dg.h: revision 1.2
lib/libc/rpc/svc_generic.c: revision 1.15
lib/libc/rpc/clnt_raw.c: revision 1.32
lib/libc/rpc/xdr_array.c: revision 1.19
lib/libc/rpc/pmap_prot.c: revision 1.12
lib/libc/rpc/clnt_bcast.c: revision 1.26
lib/libc/rpc/xdr_rec.c: revision 1.35
lib/libc/rpc/svc.c: revision 1.34
lib/libc/rpc/DISCLAIMER: revision 1.3
lib/libc/rpc/clnt_generic.c: revision 1.30
lib/libc/rpc/xdr.c: revision 1.33
lib/libc/rpc/auth_none.c: revision 1.16
lib/libc/rpc/pmap_rmt.c: revision 1.34
lib/libc/rpc/rpc_callmsg.c: revision 1.20
lib/libc/rpc/clnt_perror.c: revision 1.30
lib/libc/rpc/xdr_stdio.c: revision 1.19
lib/libc/rpc/rpc_commondata.c: revision 1.9
lib/libc/rpc/pmap_prot2.c: revision 1.17
lib/libc/rpc/pmap_clnt.c: revision 1.19
lib/libc/rpc/svc_simple.c: revision 1.33
lib/libc/rpc/rpcb_clnt.c: revision 1.29
lib/libc/rpc/rpc_prot.c: revision 1.21
lib/libc/rpc/rpc_dtablesize.c: revision 1.16
lib/libc/rpc/rpc_generic.c: revision 1.28
lib/libc/rpc/xdr_reference.c: revision 1.18
lib/libc/rpc/rpc_soc.c: revision 1.18
lib/libc/rpc/svc_vc.c: revision 1.30
lib/libc/rpc/getrpcent.c: revision 1.23
lib/libc/rpc/xdr_float.c: revision 1.38
lib/libc/rpc/rpcb_prot.c: revision 1.11
lib/libc/rpc/getrpcport.c: revision 1.18
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.
This fixes PR lib/45293 by Pedro Giffuni.
 1.22.6.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.22.6.1 17-Apr-2012  yamt sync with head
 1.24.2.1 23-Jun-2013  tls resync from head
 1.33 23-Jan-2024  christos fix nested extern warnings
 1.32 24-Jan-2022  andvar s/begining/beginning/ in comments and messages.
 1.31 05-Dec-2021  msaitoh s/succesful/successful/ in comment.
 1.30 21-Aug-2021  andvar fix mainly same typos as in my previous commit but outside sys/dev/dm.
 1.29 07-May-2013  christos - add __clnt_sigfillset() that does not blindly block all signals but excludes
the tty generated ones (int, quit, tstp), plus term and hup. This makes
command line clients behave on connect(2) where before they would need
to be killed from a different tty. Much easier than making the file
descriptor non-blocking for the duration of connect and then using
pselect/pollts to detect when actual connection or timeout occured using
a different sigmask.
- factor out some of the error paths.
 1.28 11-Mar-2013  tron Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.

This fixes PR lib/45293 by Pedro Giffuni.
 1.27 05-Mar-2013  christos make this usable from RUMP
 1.26 20-Mar-2012  matt branches: 1.26.2;
Use C89 definitions
Remove use of __P
 1.25 20-Jun-2011  mrg branches: 1.25.2; 1.25.4;
various build fixes for gcc 4.5. from chuq. XXX i'm not sure all of
these work properly wtf pointer aliasing, but there are no casts at
least...

the lib/libpuffs/puffs_priv.h is definately a real bug fix.

from chuq.
 1.24 08-Dec-2010  joerg branches: 1.24.4;
Use __isthreaded from reentrant.h and don't redeclare it.
 1.23 12-Feb-2009  lukem sign-compare fixes
 1.22 25-Apr-2008  christos branches: 1.22.8; 1.22.10;
- always check malloc results
- don't leak fds on error
- don't cast malloc
- don't cast NULL
 1.21 19-Feb-2007  chs branches: 1.21.10;
switch from kqueue() back to pollts() so that signals will be unblocked
while we're sleeping. keep the new timeout logic, though.
as discussed on source-changes some 15 months ago.
 1.20 03-Dec-2005  yamt branches: 1.20.4;
- constify and remove __UNCONST from caller of clnt_call().
- use __UNCONST where approproate.
 1.19 07-Nov-2005  christos remove _REENTRANT bogus signal mask code; pointed out by chuq.
 1.18 13-Oct-2005  rpaulo Use the kqueue(2) framework instead of the poll(2) system call to wait
for replies and timeouts in the conectionless (UDP) RPC client
code. Based on similar changes from FreeBSD in rev 1.15.

Reviewed by Christos Zoulas.
 1.17 10-Sep-2005  jmmv Fix build: maskp should be a pointer to a sigset_t. Hi, christos@!
 1.16 09-Sep-2005  christos PR/31264: Mark Davies: rup not interruptable
The cause of this is that in the re-entrant case we block all signals until
we timeout. Convert this to use pollts and then grab the pending signals
and sigsuspend them.
XXX: We should really convert this to use kqueue, like FreeBSD did.
 1.15 09-Jun-2005  yamt use malloc rather than mem_alloc (which is implemented using calloc)
for receive/send buffers to avoid unnecessarily anonymous memory bloat.
 1.14 30-Dec-2004  christos branches: 1.14.2;
cast to socklen_t/size_t
 1.13 22-Oct-2003  drochner -don't update the RPC server address with the reply's sender address;
this breaks server failover under some circumstances, and Solaris doesn't
seem to do it either
-minor cleanup
approved by fvdl
 1.12 09-Sep-2003  itojun __RCSID police
 1.11 09-Sep-2003  itojun use niels provos' random sequence number generator to initialize RPC XID.
 1.10 06-Jun-2003  yamt add a missing release_fd_lock.
 1.9 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.8 08-Nov-2002  fvdl * Adapt include files for rpc_com.h/rpc_internal.h split.
* Add rpc_control to svc.c
* Implement non-blocking connections.
 1.7 04-Jan-2001  lukem branches: 1.7.2; 1.7.4;
sprinkle _DIAGASSERT() appropriately. minor other cleanups
 1.6 20-Dec-2000  christos oops fix previous typos.
 1.5 20-Dec-2000  christos appease lint casts
 1.4 14-Jul-2000  fvdl Use explicit int32 get/put macros. Needed for 64bit big-endian systems.
 1.3 06-Jul-2000  christos remove register
adjust types to match functions
elide non-portable casts
cast to proper types
 1.2 04-Jun-2000  thorpej branches: 1.2.2; 1.2.4;
Get <string.h> so this builds on LP64.
 1.1 02-Jun-2000  fvdl Add new RPC code, based on Sun's TI-RPC code. Adapted to not use XTI,
but sockets instead, internally. Old, backward compatible interfaces
maintained.
 1.2.4.2 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.2.4.1 04-Jun-2000  minoura file clnt_dg.c was added on branch minoura-xpg4dl on 2000-06-23 16:17:40 +0000
 1.2.2.1 14-Jul-2000  fvdl Pullup from trunk: use explicit 32 bit operations and types where
appropriate, to make things work on 64bit BE systems.
 1.7.4.1 06-Jan-2003  jmc Pull up revisions 1.7-1.8 (requested by fvdl in ticket #1037)
* Adapt include files for rpc_com.h/rpc_internal.h split.
* Implement non-blocking connections.
* Add rpc_control to svc.c
 1.7.2.4 11-Nov-2002  nathanw Catch up to -current
 1.7.2.3 18-Dec-2001  nathanw Delint by changing an int variable to size_t.
 1.7.2.2 16-Nov-2001  thorpej clnt_dg_call(): delete unused variable "dtbsize".
 1.7.2.1 08-Aug-2001  nathanw Convert to our threading style.
__REENT -> _REENTRANT
Statically initialize mutexes.
Use pthread thread-specific data semantics and once_t instead of Sun thread
semantics.
Use __isthreaded to detect presence of thread universe instead of _thr_main().
 1.14.2.3 21-Nov-2005  tron Pull up following revision(s) (requested by chs in ticket #964):
lib/libc/rpc/clnt_dg.c: revision 1.17
Fix build: maskp should be a pointer to a sigset_t. Hi, christos@!
 1.14.2.2 21-Nov-2005  tron Pull up following revision(s) (requested by chs in ticket #964):
lib/libc/rpc/clnt_dg.c: revision 1.16
PR/31264: Mark Davies: rup not interruptable
The cause of this is that in the re-entrant case we block all signals until
we timeout. Convert this to use pollts and then grab the pending signals
and sigsuspend them.
XXX: We should really convert this to use kqueue, like FreeBSD did.
 1.14.2.1 21-Nov-2005  tron Pull up following revision(s) (requested by chs in ticket #964):
lib/libc/rpc/svc_dg.c: revision 1.11
lib/libc/rpc/clnt_dg.c: revision 1.15
lib/libc/rpc/svc_raw.c: revision 1.18
lib/libc/rpc/xdr_rec.c: revision 1.25
lib/libc/rpc/clnt_raw.c: revision 1.26
use malloc rather than mem_alloc (which is implemented using calloc)
for receive/send buffers to avoid unnecessarily anonymous memory bloat.
 1.20.4.1 10-Mar-2007  bouyer Pull up following revision(s) (requested by chs in ticket #505):
lib/libc/rpc/clnt_dg.c: revision 1.21
switch from kqueue() back to pollts() so that signals will be unblocked
while we're sleeping. keep the new timeout logic, though.
as discussed on source-changes some 15 months ago.
 1.21.10.1 18-May-2008  yamt sync with head.
 1.22.10.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.22.8.2 25-Apr-2008  christos - always check malloc results
- don't leak fds on error
- don't cast malloc
- don't cast NULL
 1.22.8.1 25-Apr-2008  christos file clnt_dg.c was added on branch christos-time_t on 2008-04-25 17:44:45 +0000
 1.24.4.1 23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.25.4.1 14-Mar-2013  riz Pull up following revision(s) (requested by tron in ticket #843):
lib/libc/rpc/clnt_dg.c: revision 1.28
lib/libc/rpc/xdr_sizeof.c: revision 1.5
lib/libc/rpc/pmap_getport.c: revision 1.19
lib/libc/rpc/xdr_mem.c: revision 1.19
lib/libc/rpc/svc_run.c: revision 1.22
lib/libc/rpc/bindresvport.c: revision 1.25
lib/libc/rpc/svc_raw.c: revision 1.24
lib/libc/rpc/svc_dg.c: revision 1.17
lib/libc/rpc/getnetconfig.c: revision 1.21
lib/libc/rpc/auth_unix.c: revision 1.25
lib/libc/rpc/svc_auth.c: revision 1.17
lib/libc/rpc/clnt_vc.c: revision 1.21
lib/libc/rpc/svc_auth_unix.c: revision 1.21
lib/libc/rpc/rpcb_st_xdr.c: revision 1.10
lib/libc/rpc/pmap_getmaps.c: revision 1.18
lib/libc/rpc/getnetpath.c: revision 1.17
lib/libc/rpc/clnt_simple.c: revision 1.32
lib/libc/rpc/authunix_prot.c: revision 1.16
lib/libc/rpc/svc_dg.h: revision 1.2
lib/libc/rpc/svc_generic.c: revision 1.15
lib/libc/rpc/clnt_raw.c: revision 1.32
lib/libc/rpc/xdr_array.c: revision 1.19
lib/libc/rpc/pmap_prot.c: revision 1.12
lib/libc/rpc/clnt_bcast.c: revision 1.26
lib/libc/rpc/xdr_rec.c: revision 1.35
lib/libc/rpc/svc.c: revision 1.34
lib/libc/rpc/DISCLAIMER: revision 1.3
lib/libc/rpc/clnt_generic.c: revision 1.30
lib/libc/rpc/xdr.c: revision 1.33
lib/libc/rpc/auth_none.c: revision 1.16
lib/libc/rpc/pmap_rmt.c: revision 1.34
lib/libc/rpc/rpc_callmsg.c: revision 1.20
lib/libc/rpc/clnt_perror.c: revision 1.30
lib/libc/rpc/xdr_stdio.c: revision 1.19
lib/libc/rpc/rpc_commondata.c: revision 1.9
lib/libc/rpc/pmap_prot2.c: revision 1.17
lib/libc/rpc/pmap_clnt.c: revision 1.19
lib/libc/rpc/svc_simple.c: revision 1.33
lib/libc/rpc/rpcb_clnt.c: revision 1.29
lib/libc/rpc/rpc_prot.c: revision 1.21
lib/libc/rpc/rpc_dtablesize.c: revision 1.16
lib/libc/rpc/rpc_generic.c: revision 1.28
lib/libc/rpc/xdr_reference.c: revision 1.18
lib/libc/rpc/rpc_soc.c: revision 1.18
lib/libc/rpc/svc_vc.c: revision 1.30
lib/libc/rpc/getrpcent.c: revision 1.23
lib/libc/rpc/xdr_float.c: revision 1.38
lib/libc/rpc/rpcb_prot.c: revision 1.11
lib/libc/rpc/getrpcport.c: revision 1.18
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.
This fixes PR lib/45293 by Pedro Giffuni.
 1.25.2.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.25.2.1 17-Apr-2012  yamt sync with head
 1.26.2.1 23-Jun-2013  tls resync from head
 1.33 28-May-2014  christos CID 975113: Ignore __rpc_setnodelay error, it is not fatal
 1.32 28-May-2014  christos CID 975112: Ignore bindresvport() return. This is can only succeed for root
 1.31 07-May-2013  christos branches: 1.31.4;
- add __clnt_sigfillset() that does not blindly block all signals but excludes
the tty generated ones (int, quit, tstp), plus term and hup. This makes
command line clients behave on connect(2) where before they would need
to be killed from a different tty. Much easier than making the file
descriptor non-blocking for the duration of connect and then using
pselect/pollts to detect when actual connection or timeout occured using
a different sigmask.
- factor out some of the error paths.
 1.30 11-Mar-2013  tron Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.

This fixes PR lib/45293 by Pedro Giffuni.
 1.29 05-Mar-2013  christos make this usable from RUMP
 1.28 20-Mar-2012  matt branches: 1.28.2;
Use C89 definitions
Remove use of __P
 1.27 25-Apr-2008  christos branches: 1.27.4; 1.27.8; 1.27.24;
- always check malloc results
- don't leak fds on error
- don't cast malloc
- don't cast NULL
 1.26 22-Jun-2006  christos branches: 1.26.18;
Centralize the TCP_NODELAY handling as discussed in tech-net.
 1.25 02-Dec-2005  yamt use __UNCONST rather than having a writable string.
 1.24 29-Nov-2005  christos WARNS=4
 1.23 30-Dec-2004  christos cast to size_t/socklen_t
 1.22 09-Sep-2003  itojun __RCSID police
 1.21 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.20 08-Nov-2002  fvdl * Adapt include files for rpc_com.h/rpc_internal.h split.
* Add rpc_control to svc.c
* Implement non-blocking connections.
 1.19 04-Jan-2001  lukem branches: 1.19.2; 1.19.4;
sprinkle _DIAGASSERT() appropriately. minor other cleanups
 1.18 06-Jul-2000  christos add __RPC_GETXID macro
don't const castway __rpc_getconf and __rpc_getconfig. It might try to
write const strings
fix non-portable casts
remove duplicated prototypes
cast things to proper types
remove extraneous casts to NULL
fix variable cast mismatches
remove register var declarations
 1.17 07-Jun-2000  fvdl The two unchanged interfaces (svc_create and clnt_create) resulted
in sockets bound to reserved ports in the old code. Since old binaries
will still expect this, always try to bind to a reserved port in
clnt_cli_create and svc_tli_create, unless we're already bound.
 1.16 02-Jun-2000  fvdl Add new RPC code, based on Sun's TI-RPC code. Adapted to not use XTI,
but sockets instead, internally. Old, backward compatible interfaces
maintained.
 1.15 22-Jan-2000  mycroft branches: 1.15.2;
Delint.
Remove trailing ; from uses of __weak_alias(). The macro inserts this if
needed.
 1.14 20-Sep-1999  lukem back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.13 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.12 15-Nov-1998  christos delint:
- memmove -> memcpy
- check that we don't get a bogus h->h_length
 1.11 13-Feb-1998  lukem * in get_myaddress(); always return sockaddr_in containing localhost:PMAP_PORT.
(as recommended in Weiste Venema's portmap5_beta distribution)
* deprecate register
* use memmove instead of bcopy
* KNF includes
* use err/warn() instead of perror/fprintf(stderr,)
* fix some typos
 1.10 12-Feb-1998  lukem revert; we can't break the existing ABI and API
 1.9 10-Feb-1998  lukem major cleanup (to sync with changes made in include/rpc/*.h):
* use int32_t, size_t, in_port_t instead of long, u_int, u_short as appropriate
* use uid_t and gid_t instead of int
* KNF, fix typos and spellos
* use const as appropriate
* deprecate register
* use memmove instead of bcopy
* use err/warn()
 1.8 21-Jul-1997  jtc If port provides __weak_alias(), provide an Standard C and POSIX pure
identifier namespace by renaming non standard functions and variables
such that they have a leading underscore. The library will use those
names internally. Weak aliases are used to provide the original names
to the API.

This is only the first part of this change. It is most of the functions
which are implemented in C for all NetBSD ports. Subsequent changes are
to add the same support to the remaining C files, to assembly files, and
to the automagically generated assembly source used for system calls.
When all of the above is done, ports with weak alias support should add
a definition for __weak_alias to <sys/cdefs.h>.
 1.7 13-Jul-1997  christos Fix RCSID's
Fix gcc warnings.
Add missing prototypes
 1.6 03-Jun-1995  mycroft branches: 1.6.4;
Fill in sin_len.
 1.5 14-Apr-1995  jtc Changed bzero to memset.
Changed bcmp to memcmp.
Added #include <string.h> to bring prototypes into scope.
 1.4 25-Feb-1995  cgd save my sanity; stop using Id.
 1.3 10-Dec-1993  jtc RPCSRC 4.0, which our RPC implementation is derrived from, erroneously
sets a default timeout of 25 seconds in clnt_create(). This bug causes
timeouts specified as the last argument to clnt_call to be ignored.
With this fix, timeouts will be taken from clnt_call() unless the
program sets its own default timeout with clnt_control().
 1.2 05-Dec-1993  deraadt should bzero automatic sockaddr's before use
 1.1 07-Oct-1993  cgd move the rpc code into libc
 1.6.4.1 16-Sep-1996  jtc snapshot namespace cleanup: rpc & xdr
 1.15.2.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.19.4.1 06-Jan-2003  jmc Pull up revisions 1.19-1.20 (requested by fvdl in ticket #1037)
* Adapt include files for rpc_com.h/rpc_internal.h split.
* Implement non-blocking connections.
* Add rpc_control to svc.c
 1.19.2.1 11-Nov-2002  nathanw Catch up to -current
 1.26.18.1 18-May-2008  yamt sync with head.
 1.27.24.1 14-Mar-2013  riz Pull up following revision(s) (requested by tron in ticket #843):
lib/libc/rpc/clnt_dg.c: revision 1.28
lib/libc/rpc/xdr_sizeof.c: revision 1.5
lib/libc/rpc/pmap_getport.c: revision 1.19
lib/libc/rpc/xdr_mem.c: revision 1.19
lib/libc/rpc/svc_run.c: revision 1.22
lib/libc/rpc/bindresvport.c: revision 1.25
lib/libc/rpc/svc_raw.c: revision 1.24
lib/libc/rpc/svc_dg.c: revision 1.17
lib/libc/rpc/getnetconfig.c: revision 1.21
lib/libc/rpc/auth_unix.c: revision 1.25
lib/libc/rpc/svc_auth.c: revision 1.17
lib/libc/rpc/clnt_vc.c: revision 1.21
lib/libc/rpc/svc_auth_unix.c: revision 1.21
lib/libc/rpc/rpcb_st_xdr.c: revision 1.10
lib/libc/rpc/pmap_getmaps.c: revision 1.18
lib/libc/rpc/getnetpath.c: revision 1.17
lib/libc/rpc/clnt_simple.c: revision 1.32
lib/libc/rpc/authunix_prot.c: revision 1.16
lib/libc/rpc/svc_dg.h: revision 1.2
lib/libc/rpc/svc_generic.c: revision 1.15
lib/libc/rpc/clnt_raw.c: revision 1.32
lib/libc/rpc/xdr_array.c: revision 1.19
lib/libc/rpc/pmap_prot.c: revision 1.12
lib/libc/rpc/clnt_bcast.c: revision 1.26
lib/libc/rpc/xdr_rec.c: revision 1.35
lib/libc/rpc/svc.c: revision 1.34
lib/libc/rpc/DISCLAIMER: revision 1.3
lib/libc/rpc/clnt_generic.c: revision 1.30
lib/libc/rpc/xdr.c: revision 1.33
lib/libc/rpc/auth_none.c: revision 1.16
lib/libc/rpc/pmap_rmt.c: revision 1.34
lib/libc/rpc/rpc_callmsg.c: revision 1.20
lib/libc/rpc/clnt_perror.c: revision 1.30
lib/libc/rpc/xdr_stdio.c: revision 1.19
lib/libc/rpc/rpc_commondata.c: revision 1.9
lib/libc/rpc/pmap_prot2.c: revision 1.17
lib/libc/rpc/pmap_clnt.c: revision 1.19
lib/libc/rpc/svc_simple.c: revision 1.33
lib/libc/rpc/rpcb_clnt.c: revision 1.29
lib/libc/rpc/rpc_prot.c: revision 1.21
lib/libc/rpc/rpc_dtablesize.c: revision 1.16
lib/libc/rpc/rpc_generic.c: revision 1.28
lib/libc/rpc/xdr_reference.c: revision 1.18
lib/libc/rpc/rpc_soc.c: revision 1.18
lib/libc/rpc/svc_vc.c: revision 1.30
lib/libc/rpc/getrpcent.c: revision 1.23
lib/libc/rpc/xdr_float.c: revision 1.38
lib/libc/rpc/rpcb_prot.c: revision 1.11
lib/libc/rpc/getrpcport.c: revision 1.18
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.
This fixes PR lib/45293 by Pedro Giffuni.
 1.27.8.2 25-Apr-2008  christos - always check malloc results
- don't leak fds on error
- don't cast malloc
- don't cast NULL
 1.27.8.1 25-Apr-2008  christos file clnt_generic.c was added on branch christos-time_t on 2008-04-25 17:44:45 +0000
 1.27.4.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.27.4.1 17-Apr-2012  yamt sync with head
 1.28.2.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.28.2.1 23-Jun-2013  tls resync from head
 1.31.4.1 10-Aug-2014  tls Rebase.
 1.30 11-Mar-2013  tron Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.

This fixes PR lib/45293 by Pedro Giffuni.
 1.29 20-Mar-2012  matt branches: 1.29.2;
Use C89 definitions
Remove use of __P
 1.28 25-Apr-2008  christos branches: 1.28.4; 1.28.8; 1.28.24;
- always check malloc results
- don't leak fds on error
- don't cast malloc
- don't cast NULL
 1.27 08-Jul-2006  yamt branches: 1.27.18;
rpc_errlist:
- add some missing error numbers.
- while i'm here, use c99 initializer.
clnt_sperrno:
- handle NULL in rpc_errlist as it's now sparse.
 1.26 29-Nov-2005  christos WARNS=4
 1.25 13-Feb-2001  cgd change 'char *' args of clnt_pcreateerror, clnt_spcreateerror,
clnt_perror, and clnt_sperror to 'const char *' to follow manual
pages (!!).
 1.24 02-Jun-2000  fvdl Add new RPC code, based on Sun's TI-RPC code. Adapted to not use XTI,
but sockets instead, internally. Old, backward compatible interfaces
maintained.
 1.23 22-Jan-2000  mycroft branches: 1.23.2;
Delint.
Remove trailing ; from uses of __weak_alias(). The macro inserts this if
needed.
 1.22 05-Jan-2000  drochner fix use of uninitialized "buflen" (botched in 1.18), closes PR lib/9104
by bgrayson@ece.utexas.edu
 1.21 29-Sep-1999  explorer Fix incorrectly initialized value from _DIAGASSERT() changes.
 1.20 20-Sep-1999  lukem branches: 1.20.2;
back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.19 17-Sep-1999  lukem since clnt_p*error() are expected to print an error message, print one if they're called with dodgy args. ;)
 1.18 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.17 03-May-1999  christos int -> size_t
 1.16 20-Jan-1999  lukem * ensure memory is released if operations fail (in authunix_create(),
xdr_callmsg(), xprt_register(), svc_tcp(), svc_udp(), etc)
* don't attempt to close a socket filedescriptor if it's -1 (some from
freebsd, some i found)
* make the initial xid a little more random (from freebsd)
* fix some spelos and tyops in comments (some from freebsd)
* use warn() instead of warnx() for many errors; the user probably
wants to know what the error code was.
* knf & whitespace nitpicks
 1.15 15-Nov-1998  christos delint
 1.14 13-Feb-1998  lukem * in get_myaddress(); always return sockaddr_in containing localhost:PMAP_PORT.
(as recommended in Weiste Venema's portmap5_beta distribution)
* deprecate register
* use memmove instead of bcopy
* KNF includes
* use err/warn() instead of perror/fprintf(stderr,)
* fix some typos
 1.13 12-Feb-1998  lukem revert; we can't break the existing ABI and API
 1.12 10-Feb-1998  lukem major cleanup (to sync with changes made in include/rpc/*.h):
* use int32_t, size_t, in_port_t instead of long, u_int, u_short as appropriate
* use uid_t and gid_t instead of int
* KNF, fix typos and spellos
* use const as appropriate
* deprecate register
* use memmove instead of bcopy
* use err/warn()
 1.11 21-Jul-1997  jtc If port provides __weak_alias(), provide an Standard C and POSIX pure
identifier namespace by renaming non standard functions and variables
such that they have a leading underscore. The library will use those
names internally. Weak aliases are used to provide the original names
to the API.

This is only the first part of this change. It is most of the functions
which are implemented in C for all NetBSD ports. Subsequent changes are
to add the same support to the remaining C files, to assembly files, and
to the automagically generated assembly source used for system calls.
When all of the above is done, ports with weak alias support should add
a definition for __weak_alias to <sys/cdefs.h>.
 1.10 13-Jul-1997  christos Fix printf format strings.
Fix RCSID's
Fix gcc warnings
Add missing prototypes
 1.9 23-Jan-1997  mrg - convert unsafe strcpy(), strcat() and sprintf() to the `n' versions.
- some KNF.
 1.8 19-Jun-1996  jtc branches: 1.8.2;
Changed clnt_{s,}p{errno,error,createerror} so that the functions that
output emit newlines and those that return a pointer to string do not
append them.

The existing behavior was inherited from RPC4.0, but this seems to have
been corrected sometime before SunOS 4.1.

The documentation has been updated to reflect the new behavior.
 1.7 24-Apr-1995  cgd fix typo(?): rpc__errlist usage shouldn't have had two underscores.
Also, cast return types to (char *) to quiet compiler's complaints about
loss of 'const'-ness.
 1.6 21-Apr-1995  jtc Changed auth_errmsg() and clnt_sperrno() to access error messages
directly instead of by linear search.
 1.5 25-Feb-1995  cgd save my sanity; stop using Id.
 1.4 20-Feb-1995  jtc Added \n to end of format strings used by all the perror-like functions.
Added const qualifier to array of error strings.
 1.3 04-Dec-1994  cgd be much more careful with types, and add prototype everything.
 1.2 10-Oct-1994  jtc Don't bother checking if errno is in range --- strerror() already does
that.
 1.1 07-Oct-1993  cgd move the rpc code into libc
 1.8.2.1 16-Sep-1996  jtc snapshot namespace cleanup: rpc & xdr
 1.20.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.23.2.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.27.18.1 18-May-2008  yamt sync with head.
 1.28.24.1 14-Mar-2013  riz Pull up following revision(s) (requested by tron in ticket #843):
lib/libc/rpc/clnt_dg.c: revision 1.28
lib/libc/rpc/xdr_sizeof.c: revision 1.5
lib/libc/rpc/pmap_getport.c: revision 1.19
lib/libc/rpc/xdr_mem.c: revision 1.19
lib/libc/rpc/svc_run.c: revision 1.22
lib/libc/rpc/bindresvport.c: revision 1.25
lib/libc/rpc/svc_raw.c: revision 1.24
lib/libc/rpc/svc_dg.c: revision 1.17
lib/libc/rpc/getnetconfig.c: revision 1.21
lib/libc/rpc/auth_unix.c: revision 1.25
lib/libc/rpc/svc_auth.c: revision 1.17
lib/libc/rpc/clnt_vc.c: revision 1.21
lib/libc/rpc/svc_auth_unix.c: revision 1.21
lib/libc/rpc/rpcb_st_xdr.c: revision 1.10
lib/libc/rpc/pmap_getmaps.c: revision 1.18
lib/libc/rpc/getnetpath.c: revision 1.17
lib/libc/rpc/clnt_simple.c: revision 1.32
lib/libc/rpc/authunix_prot.c: revision 1.16
lib/libc/rpc/svc_dg.h: revision 1.2
lib/libc/rpc/svc_generic.c: revision 1.15
lib/libc/rpc/clnt_raw.c: revision 1.32
lib/libc/rpc/xdr_array.c: revision 1.19
lib/libc/rpc/pmap_prot.c: revision 1.12
lib/libc/rpc/clnt_bcast.c: revision 1.26
lib/libc/rpc/xdr_rec.c: revision 1.35
lib/libc/rpc/svc.c: revision 1.34
lib/libc/rpc/DISCLAIMER: revision 1.3
lib/libc/rpc/clnt_generic.c: revision 1.30
lib/libc/rpc/xdr.c: revision 1.33
lib/libc/rpc/auth_none.c: revision 1.16
lib/libc/rpc/pmap_rmt.c: revision 1.34
lib/libc/rpc/rpc_callmsg.c: revision 1.20
lib/libc/rpc/clnt_perror.c: revision 1.30
lib/libc/rpc/xdr_stdio.c: revision 1.19
lib/libc/rpc/rpc_commondata.c: revision 1.9
lib/libc/rpc/pmap_prot2.c: revision 1.17
lib/libc/rpc/pmap_clnt.c: revision 1.19
lib/libc/rpc/svc_simple.c: revision 1.33
lib/libc/rpc/rpcb_clnt.c: revision 1.29
lib/libc/rpc/rpc_prot.c: revision 1.21
lib/libc/rpc/rpc_dtablesize.c: revision 1.16
lib/libc/rpc/rpc_generic.c: revision 1.28
lib/libc/rpc/xdr_reference.c: revision 1.18
lib/libc/rpc/rpc_soc.c: revision 1.18
lib/libc/rpc/svc_vc.c: revision 1.30
lib/libc/rpc/getrpcent.c: revision 1.23
lib/libc/rpc/xdr_float.c: revision 1.38
lib/libc/rpc/rpcb_prot.c: revision 1.11
lib/libc/rpc/getrpcport.c: revision 1.18
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.
This fixes PR lib/45293 by Pedro Giffuni.
 1.28.8.2 25-Apr-2008  christos - always check malloc results
- don't leak fds on error
- don't cast malloc
- don't cast NULL
 1.28.8.1 25-Apr-2008  christos file clnt_perror.c was added on branch christos-time_t on 2008-04-25 17:44:45 +0000
 1.28.4.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.28.4.1 17-Apr-2012  yamt sync with head
 1.29.2.1 23-Jun-2013  tls resync from head
 1.34 23-Jan-2024  christos fix nested extern warnings
 1.33 06-Nov-2015  christos - Use -1 for the fake raw fd since we will be able to go beyond FD_SETSIZE.
- Poster boy for why it is bad to initialize in declarations :-)
 1.32 11-Mar-2013  tron Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.

This fixes PR lib/45293 by Pedro Giffuni.
 1.31 04-Mar-2013  christos fix error messages and warnings.
 1.30 20-Mar-2012  matt branches: 1.30.2;
Use C89 definitions
Remove use of __P
 1.29 25-Apr-2008  christos branches: 1.29.4; 1.29.8; 1.29.24;
- always check malloc results
- don't leak fds on error
- don't cast malloc
- don't cast NULL
 1.28 03-Dec-2005  yamt branches: 1.28.18;
- constify and remove __UNCONST from caller of clnt_call().
- use __UNCONST where approproate.
 1.27 30-Jul-2005  wiz Fix typo reported in PR 30872.
 1.26 09-Jun-2005  yamt use malloc rather than mem_alloc (which is implemented using calloc)
for receive/send buffers to avoid unnecessarily anonymous memory bloat.
 1.25 30-Dec-2004  christos branches: 1.25.2;
cast to size_t
remove unneeded casts.
 1.24 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.23 04-Nov-2001  lukem fix WARNS=2 (-Wshadow) warnings
 1.22 20-Dec-2000  christos branches: 1.22.2;
oops fix previous typos.
 1.21 20-Dec-2000  christos appease lint casts
 1.20 10-Dec-2000  christos remove dedundant declaration of _svc_getreq_common; declared in <rpc/svc.h>
 1.19 14-Jul-2000  fvdl Use explicit int32 get/put macros. Needed for 64bit big-endian systems.
 1.18 06-Jul-2000  christos add __RPC_GETXID macro
don't const castway __rpc_getconf and __rpc_getconfig. It might try to
write const strings
fix non-portable casts
remove duplicated prototypes
cast things to proper types
remove extraneous casts to NULL
fix variable cast mismatches
remove register var declarations
 1.17 02-Jun-2000  fvdl branches: 1.17.2;
Add new RPC code, based on Sun's TI-RPC code. Adapted to not use XTI,
but sockets instead, internally. Old, backward compatible interfaces
maintained.
 1.16 22-Jan-2000  mycroft branches: 1.16.2;
Delint.
Remove trailing ; from uses of __weak_alias(). The macro inserts this if
needed.
 1.15 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.14 20-Jan-1999  lukem * ensure memory is released if operations fail (in authunix_create(),
xdr_callmsg(), xprt_register(), svc_tcp(), svc_udp(), etc)
* don't attempt to close a socket filedescriptor if it's -1 (some from
freebsd, some i found)
* make the initial xid a little more random (from freebsd)
* fix some spelos and tyops in comments (some from freebsd)
* use warn() instead of warnx() for many errors; the user probably
wants to know what the error code was.
* knf & whitespace nitpicks
 1.13 15-Nov-1998  christos avoid potential buffer overflow and alignment problem that was caused
by casting a char[24] array to struct rpc_msg (sizeof(struct rpc_msg) == 48)
on i386. Use a union instead.
 1.12 26-Jul-1998  mycroft constify some tables.
 1.11 13-Feb-1998  lukem * in get_myaddress(); always return sockaddr_in containing localhost:PMAP_PORT.
(as recommended in Weiste Venema's portmap5_beta distribution)
* deprecate register
* use memmove instead of bcopy
* KNF includes
* use err/warn() instead of perror/fprintf(stderr,)
* fix some typos
 1.10 12-Feb-1998  lukem revert; we can't break the existing ABI and API
 1.9 11-Feb-1998  lukem use u_int32_t instead of size_t...
 1.8 11-Feb-1998  lukem use u_int instead of size_t in clntraw_control (oops!)
 1.7 10-Feb-1998  lukem major cleanup (to sync with changes made in include/rpc/*.h):
* use int32_t, size_t, in_port_t instead of long, u_int, u_short as appropriate
* use uid_t and gid_t instead of int
* KNF, fix typos and spellos
* use const as appropriate
* deprecate register
* use memmove instead of bcopy
* use err/warn()
 1.6 23-Jan-1998  lukem a memory leak can occur when xdr_replymesg() fails, so XDR_FREE in
this case. originally fixed in freebsd in clnt_udp.c, and similar
change to clnt_raw.c made by openbsd.
 1.5 21-Jul-1997  jtc If port provides __weak_alias(), provide an Standard C and POSIX pure
identifier namespace by renaming non standard functions and variables
such that they have a leading underscore. The library will use those
names internally. Weak aliases are used to provide the original names
to the API.

This is only the first part of this change. It is most of the functions
which are implemented in C for all NetBSD ports. Subsequent changes are
to add the same support to the remaining C files, to assembly files, and
to the automagically generated assembly source used for system calls.
When all of the above is done, ports with weak alias support should add
a definition for __weak_alias to <sys/cdefs.h>.
 1.4 13-Jul-1997  christos Fix RCSID's
Fix gcc warnings.
Add missing prototypes
 1.3 25-Feb-1995  cgd branches: 1.3.4;
save my sanity; stop using Id.
 1.2 04-Dec-1994  cgd be much more careful with types, and add prototype everything.
 1.1 07-Oct-1993  cgd move the rpc code into libc
 1.3.4.1 16-Sep-1996  jtc snapshot namespace cleanup: rpc & xdr
 1.16.2.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.17.2.1 14-Jul-2000  fvdl Pullup from trunk: use explicit 32 bit operations and types where
appropriate, to make things work on 64bit BE systems.
 1.22.2.2 14-Nov-2001  nathanw Catch up to -current.
 1.22.2.1 08-Aug-2001  nathanw Convert to our threading style.
__REENT -> _REENTRANT
Statically initialize mutexes.
Use pthread thread-specific data semantics and once_t instead of Sun thread
semantics.
Use __isthreaded to detect presence of thread universe instead of _thr_main().
 1.25.2.1 21-Nov-2005  tron Pull up following revision(s) (requested by chs in ticket #964):
lib/libc/rpc/svc_dg.c: revision 1.11
lib/libc/rpc/clnt_dg.c: revision 1.15
lib/libc/rpc/svc_raw.c: revision 1.18
lib/libc/rpc/xdr_rec.c: revision 1.25
lib/libc/rpc/clnt_raw.c: revision 1.26
use malloc rather than mem_alloc (which is implemented using calloc)
for receive/send buffers to avoid unnecessarily anonymous memory bloat.
 1.28.18.1 18-May-2008  yamt sync with head.
 1.29.24.1 14-Mar-2013  riz Pull up following revision(s) (requested by tron in ticket #843):
lib/libc/rpc/clnt_dg.c: revision 1.28
lib/libc/rpc/xdr_sizeof.c: revision 1.5
lib/libc/rpc/pmap_getport.c: revision 1.19
lib/libc/rpc/xdr_mem.c: revision 1.19
lib/libc/rpc/svc_run.c: revision 1.22
lib/libc/rpc/bindresvport.c: revision 1.25
lib/libc/rpc/svc_raw.c: revision 1.24
lib/libc/rpc/svc_dg.c: revision 1.17
lib/libc/rpc/getnetconfig.c: revision 1.21
lib/libc/rpc/auth_unix.c: revision 1.25
lib/libc/rpc/svc_auth.c: revision 1.17
lib/libc/rpc/clnt_vc.c: revision 1.21
lib/libc/rpc/svc_auth_unix.c: revision 1.21
lib/libc/rpc/rpcb_st_xdr.c: revision 1.10
lib/libc/rpc/pmap_getmaps.c: revision 1.18
lib/libc/rpc/getnetpath.c: revision 1.17
lib/libc/rpc/clnt_simple.c: revision 1.32
lib/libc/rpc/authunix_prot.c: revision 1.16
lib/libc/rpc/svc_dg.h: revision 1.2
lib/libc/rpc/svc_generic.c: revision 1.15
lib/libc/rpc/clnt_raw.c: revision 1.32
lib/libc/rpc/xdr_array.c: revision 1.19
lib/libc/rpc/pmap_prot.c: revision 1.12
lib/libc/rpc/clnt_bcast.c: revision 1.26
lib/libc/rpc/xdr_rec.c: revision 1.35
lib/libc/rpc/svc.c: revision 1.34
lib/libc/rpc/DISCLAIMER: revision 1.3
lib/libc/rpc/clnt_generic.c: revision 1.30
lib/libc/rpc/xdr.c: revision 1.33
lib/libc/rpc/auth_none.c: revision 1.16
lib/libc/rpc/pmap_rmt.c: revision 1.34
lib/libc/rpc/rpc_callmsg.c: revision 1.20
lib/libc/rpc/clnt_perror.c: revision 1.30
lib/libc/rpc/xdr_stdio.c: revision 1.19
lib/libc/rpc/rpc_commondata.c: revision 1.9
lib/libc/rpc/pmap_prot2.c: revision 1.17
lib/libc/rpc/pmap_clnt.c: revision 1.19
lib/libc/rpc/svc_simple.c: revision 1.33
lib/libc/rpc/rpcb_clnt.c: revision 1.29
lib/libc/rpc/rpc_prot.c: revision 1.21
lib/libc/rpc/rpc_dtablesize.c: revision 1.16
lib/libc/rpc/rpc_generic.c: revision 1.28
lib/libc/rpc/xdr_reference.c: revision 1.18
lib/libc/rpc/rpc_soc.c: revision 1.18
lib/libc/rpc/svc_vc.c: revision 1.30
lib/libc/rpc/getrpcent.c: revision 1.23
lib/libc/rpc/xdr_float.c: revision 1.38
lib/libc/rpc/rpcb_prot.c: revision 1.11
lib/libc/rpc/getrpcport.c: revision 1.18
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.
This fixes PR lib/45293 by Pedro Giffuni.
 1.29.8.2 25-Apr-2008  christos - always check malloc results
- don't leak fds on error
- don't cast malloc
- don't cast NULL
 1.29.8.1 25-Apr-2008  christos file clnt_raw.c was added on branch christos-time_t on 2008-04-25 17:44:45 +0000
 1.29.4.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.29.4.1 17-Apr-2012  yamt sync with head
 1.30.2.1 23-Jun-2013  tls resync from head
 1.33 20-Jan-2015  christos Fix non _REENTRANT build.
 1.32 11-Mar-2013  tron Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.

This fixes PR lib/45293 by Pedro Giffuni.
 1.31 20-Mar-2012  matt branches: 1.31.2;
Use C89 definitions
Remove use of __P
 1.30 08-Dec-2010  joerg branches: 1.30.6; 1.30.8;
Use __isthreaded from reentrant.h and don't redeclare it.
 1.29 03-Nov-2006  christos fix typo.
 1.28 03-Nov-2006  christos use FD_CLOEXEC instead of 1.
 1.27 03-Dec-2005  yamt - constify and remove __UNCONST from caller of clnt_call().
- use __UNCONST where approproate.
 1.26 29-Nov-2005  christos WARNS=4
 1.25 21-Oct-2003  fvdl Don't use NULL to compare against a character.
 1.24 09-Sep-2003  itojun __RCSID police
 1.23 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.22 04-Jan-2001  lukem branches: 1.22.2;
sprinkle _DIAGASSERT() appropriately. minor other cleanups
 1.21 06-Jul-2000  christos add __RPC_GETXID macro
don't const castway __rpc_getconf and __rpc_getconfig. It might try to
write const strings
fix non-portable casts
remove duplicated prototypes
cast things to proper types
remove extraneous casts to NULL
fix variable cast mismatches
remove register var declarations
 1.20 02-Jun-2000  fvdl Add new RPC code, based on Sun's TI-RPC code. Adapted to not use XTI,
but sockets instead, internally. Old, backward compatible interfaces
maintained.
 1.19 22-Jan-2000  mycroft branches: 1.19.2;
Delint.
Remove trailing ; from uses of __weak_alias(). The macro inserts this if
needed.
 1.18 20-Sep-1999  lukem back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.17 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.16 25-Mar-1999  lukem * don't close the socket unless it was opened by the function
* note (in the comments) that the client is responsible for closing
the socket if they opened it, or they didn't use CLNT_DESTROY()

fixes a couple of unnecessary closing of already-closed sockets.
noted by: Matthias Drochner <M.Drochner@fz-juelich.de>
 1.15 20-Jan-1999  lukem * ensure memory is released if operations fail (in authunix_create(),
xdr_callmsg(), xprt_register(), svc_tcp(), svc_udp(), etc)
* don't attempt to close a socket filedescriptor if it's -1 (some from
freebsd, some i found)
* make the initial xid a little more random (from freebsd)
* fix some spelos and tyops in comments (some from freebsd)
* use warn() instead of warnx() for many errors; the user probably
wants to know what the error code was.
* knf & whitespace nitpicks
 1.14 15-Nov-1998  christos delint:
- memmove -> memcpy
- check that we don't get a bogus h->h_length
 1.13 09-Jul-1998  msaitoh KNF.
 1.12 13-Feb-1998  lukem * in get_myaddress(); always return sockaddr_in containing localhost:PMAP_PORT.
(as recommended in Weiste Venema's portmap5_beta distribution)
* deprecate register
* use memmove instead of bcopy
* KNF includes
* use err/warn() instead of perror/fprintf(stderr,)
* fix some typos
 1.11 12-Feb-1998  lukem revert; we can't break the existing ABI and API
 1.10 10-Feb-1998  lukem major cleanup (to sync with changes made in include/rpc/*.h):
* use int32_t, size_t, in_port_t instead of long, u_int, u_short as appropriate
* use uid_t and gid_t instead of int
* KNF, fix typos and spellos
* use const as appropriate
* deprecate register
* use memmove instead of bcopy
* use err/warn()
 1.9 21-Jul-1997  jtc If port provides __weak_alias(), provide an Standard C and POSIX pure
identifier namespace by renaming non standard functions and variables
such that they have a leading underscore. The library will use those
names internally. Weak aliases are used to provide the original names
to the API.

This is only the first part of this change. It is most of the functions
which are implemented in C for all NetBSD ports. Subsequent changes are
to add the same support to the remaining C files, to assembly files, and
to the automagically generated assembly source used for system calls.
When all of the above is done, ports with weak alias support should add
a definition for __weak_alias to <sys/cdefs.h>.
 1.8 13-Jul-1997  christos Fix RCSID's
Fix gcc warnings.
Add missing prototypes
 1.7 23-Jan-1997  mrg - convert unsafe strcpy(), strcat() and sprintf() to the `n' versions.
- some KNF.
 1.6 29-Mar-1996  jtc branches: 1.6.2;
Add explict function return types
 1.5 03-Jun-1995  mycroft Fill in sin_len.
 1.4 14-Apr-1995  jtc Changed bzero to memset.
Changed bcmp to memcmp.
Added #include <string.h> to bring prototypes into scope.
 1.3 25-Feb-1995  cgd save my sanity; stop using Id.
 1.2 05-Dec-1993  deraadt branches: 1.2.4;
should bzero automatic sockaddr's before use
 1.1 07-Oct-1993  cgd move the rpc code into libc
 1.2.4.1 02-May-1995  jtc #include "namespace.h"
 1.6.2.1 16-Sep-1996  jtc snapshot namespace cleanup: rpc & xdr
 1.19.2.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.22.2.1 08-Aug-2001  nathanw Convert to our threading style.
__REENT -> _REENTRANT
Statically initialize mutexes.
Use pthread thread-specific data semantics and once_t instead of Sun thread
semantics.
Use __isthreaded to detect presence of thread universe instead of _thr_main().
 1.30.8.1 14-Mar-2013  riz Pull up following revision(s) (requested by tron in ticket #843):
lib/libc/rpc/clnt_dg.c: revision 1.28
lib/libc/rpc/xdr_sizeof.c: revision 1.5
lib/libc/rpc/pmap_getport.c: revision 1.19
lib/libc/rpc/xdr_mem.c: revision 1.19
lib/libc/rpc/svc_run.c: revision 1.22
lib/libc/rpc/bindresvport.c: revision 1.25
lib/libc/rpc/svc_raw.c: revision 1.24
lib/libc/rpc/svc_dg.c: revision 1.17
lib/libc/rpc/getnetconfig.c: revision 1.21
lib/libc/rpc/auth_unix.c: revision 1.25
lib/libc/rpc/svc_auth.c: revision 1.17
lib/libc/rpc/clnt_vc.c: revision 1.21
lib/libc/rpc/svc_auth_unix.c: revision 1.21
lib/libc/rpc/rpcb_st_xdr.c: revision 1.10
lib/libc/rpc/pmap_getmaps.c: revision 1.18
lib/libc/rpc/getnetpath.c: revision 1.17
lib/libc/rpc/clnt_simple.c: revision 1.32
lib/libc/rpc/authunix_prot.c: revision 1.16
lib/libc/rpc/svc_dg.h: revision 1.2
lib/libc/rpc/svc_generic.c: revision 1.15
lib/libc/rpc/clnt_raw.c: revision 1.32
lib/libc/rpc/xdr_array.c: revision 1.19
lib/libc/rpc/pmap_prot.c: revision 1.12
lib/libc/rpc/clnt_bcast.c: revision 1.26
lib/libc/rpc/xdr_rec.c: revision 1.35
lib/libc/rpc/svc.c: revision 1.34
lib/libc/rpc/DISCLAIMER: revision 1.3
lib/libc/rpc/clnt_generic.c: revision 1.30
lib/libc/rpc/xdr.c: revision 1.33
lib/libc/rpc/auth_none.c: revision 1.16
lib/libc/rpc/pmap_rmt.c: revision 1.34
lib/libc/rpc/rpc_callmsg.c: revision 1.20
lib/libc/rpc/clnt_perror.c: revision 1.30
lib/libc/rpc/xdr_stdio.c: revision 1.19
lib/libc/rpc/rpc_commondata.c: revision 1.9
lib/libc/rpc/pmap_prot2.c: revision 1.17
lib/libc/rpc/pmap_clnt.c: revision 1.19
lib/libc/rpc/svc_simple.c: revision 1.33
lib/libc/rpc/rpcb_clnt.c: revision 1.29
lib/libc/rpc/rpc_prot.c: revision 1.21
lib/libc/rpc/rpc_dtablesize.c: revision 1.16
lib/libc/rpc/rpc_generic.c: revision 1.28
lib/libc/rpc/xdr_reference.c: revision 1.18
lib/libc/rpc/rpc_soc.c: revision 1.18
lib/libc/rpc/svc_vc.c: revision 1.30
lib/libc/rpc/getrpcent.c: revision 1.23
lib/libc/rpc/xdr_float.c: revision 1.38
lib/libc/rpc/rpcb_prot.c: revision 1.11
lib/libc/rpc/getrpcport.c: revision 1.18
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.
This fixes PR lib/45293 by Pedro Giffuni.
 1.30.6.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.30.6.1 17-Apr-2012  yamt sync with head
 1.31.2.1 23-Jun-2013  tls resync from head
 1.22 02-Jun-2000  fvdl Add new RPC code, based on Sun's TI-RPC code. Adapted to not use XTI,
but sockets instead, internally. Old, backward compatible interfaces
maintained.
 1.21 22-Jan-2000  mycroft branches: 1.21.2;
Delint.
Remove trailing ; from uses of __weak_alias(). The macro inserts this if
needed.
 1.20 20-Sep-1999  lukem back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.19 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.18 25-Mar-1999  lukem * don't close the socket unless it was opened by the function
* note (in the comments) that the client is responsible for closing
the socket if they opened it, or they didn't use CLNT_DESTROY()

fixes a couple of unnecessary closing of already-closed sockets.
noted by: Matthias Drochner <M.Drochner@fz-juelich.de>
 1.17 31-Jan-1999  christos xdrproc_t casts.
 1.16 20-Jan-1999  lukem * ensure memory is released if operations fail (in authunix_create(),
xdr_callmsg(), xprt_register(), svc_tcp(), svc_udp(), etc)
* don't attempt to close a socket filedescriptor if it's -1 (some from
freebsd, some i found)
* make the initial xid a little more random (from freebsd)
* fix some spelos and tyops in comments (some from freebsd)
* use warn() instead of warnx() for many errors; the user probably
wants to know what the error code was.
* knf & whitespace nitpicks
 1.15 15-Nov-1998  christos Use a union again to make sure that we are aligned; this is not necessary
in this case, but makes the code easier to read, and avoids lint warnings.
 1.14 26-Jul-1998  mycroft constify some tables.
 1.13 13-Feb-1998  lukem * in get_myaddress(); always return sockaddr_in containing localhost:PMAP_PORT.
(as recommended in Weiste Venema's portmap5_beta distribution)
* deprecate register
* use memmove instead of bcopy
* KNF includes
* use err/warn() instead of perror/fprintf(stderr,)
* fix some typos
 1.12 12-Feb-1998  lukem revert; we can't break the existing ABI and API
 1.11 11-Feb-1998  lukem use u_int32_t instead of size_t...
 1.10 10-Feb-1998  lukem major cleanup (to sync with changes made in include/rpc/*.h):
* use int32_t, size_t, in_port_t instead of long, u_int, u_short as appropriate
* use uid_t and gid_t instead of int
* KNF, fix typos and spellos
* use const as appropriate
* deprecate register
* use memmove instead of bcopy
* use err/warn()
 1.9 21-Jul-1997  jtc If port provides __weak_alias(), provide an Standard C and POSIX pure
identifier namespace by renaming non standard functions and variables
such that they have a leading underscore. The library will use those
names internally. Weak aliases are used to provide the original names
to the API.

This is only the first part of this change. It is most of the functions
which are implemented in C for all NetBSD ports. Subsequent changes are
to add the same support to the remaining C files, to assembly files, and
to the automagically generated assembly source used for system calls.
When all of the above is done, ports with weak alias support should add
a definition for __weak_alias to <sys/cdefs.h>.
 1.8 13-Jul-1997  christos Fix uninitialized variable free on error.
Add prototypes
Fix RCSID's
Fix gcc warnings.
 1.7 08-Feb-1997  mycroft It's not necessary to initialize the `revents' field of struct pollfd.
 1.6 20-Dec-1996  cgd unistd.h for prototypes
 1.5 17-Dec-1996  mrg use poll() instead of select()
 1.4 25-Feb-1995  cgd branches: 1.4.4;
save my sanity; stop using Id.
 1.3 04-Dec-1994  cgd branches: 1.3.2;
be much more careful with types, and add prototype everything.
 1.2 20-Aug-1994  deraadt branches: 1.2.2;
rpc library no longer uses _rpc_dtablesize() internally -- keeps track
of highest active file descriptor. limit fd usage to FD_SETSIZE, until
a better solution is found. remove non-FD_SETSIZE code.
 1.1 07-Oct-1993  cgd move the rpc code into libc
 1.2.2.2 20-Aug-1994  deraadt rpc library no longer uses _rpc_dtablesize() internally -- keeps track
of highest active file descriptor. limit fd usage to FD_SETSIZE, until
a better solution is found. remove non-FD_SETSIZE code.
 1.2.2.1 20-Aug-1994  deraadt file clnt_tcp.c was added on branch netbsd-1-0 on 1994-08-20 00:55:27 +0000
 1.3.2.1 02-May-1995  jtc #include "namespace.h"
 1.4.4.1 16-Sep-1996  jtc snapshot namespace cleanup: rpc & xdr
 1.21.2.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.22 02-Jun-2000  fvdl Add new RPC code, based on Sun's TI-RPC code. Adapted to not use XTI,
but sockets instead, internally. Old, backward compatible interfaces
maintained.
 1.21 22-Jan-2000  mycroft branches: 1.21.2;
Delint.
Remove trailing ; from uses of __weak_alias(). The macro inserts this if
needed.
 1.20 20-Sep-1999  lukem back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.19 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.18 03-May-1999  christos int -> socklen_t
 1.17 25-Mar-1999  lukem * don't close the socket unless it was opened by the function
* note (in the comments) that the client is responsible for closing
the socket if they opened it, or they didn't use CLNT_DESTROY()

fixes a couple of unnecessary closing of already-closed sockets.
noted by: Matthias Drochner <M.Drochner@fz-juelich.de>
 1.16 20-Jan-1999  lukem * ensure memory is released if operations fail (in authunix_create(),
xdr_callmsg(), xprt_register(), svc_tcp(), svc_udp(), etc)
* don't attempt to close a socket filedescriptor if it's -1 (some from
freebsd, some i found)
* make the initial xid a little more random (from freebsd)
* fix some spelos and tyops in comments (some from freebsd)
* use warn() instead of warnx() for many errors; the user probably
wants to know what the error code was.
* knf & whitespace nitpicks
 1.15 15-Nov-1998  christos Restructure the send and recv buffers slightly to avoid lint warnings and
make their treatment symmetric.
 1.14 26-Jul-1998  mycroft constify some tables.
 1.13 13-Feb-1998  lukem * in get_myaddress(); always return sockaddr_in containing localhost:PMAP_PORT.
(as recommended in Weiste Venema's portmap5_beta distribution)
* deprecate register
* use memmove instead of bcopy
* KNF includes
* use err/warn() instead of perror/fprintf(stderr,)
* fix some typos
 1.12 12-Feb-1998  lukem revert; we can't break the existing ABI and API
 1.11 11-Feb-1998  lukem use u_int32_t instead of size_t...
 1.10 10-Feb-1998  lukem major cleanup (to sync with changes made in include/rpc/*.h):
* use int32_t, size_t, in_port_t instead of long, u_int, u_short as appropriate
* use uid_t and gid_t instead of int
* KNF, fix typos and spellos
* use const as appropriate
* deprecate register
* use memmove instead of bcopy
* use err/warn()
 1.9 23-Jan-1998  lukem a memory leak can occur when xdr_replymesg() fails, so XDR_FREE in
this case. originally fixed in freebsd in clnt_udp.c, and similar
change to clnt_raw.c made by openbsd.
 1.8 21-Jul-1997  jtc If port provides __weak_alias(), provide an Standard C and POSIX pure
identifier namespace by renaming non standard functions and variables
such that they have a leading underscore. The library will use those
names internally. Weak aliases are used to provide the original names
to the API.

This is only the first part of this change. It is most of the functions
which are implemented in C for all NetBSD ports. Subsequent changes are
to add the same support to the remaining C files, to assembly files, and
to the automagically generated assembly source used for system calls.
When all of the above is done, ports with weak alias support should add
a definition for __weak_alias to <sys/cdefs.h>.
 1.7 13-Jul-1997  christos Fix RCSID's
Fix gcc warnings.
Add missing prototypes
 1.6 08-Feb-1997  mycroft It's not necessary to initialize the `revents' field of struct pollfd.
 1.5 17-Dec-1996  mrg use poll() instead of select()
 1.4 25-Feb-1995  cgd branches: 1.4.4;
save my sanity; stop using Id.
 1.3 04-Dec-1994  cgd branches: 1.3.2;
be much more careful with types, and add prototype everything.
 1.2 20-Aug-1994  deraadt branches: 1.2.2;
rpc library no longer uses _rpc_dtablesize() internally -- keeps track
of highest active file descriptor. limit fd usage to FD_SETSIZE, until
a better solution is found. remove non-FD_SETSIZE code.
 1.1 07-Oct-1993  cgd move the rpc code into libc
 1.2.2.2 20-Aug-1994  deraadt rpc library no longer uses _rpc_dtablesize() internally -- keeps track
of highest active file descriptor. limit fd usage to FD_SETSIZE, until
a better solution is found. remove non-FD_SETSIZE code.
 1.2.2.1 20-Aug-1994  deraadt file clnt_udp.c was added on branch netbsd-1-0 on 1994-08-20 00:55:29 +0000
 1.3.2.1 02-May-1995  jtc #include "namespace.h"
 1.4.4.1 16-Sep-1996  jtc snapshot namespace cleanup: rpc & xdr
 1.21.2.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.29 23-Jan-2024  christos fix nested extern warnings
 1.28 24-Jan-2022  andvar s/begining/beginning/ in comments and messages.
 1.27 21-Aug-2021  andvar fix mainly same typos as in my previous commit but outside sys/dev/dm.
 1.26 20-Jan-2015  christos Fix non _REENTRANT build.
 1.25 21-Jan-2014  christos Increment to the value, not the pointer. (Thorsten Brehm)
 1.24 17-Oct-2013  christos Avoid casting gymnastics that lead to pointer aliasing by introducing an
inline function.
 1.23 07-May-2013  christos - add __clnt_sigfillset() that does not blindly block all signals but excludes
the tty generated ones (int, quit, tstp), plus term and hup. This makes
command line clients behave on connect(2) where before they would need
to be killed from a different tty. Much easier than making the file
descriptor non-blocking for the duration of connect and then using
pselect/pollts to detect when actual connection or timeout occured using
a different sigmask.
- factor out some of the error paths.
 1.22 17-Apr-2013  christos PR/47747: Thorsten Brehm: TCP-based RPC client calls no longer terminate when
connections break. Return proper error code.
XXX: pullup 6
 1.21 11-Mar-2013  tron Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.

This fixes PR lib/45293 by Pedro Giffuni.
 1.20 05-Mar-2013  christos make this usable from RUMP
 1.19 26-Feb-2013  christos PR/13082: Thorsten Brehm: Fix wrong memcpy that caused possible memory
corruption. XXX: pullup to 6.
 1.18 13-Mar-2012  christos branches: 1.18.2;
PR/45989: Martin Husemann: lint invocation does include -w only on i386

- turn lint -w for all the platforms after fixing the lint warnings.
- add _DIAGASSERTS() for casts that would assign values to types that
would not fit.
- change types, add casts
- change into ansii prototypes
- turn on _DIAGNOSTIC for libc (during current, to be eliminated for release
builds)

approved by core@
 1.17 08-Dec-2010  joerg branches: 1.17.6; 1.17.8; 1.17.12;
Use __isthreaded from reentrant.h and don't redeclare it.
 1.16 12-Feb-2009  uebayasi Enable assertions only when _DIAGNOSTICS is defined, as other libc parts do.
 1.15 25-Apr-2008  christos branches: 1.15.8; 1.15.10;
- always check malloc results
- don't leak fds on error
- don't cast malloc
- don't cast NULL
 1.14 25-Apr-2006  drochner branches: 1.14.18;
fix some unpaired sigblocks which possibly leave the process with all
signals blocked,
this might some problems with the Gnome GUI which uses RPC to communicate
with "fam" (file access monitor), in particular it might fix PR pkg/22483
by jmmv
 1.13 03-Dec-2005  yamt - constify and remove __UNCONST from caller of clnt_call().
- use __UNCONST where approproate.
 1.12 09-Sep-2005  christos Convert the rest of the code to use pollts for consistency. XXX: We should
really use kqueue.
 1.11 30-Dec-2004  christos branches: 1.11.2; 1.11.4;
add size_t casts.
 1.10 09-Sep-2003  itojun use niels provos' random sequence number generator to initialize RPC XID.
 1.9 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.8 08-Nov-2002  fvdl * Adapt include files for rpc_com.h/rpc_internal.h split.
* Add rpc_control to svc.c
* Implement non-blocking connections.
 1.7 04-Jan-2001  lukem branches: 1.7.2; 1.7.4;
sprinkle _DIAGASSERT() appropriately. minor other cleanups
 1.6 20-Dec-2000  christos oops fix previous typos.
 1.5 20-Dec-2000  christos appease lint casts
 1.4 14-Jul-2000  fvdl Use explicit int32 get/put macros. Needed for 64bit big-endian systems.
 1.3 06-Jul-2000  christos add __RPC_GETXID macro
don't const castway __rpc_getconf and __rpc_getconfig. It might try to
write const strings
fix non-portable casts
remove duplicated prototypes
cast things to proper types
remove extraneous casts to NULL
fix variable cast mismatches
remove register var declarations
 1.2 04-Jun-2000  thorpej branches: 1.2.2; 1.2.4;
Get <string.h> so this builds on LP64.
 1.1 02-Jun-2000  fvdl Add new RPC code, based on Sun's TI-RPC code. Adapted to not use XTI,
but sockets instead, internally. Old, backward compatible interfaces
maintained.
 1.2.4.2 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.2.4.1 04-Jun-2000  minoura file clnt_vc.c was added on branch minoura-xpg4dl on 2000-06-23 16:17:42 +0000
 1.2.2.1 14-Jul-2000  fvdl Pullup from trunk: use explicit 32 bit operations and types where
appropriate, to make things work on 64bit BE systems.
 1.7.4.1 06-Jan-2003  jmc Pull up revisions 1.7-1.8 (requested by fvdl in ticket #1037)
* Adapt include files for rpc_com.h/rpc_internal.h split.
* Implement non-blocking connections.
* Add rpc_control to svc.c
 1.7.2.4 11-Nov-2002  nathanw Catch up to -current
 1.7.2.3 18-Dec-2001  nathanw Delint by changing some int variables to size_t.
 1.7.2.2 04-Sep-2001  nathanw Correct some uses of uninitialized variables inside _REENTRANT code.
Makes nfsd, mountd, rpcbind, etc. work.
 1.7.2.1 08-Aug-2001  nathanw Convert to our threading style.
__REENT -> _REENTRANT
Statically initialize mutexes.
Use pthread thread-specific data semantics and once_t instead of Sun thread
semantics.
Use __isthreaded to detect presence of thread universe instead of _thr_main().
 1.11.4.1 28-Apr-2006  riz Pull up following revision(s) (requested by drochner in ticket #1293):
lib/libc/rpc/clnt_vc.c: revision 1.14
fix some unpaired sigblocks which possibly leave the process with all
signals blocked,
this might some problems with the Gnome GUI which uses RPC to communicate
with "fam" (file access monitor), in particular it might fix PR pkg/22483
by jmmv
 1.11.2.1 28-Apr-2006  riz Pull up following revision(s) (requested by drochner in ticket #1293):
lib/libc/rpc/clnt_vc.c: revision 1.14
fix some unpaired sigblocks which possibly leave the process with all
signals blocked,
this might some problems with the Gnome GUI which uses RPC to communicate
with "fam" (file access monitor), in particular it might fix PR pkg/22483
by jmmv
 1.14.18.1 18-May-2008  yamt sync with head.
 1.15.10.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.15.8.2 25-Apr-2008  christos - always check malloc results
- don't leak fds on error
- don't cast malloc
- don't cast NULL
 1.15.8.1 25-Apr-2008  christos file clnt_vc.c was added on branch christos-time_t on 2008-04-25 17:44:45 +0000
 1.17.12.3 20-Apr-2013  bouyer Revert ticket 875, it doesn't applies to netbsd-6 (the bug was introduced
in 1.18, netbsd-6 is at 1.17)
 1.17.12.2 20-Apr-2013  bouyer Pull up following revision(s) (requested by christos in ticket #875):
lib/libc/rpc/clnt_vc.c: revision 1.22
PR/47747: Thorsten Brehm: TCP-based RPC client calls no longer terminate when
connections break. Return proper error code.
XXX: pullup 6
 1.17.12.1 31-Mar-2013  riz Pull up following revision(s) (requested by christos in ticket #854):
lib/libc/rpc/clnt_vc.c: revision 1.19
PR/13082: Thorsten Brehm: Fix wrong memcpy that caused possible memory
corruption. XXX: pullup to 6.
 1.17.8.4 20-Apr-2013  bouyer Revert ticket 875, it doesn't applies to netbsd-6 (the bug was introduced
in 1.18, netbsd-6 is at 1.17)
 1.17.8.3 20-Apr-2013  bouyer Pull up following revision(s) (requested by christos in ticket #875):
lib/libc/rpc/clnt_vc.c: revision 1.22
PR/47747: Thorsten Brehm: TCP-based RPC client calls no longer terminate when
connections break. Return proper error code.
XXX: pullup 6
 1.17.8.2 31-Mar-2013  riz Pull up following revision(s) (requested by christos in ticket #854):
lib/libc/rpc/clnt_vc.c: revision 1.19
PR/13082: Thorsten Brehm: Fix wrong memcpy that caused possible memory
corruption. XXX: pullup to 6.
 1.17.8.1 14-Mar-2013  riz Pull up following revision(s) (requested by tron in ticket #843):
lib/libc/rpc/clnt_dg.c: revision 1.28
lib/libc/rpc/xdr_sizeof.c: revision 1.5
lib/libc/rpc/pmap_getport.c: revision 1.19
lib/libc/rpc/xdr_mem.c: revision 1.19
lib/libc/rpc/svc_run.c: revision 1.22
lib/libc/rpc/bindresvport.c: revision 1.25
lib/libc/rpc/svc_raw.c: revision 1.24
lib/libc/rpc/svc_dg.c: revision 1.17
lib/libc/rpc/getnetconfig.c: revision 1.21
lib/libc/rpc/auth_unix.c: revision 1.25
lib/libc/rpc/svc_auth.c: revision 1.17
lib/libc/rpc/clnt_vc.c: revision 1.21
lib/libc/rpc/svc_auth_unix.c: revision 1.21
lib/libc/rpc/rpcb_st_xdr.c: revision 1.10
lib/libc/rpc/pmap_getmaps.c: revision 1.18
lib/libc/rpc/getnetpath.c: revision 1.17
lib/libc/rpc/clnt_simple.c: revision 1.32
lib/libc/rpc/authunix_prot.c: revision 1.16
lib/libc/rpc/svc_dg.h: revision 1.2
lib/libc/rpc/svc_generic.c: revision 1.15
lib/libc/rpc/clnt_raw.c: revision 1.32
lib/libc/rpc/xdr_array.c: revision 1.19
lib/libc/rpc/pmap_prot.c: revision 1.12
lib/libc/rpc/clnt_bcast.c: revision 1.26
lib/libc/rpc/xdr_rec.c: revision 1.35
lib/libc/rpc/svc.c: revision 1.34
lib/libc/rpc/DISCLAIMER: revision 1.3
lib/libc/rpc/clnt_generic.c: revision 1.30
lib/libc/rpc/xdr.c: revision 1.33
lib/libc/rpc/auth_none.c: revision 1.16
lib/libc/rpc/pmap_rmt.c: revision 1.34
lib/libc/rpc/rpc_callmsg.c: revision 1.20
lib/libc/rpc/clnt_perror.c: revision 1.30
lib/libc/rpc/xdr_stdio.c: revision 1.19
lib/libc/rpc/rpc_commondata.c: revision 1.9
lib/libc/rpc/pmap_prot2.c: revision 1.17
lib/libc/rpc/pmap_clnt.c: revision 1.19
lib/libc/rpc/svc_simple.c: revision 1.33
lib/libc/rpc/rpcb_clnt.c: revision 1.29
lib/libc/rpc/rpc_prot.c: revision 1.21
lib/libc/rpc/rpc_dtablesize.c: revision 1.16
lib/libc/rpc/rpc_generic.c: revision 1.28
lib/libc/rpc/xdr_reference.c: revision 1.18
lib/libc/rpc/rpc_soc.c: revision 1.18
lib/libc/rpc/svc_vc.c: revision 1.30
lib/libc/rpc/getrpcent.c: revision 1.23
lib/libc/rpc/xdr_float.c: revision 1.38
lib/libc/rpc/rpcb_prot.c: revision 1.11
lib/libc/rpc/getrpcport.c: revision 1.18
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.
This fixes PR lib/45293 by Pedro Giffuni.
 1.17.6.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.17.6.1 17-Apr-2012  yamt sync with head
 1.18.2.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.18.2.1 23-Jun-2013  tls resync from head
 1.12 02-Jun-2000  fvdl Add new RPC code, based on Sun's TI-RPC code. Adapted to not use XTI,
but sockets instead, internally. Old, backward compatible interfaces
maintained.
 1.11 22-Jan-2000  mycroft branches: 1.11.2;
Delint.
Remove trailing ; from uses of __weak_alias(). The macro inserts this if
needed.
 1.10 20-Sep-1999  lukem back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.9 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.8 13-Feb-1998  lukem * in get_myaddress(); always return sockaddr_in containing localhost:PMAP_PORT.
(as recommended in Weiste Venema's portmap5_beta distribution)
* deprecate register
* use memmove instead of bcopy
* KNF includes
* use err/warn() instead of perror/fprintf(stderr,)
* fix some typos
 1.7 12-Feb-1998  lukem revert; we can't break the existing ABI and API
 1.6 10-Feb-1998  lukem major cleanup (to sync with changes made in include/rpc/*.h):
* use int32_t, size_t, in_port_t instead of long, u_int, u_short as appropriate
* use uid_t and gid_t instead of int
* KNF, fix typos and spellos
* use const as appropriate
* deprecate register
* use memmove instead of bcopy
* use err/warn()
 1.5 21-Jul-1997  jtc If port provides __weak_alias(), provide an Standard C and POSIX pure
identifier namespace by renaming non standard functions and variables
such that they have a leading underscore. The library will use those
names internally. Weak aliases are used to provide the original names
to the API.

This is only the first part of this change. It is most of the functions
which are implemented in C for all NetBSD ports. Subsequent changes are
to add the same support to the remaining C files, to assembly files, and
to the automagically generated assembly source used for system calls.
When all of the above is done, ports with weak alias support should add
a definition for __weak_alias to <sys/cdefs.h>.
 1.4 13-Jul-1997  christos Fix RCSID's
Fix gcc warnings.
Add missing prototypes
 1.3 04-Jan-1996  pk branches: 1.3.2;
1) Agree with kernel on format of SIOCGIFCONF results.
2) Return non-zero on error, so RPC clients do not die unexpectedly.
 1.2 25-Feb-1995  cgd save my sanity; stop using Id.
 1.1 07-Oct-1993  cgd branches: 1.1.4;
move the rpc code into libc
 1.1.4.1 02-May-1995  jtc #include "namespace.h"
 1.3.2.1 16-Sep-1996  jtc snapshot namespace cleanup: rpc & xdr
 1.11.2.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.7 16-Apr-2003  wiz Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
 1.6 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.5 18-Dec-2002  wiz Fn arguments do not need (empty) braces.
 1.4 07-Dec-2002  jdolecek Add description of struct netconfig.
This adresses PR lib/18501 by Benedikt Meurer

While here, finish mdocifying of the manpage. There is no .B, .I, .SB
in mdoc, and some items were missing in output due to that.
 1.3 07-Feb-2002  ross Generate <>& symbolically.
 1.2 09-Apr-2001  wiz netconfig(5), not (4), and whitespace fixes.
 1.1 02-Jun-2000  fvdl branches: 1.1.2; 1.1.4; 1.1.6;
Add new RPC code, based on Sun's TI-RPC code. Adapted to not use XTI,
but sockets instead, internally. Old, backward compatible interfaces
maintained.
 1.1.6.5 19-Dec-2002  thorpej Sync with HEAD.
 1.1.6.4 10-Dec-2002  thorpej Sync with HEAD.
 1.1.6.3 22-Mar-2002  nathanw Catch up to -current.
 1.1.6.2 08-Mar-2002  nathanw Catch up to -current.
 1.1.6.1 08-Oct-2001  nathanw Catch up to -current.
 1.1.4.2 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 02-Jun-2000  minoura file getnetconfig.3 was added on branch minoura-xpg4dl on 2000-06-23 16:17:42 +0000
 1.1.2.1 26-Apr-2001  he Pull up revision 1.2 (requested by wiz):
Correct netconfig(5) reference and whitespace fixes.
 1.25 30-Jun-2017  christos Revert previous since it causes a double free (p->nc_netid == tmp == tmp2).
From Xin Li @ FreeBSD.
XXX: pullup 7
 1.24 26-Oct-2016  christos PR/51578: Henning Petersen: Fix leak on error.
 1.23 26-Oct-2016  christos KNF, no real change (except malloc(x * y) -> calloc(x, y))
 1.22 18-Sep-2014  christos branches: 1.22.2;
make more descriptors that we open as close-on-exec
 1.21 11-Mar-2013  tron Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.

This fixes PR lib/45293 by Pedro Giffuni.
 1.20 20-Mar-2012  matt branches: 1.20.2;
Use C89 definitions
Remove use of __P
 1.19 15-Oct-2011  christos branches: 1.19.2; 1.19.4;
close on exec fixes:
- open + fcntl -> open O_CLOEXEC
- configuration database file descriptors that can stay open are now opened
fopen(db, "re")
 1.18 08-Dec-2010  joerg Use __isthreaded from reentrant.h and don't redeclare it.
 1.17 25-Apr-2008  christos branches: 1.17.8;
- always check malloc results
- don't leak fds on error
- don't cast malloc
- don't cast NULL
 1.16 17-Jan-2007  hubertf branches: 1.16.10;
Remove more duplicate #includes, and a few spurious whitespaces at EOL
From Slava Semushin <slava.semushin@gmail.com>
 1.15 19-Mar-2006  christos Coverity CID 2275: Avoid memory leak on error.
 1.14 29-Nov-2005  christos WARNS=4
 1.13 15-May-2005  dsl Make the arg to getnetconfigent const char * to match the man page (and
likely calling code).
 1.12 09-Sep-2003  itojun __RCSID police
 1.11 29-Apr-2003  scw The second parameter of strchr() is an integer, not a pointer.
So use '\0' instead of NULL.
 1.10 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.9 11-Nov-2002  thorpej Fix signed/unsigned comparison warnings.
 1.8 08-Nov-2002  fvdl * Adapt include files for rpc_com.h/rpc_internal.h split.
* Add rpc_control to svc.c
* Implement non-blocking connections.
 1.7 26-Jul-2001  wiz branches: 1.7.2;
Various typos in comments (neccessary, sceme, choise, ...).
 1.6 25-Jan-2001  jdolecek branches: 1.6.2;
make local constant arrays const
 1.5 04-Jan-2001  lukem whitespace consistency fixups
 1.4 04-Jan-2001  lukem sprinkle _DIAGASSERT() appropriately. minor other cleanups
 1.3 06-Jul-2000  christos add __RPC_GETXID macro
don't const castway __rpc_getconf and __rpc_getconfig. It might try to
write const strings
fix non-portable casts
remove duplicated prototypes
cast things to proper types
remove extraneous casts to NULL
fix variable cast mismatches
remove register var declarations
 1.2 03-Jul-2000  christos PR/10499: IWAMOTO Toshihiro: getnetconfig uses strtok. Applied suggested patch
to use strtok_r
 1.1 02-Jun-2000  fvdl branches: 1.1.2; 1.1.4;
Add new RPC code, based on Sun's TI-RPC code. Adapted to not use XTI,
but sockets instead, internally. Old, backward compatible interfaces
maintained.
 1.1.4.2 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 02-Jun-2000  minoura file getnetconfig.c was added on branch minoura-xpg4dl on 2000-06-23 16:17:43 +0000
 1.1.2.1 03-Jul-2000  thorpej Pull up rev. 1.2:
PR/10499: IWAMOTO Toshihiro: getnetconfig uses strtok. Applied suggested patch
to use strtok_r
 1.6.2.4 06-Jan-2003  thorpej Don't use thr_once() unless we know we're threaded.
 1.6.2.3 11-Nov-2002  nathanw Catch up to -current
 1.6.2.2 08-Oct-2001  nathanw Catch up to -current.
 1.6.2.1 08-Aug-2001  nathanw Convert to our threading style.
__REENT -> _REENTRANT
Statically initialize mutexes.
Use pthread thread-specific data semantics and once_t instead of Sun thread
semantics.
Use __isthreaded to detect presence of thread universe instead of _thr_main().
 1.7.2.1 06-Jan-2003  jmc Pull up revisions 1.7-1.8 (requested by fvdl in ticket #1037)
* Adapt include files for rpc_com.h/rpc_internal.h split.
* Implement non-blocking connections.
* Add rpc_control to svc.c
 1.16.10.1 18-May-2008  yamt sync with head.
 1.17.8.2 25-Apr-2008  christos - always check malloc results
- don't leak fds on error
- don't cast malloc
- don't cast NULL
 1.17.8.1 25-Apr-2008  christos file getnetconfig.c was added on branch christos-time_t on 2008-04-25 17:44:45 +0000
 1.19.4.1 14-Mar-2013  riz Pull up following revision(s) (requested by tron in ticket #843):
lib/libc/rpc/clnt_dg.c: revision 1.28
lib/libc/rpc/xdr_sizeof.c: revision 1.5
lib/libc/rpc/pmap_getport.c: revision 1.19
lib/libc/rpc/xdr_mem.c: revision 1.19
lib/libc/rpc/svc_run.c: revision 1.22
lib/libc/rpc/bindresvport.c: revision 1.25
lib/libc/rpc/svc_raw.c: revision 1.24
lib/libc/rpc/svc_dg.c: revision 1.17
lib/libc/rpc/getnetconfig.c: revision 1.21
lib/libc/rpc/auth_unix.c: revision 1.25
lib/libc/rpc/svc_auth.c: revision 1.17
lib/libc/rpc/clnt_vc.c: revision 1.21
lib/libc/rpc/svc_auth_unix.c: revision 1.21
lib/libc/rpc/rpcb_st_xdr.c: revision 1.10
lib/libc/rpc/pmap_getmaps.c: revision 1.18
lib/libc/rpc/getnetpath.c: revision 1.17
lib/libc/rpc/clnt_simple.c: revision 1.32
lib/libc/rpc/authunix_prot.c: revision 1.16
lib/libc/rpc/svc_dg.h: revision 1.2
lib/libc/rpc/svc_generic.c: revision 1.15
lib/libc/rpc/clnt_raw.c: revision 1.32
lib/libc/rpc/xdr_array.c: revision 1.19
lib/libc/rpc/pmap_prot.c: revision 1.12
lib/libc/rpc/clnt_bcast.c: revision 1.26
lib/libc/rpc/xdr_rec.c: revision 1.35
lib/libc/rpc/svc.c: revision 1.34
lib/libc/rpc/DISCLAIMER: revision 1.3
lib/libc/rpc/clnt_generic.c: revision 1.30
lib/libc/rpc/xdr.c: revision 1.33
lib/libc/rpc/auth_none.c: revision 1.16
lib/libc/rpc/pmap_rmt.c: revision 1.34
lib/libc/rpc/rpc_callmsg.c: revision 1.20
lib/libc/rpc/clnt_perror.c: revision 1.30
lib/libc/rpc/xdr_stdio.c: revision 1.19
lib/libc/rpc/rpc_commondata.c: revision 1.9
lib/libc/rpc/pmap_prot2.c: revision 1.17
lib/libc/rpc/pmap_clnt.c: revision 1.19
lib/libc/rpc/svc_simple.c: revision 1.33
lib/libc/rpc/rpcb_clnt.c: revision 1.29
lib/libc/rpc/rpc_prot.c: revision 1.21
lib/libc/rpc/rpc_dtablesize.c: revision 1.16
lib/libc/rpc/rpc_generic.c: revision 1.28
lib/libc/rpc/xdr_reference.c: revision 1.18
lib/libc/rpc/rpc_soc.c: revision 1.18
lib/libc/rpc/svc_vc.c: revision 1.30
lib/libc/rpc/getrpcent.c: revision 1.23
lib/libc/rpc/xdr_float.c: revision 1.38
lib/libc/rpc/rpcb_prot.c: revision 1.11
lib/libc/rpc/getrpcport.c: revision 1.18
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.
This fixes PR lib/45293 by Pedro Giffuni.
 1.19.2.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.19.2.1 17-Apr-2012  yamt sync with head
 1.20.2.1 23-Jun-2013  tls resync from head
 1.22.2.1 04-Nov-2016  pgoyette Sync with HEAD
 1.7 04-Dec-2022  uwe getnetpath(3): Sprinkle some markup
 1.6 16-Apr-2003  wiz Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
 1.5 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.4 01-Oct-2002  wiz New sentence, new line. From Robert Elz.
 1.3 07-Feb-2002  ross Generate <>& symbolically.
 1.2 09-Apr-2001  wiz netconfig(5), not (4); environ(7), not (5); whitespace, and use
.Dq instead of ``xx.''
 1.1 02-Jun-2000  fvdl branches: 1.1.2; 1.1.4; 1.1.6;
Add new RPC code, based on Sun's TI-RPC code. Adapted to not use XTI,
but sockets instead, internally. Old, backward compatible interfaces
maintained.
 1.1.6.4 18-Oct-2002  nathanw Catch up to -current.
 1.1.6.3 22-Mar-2002  nathanw Catch up to -current.
 1.1.6.2 08-Mar-2002  nathanw Catch up to -current.
 1.1.6.1 08-Oct-2001  nathanw Catch up to -current.
 1.1.4.2 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 02-Jun-2000  minoura file getnetpath.3 was added on branch minoura-xpg4dl on 2000-06-23 16:17:43 +0000
 1.1.2.1 26-Apr-2001  he Pull up revision 1.2 (requested by wiz):
Correct netconfig(5) and environ(7) references. Also whitespace
and some other minor fixes.
 1.18 04-Jan-2022  andvar s/compnent/component/
 1.17 11-Mar-2013  tron Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.

This fixes PR lib/45293 by Pedro Giffuni.
 1.16 25-Jun-2012  abs branches: 1.16.2;
Update old-style definitions to ANSI, remove a couple of register
definitions along the way. Fixed gcc 4.1 build (thank you vax)
 1.15 20-Mar-2012  matt Use C89 definitions
Remove use of __P
 1.14 24-May-2008  christos branches: 1.14.2; 1.14.6; 1.14.22;
Coverity CID 5028: Fix memory leak.
 1.13 25-Apr-2008  christos branches: 1.13.2;
- always check malloc results
- don't leak fds on error
- don't cast malloc
- don't cast NULL
 1.12 03-Feb-2007  christos branches: 1.12.10;
Compile with DIAGNOSTIC
 1.11 17-Jan-2007  hubertf Remove more duplicate #includes, and a few spurious whitespaces at EOL
From Slava Semushin <slava.semushin@gmail.com>
 1.10 19-Mar-2006  christos Coverity CID 2276: Don't leak memory on error.
 1.9 09-Feb-2005  kleink A little libc namespace housekeeping exercise:
* Make vfprintf_unlocked() an internal function, c.f. __svfscanf_unlocked().
* Add internal names for arc4random(), endnetpath(), fhstatvfs(),
fstatvfs(), mkstemp(), shquote(), statvfs(), taddr2uaddr(), uaddr2taddr(),
uuid_create_nil(), uuid_is_nil(), and wcwidth().
* Include namespace.h where supposed to.
 1.8 09-Sep-2003  itojun __RCSID police
 1.7 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.6 16-Apr-2002  groo Make sure we don't look before the beginning of the string.
from xs@kittenz.org
 1.5 04-Jan-2001  lukem branches: 1.5.2;
whitespace consistency fixups
 1.4 04-Jan-2001  lukem sprinkle _DIAGASSERT() appropriately. minor other cleanups
 1.3 06-Jul-2000  christos add __RPC_GETXID macro
don't const castway __rpc_getconf and __rpc_getconfig. It might try to
write const strings
fix non-portable casts
remove duplicated prototypes
cast things to proper types
remove extraneous casts to NULL
fix variable cast mismatches
remove register var declarations
 1.2 11-Jun-2000  assar branches: 1.2.2; 1.2.4;
syslog an error if /etc/netconfig is not found. fixes lib/10275
 1.1 02-Jun-2000  fvdl Add new RPC code, based on Sun's TI-RPC code. Adapted to not use XTI,
but sockets instead, internally. Old, backward compatible interfaces
maintained.
 1.2.4.2 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.2.4.1 11-Jun-2000  minoura file getnetpath.c was added on branch minoura-xpg4dl on 2000-06-23 16:17:43 +0000
 1.2.2.1 17-Apr-2002  he Pull up revision 1.6 (via patch, requested by groo):
Make sure we do not look before the beginning of the string.
 1.5.2.1 25-Apr-2002  nathanw Catch up to -current.
 1.12.10.2 04-Jun-2008  yamt sync with head
 1.12.10.1 18-May-2008  yamt sync with head.
 1.13.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.14.22.1 14-Mar-2013  riz Pull up following revision(s) (requested by tron in ticket #843):
lib/libc/rpc/clnt_dg.c: revision 1.28
lib/libc/rpc/xdr_sizeof.c: revision 1.5
lib/libc/rpc/pmap_getport.c: revision 1.19
lib/libc/rpc/xdr_mem.c: revision 1.19
lib/libc/rpc/svc_run.c: revision 1.22
lib/libc/rpc/bindresvport.c: revision 1.25
lib/libc/rpc/svc_raw.c: revision 1.24
lib/libc/rpc/svc_dg.c: revision 1.17
lib/libc/rpc/getnetconfig.c: revision 1.21
lib/libc/rpc/auth_unix.c: revision 1.25
lib/libc/rpc/svc_auth.c: revision 1.17
lib/libc/rpc/clnt_vc.c: revision 1.21
lib/libc/rpc/svc_auth_unix.c: revision 1.21
lib/libc/rpc/rpcb_st_xdr.c: revision 1.10
lib/libc/rpc/pmap_getmaps.c: revision 1.18
lib/libc/rpc/getnetpath.c: revision 1.17
lib/libc/rpc/clnt_simple.c: revision 1.32
lib/libc/rpc/authunix_prot.c: revision 1.16
lib/libc/rpc/svc_dg.h: revision 1.2
lib/libc/rpc/svc_generic.c: revision 1.15
lib/libc/rpc/clnt_raw.c: revision 1.32
lib/libc/rpc/xdr_array.c: revision 1.19
lib/libc/rpc/pmap_prot.c: revision 1.12
lib/libc/rpc/clnt_bcast.c: revision 1.26
lib/libc/rpc/xdr_rec.c: revision 1.35
lib/libc/rpc/svc.c: revision 1.34
lib/libc/rpc/DISCLAIMER: revision 1.3
lib/libc/rpc/clnt_generic.c: revision 1.30
lib/libc/rpc/xdr.c: revision 1.33
lib/libc/rpc/auth_none.c: revision 1.16
lib/libc/rpc/pmap_rmt.c: revision 1.34
lib/libc/rpc/rpc_callmsg.c: revision 1.20
lib/libc/rpc/clnt_perror.c: revision 1.30
lib/libc/rpc/xdr_stdio.c: revision 1.19
lib/libc/rpc/rpc_commondata.c: revision 1.9
lib/libc/rpc/pmap_prot2.c: revision 1.17
lib/libc/rpc/pmap_clnt.c: revision 1.19
lib/libc/rpc/svc_simple.c: revision 1.33
lib/libc/rpc/rpcb_clnt.c: revision 1.29
lib/libc/rpc/rpc_prot.c: revision 1.21
lib/libc/rpc/rpc_dtablesize.c: revision 1.16
lib/libc/rpc/rpc_generic.c: revision 1.28
lib/libc/rpc/xdr_reference.c: revision 1.18
lib/libc/rpc/rpc_soc.c: revision 1.18
lib/libc/rpc/svc_vc.c: revision 1.30
lib/libc/rpc/getrpcent.c: revision 1.23
lib/libc/rpc/xdr_float.c: revision 1.38
lib/libc/rpc/rpcb_prot.c: revision 1.11
lib/libc/rpc/getrpcport.c: revision 1.18
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.
This fixes PR lib/45293 by Pedro Giffuni.
 1.14.6.2 24-May-2008  christos Coverity CID 5028: Fix memory leak.
 1.14.6.1 24-May-2008  christos file getnetpath.c was added on branch christos-time_t on 2008-05-24 16:04:16 +0000
 1.14.2.3 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.14.2.2 30-Oct-2012  yamt sync with head
 1.14.2.1 17-Apr-2012  yamt sync with head
 1.16.2.1 23-Jun-2013  tls resync from head
 1.15 04-Dec-2022  uwe Sections 2 and 3 have RETURN VALUES, not DIAGNOSTICS
 1.14 16-Aug-2004  wiz Bump date for const change.
 1.13 16-Aug-2004  ginsbach * add const qualifier making getrpcbyname() and getrpcbyname_r()
prototypes match those used in latest Sun RPC code (TI-RPC 2.3)
* modify function getrpcbyname() definition as appropriate
 1.12 16-Apr-2003  wiz Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
 1.11 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.10 01-Oct-2002  wiz New sentence, new line. From Robert Elz.
 1.9 07-Feb-2002  ross Generate <>& symbolically.
 1.8 16-Sep-2001  wiz Sort sections.
 1.7 16-Sep-2001  wiz Boring whitespace fixes.
 1.6 05-Feb-1998  perry branches: 1.6.12;
add LIBRARY section to man page
 1.5 02-Feb-1998  perry <netdb.h> -> <rpc/rpc.h>
 1.4 16-Dec-1997  mikel fix pasto (s/getpwent/getrpcent/); from Tobias Weingartner
 1.3 08-Mar-1997  mouse alternate -> alternative, per PR 2643
 1.2 25-Feb-1995  cgd save my sanity; stop using Id.
 1.1 07-Oct-1993  cgd move the rpc code into libc
 1.6.12.4 18-Oct-2002  nathanw Catch up to -current.
 1.6.12.3 22-Mar-2002  nathanw Catch up to -current.
 1.6.12.2 08-Mar-2002  nathanw Catch up to -current.
 1.6.12.1 08-Oct-2001  nathanw Catch up to -current.
 1.24 13-Apr-2021  mrg pass dest buffer size to strncpy() and ensure nul termination.
 1.23 11-Mar-2013  tron Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.

This fixes PR lib/45293 by Pedro Giffuni.
 1.22 15-Oct-2011  christos branches: 1.22.2; 1.22.4; 1.22.8;
close on exec fixes:
- open + fcntl -> open O_CLOEXEC
- configuration database file descriptors that can stay open are now opened
fopen(db, "re")
 1.21 16-Aug-2004  ginsbach * add const qualifier making getrpcbyname() and getrpcbyname_r()
prototypes match those used in latest Sun RPC code (TI-RPC 2.3)
* modify function getrpcbyname() definition as appropriate
 1.20 05-Aug-2004  ginsbach Use ANSI function decls.
 1.19 02-Aug-2004  ginsbach Fix getrpcbyname() alias lookups. Closes PR lib/23294; reviewed by <christos>.
 1.18 04-Jan-2001  lukem branches: 1.18.6;
whitespace consistency fixups
 1.17 22-Jan-2000  mycroft Delint.
Remove trailing ; from uses of __weak_alias(). The macro inserts this if
needed.
 1.16 20-Sep-1999  lukem back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.15 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.14 19-Apr-1999  kleink Declare more local items static.
 1.13 15-Nov-1998  christos delint
 1.12 26-Jul-1998  mycroft const poisoning.
 1.11 13-Feb-1998  lukem * in get_myaddress(); always return sockaddr_in containing localhost:PMAP_PORT.
(as recommended in Weiste Venema's portmap5_beta distribution)
* deprecate register
* use memmove instead of bcopy
* KNF includes
* use err/warn() instead of perror/fprintf(stderr,)
* fix some typos
 1.10 12-Feb-1998  lukem revert; we can't break the existing ABI and API
 1.9 10-Feb-1998  lukem major cleanup (to sync with changes made in include/rpc/*.h):
* use int32_t, size_t, in_port_t instead of long, u_int, u_short as appropriate
* use uid_t and gid_t instead of int
* KNF, fix typos and spellos
* use const as appropriate
* deprecate register
* use memmove instead of bcopy
* use err/warn()
 1.8 21-Jul-1997  jtc If port provides __weak_alias(), provide an Standard C and POSIX pure
identifier namespace by renaming non standard functions and variables
such that they have a leading underscore. The library will use those
names internally. Weak aliases are used to provide the original names
to the API.

This is only the first part of this change. It is most of the functions
which are implemented in C for all NetBSD ports. Subsequent changes are
to add the same support to the remaining C files, to assembly files, and
to the automagically generated assembly source used for system calls.
When all of the above is done, ports with weak alias support should add
a definition for __weak_alias to <sys/cdefs.h>.
 1.7 13-Jul-1997  christos Fix RCSID's
Fix gcc warnings.
Add missing prototypes
 1.6 13-Mar-1997  mycroft Make sure /etc/rpc is *closed* when we're done.
 1.5 20-Dec-1996  cgd pull in netdb.h and arpa/inet.h, kill local decls. add interpret() proto
 1.4 25-Feb-1995  cgd branches: 1.4.4;
save my sanity; stop using Id.
 1.3 04-Dec-1994  cgd be much more careful with types, and add prototype everything.
 1.2 15-Sep-1994  deraadt Kill the YP code.
 1.1 07-Oct-1993  cgd branches: 1.1.2;
move the rpc code into libc
 1.1.2.1 16-Sep-1994  cgd from trunk, per theo.
 1.4.4.1 16-Sep-1996  jtc snapshot namespace cleanup: rpc & xdr
 1.18.6.1 11-Aug-2004  jmc Pullup rev 1.19 (requested by ginsbach in ticket #737)

Fix a long standing bug in getrpcbyname() where it would not find any matches when an alias was used. PR#23294
 1.22.8.1 23-Jun-2013  tls resync from head
 1.22.4.1 14-Mar-2013  riz Pull up following revision(s) (requested by tron in ticket #843):
lib/libc/rpc/clnt_dg.c: revision 1.28
lib/libc/rpc/xdr_sizeof.c: revision 1.5
lib/libc/rpc/pmap_getport.c: revision 1.19
lib/libc/rpc/xdr_mem.c: revision 1.19
lib/libc/rpc/svc_run.c: revision 1.22
lib/libc/rpc/bindresvport.c: revision 1.25
lib/libc/rpc/svc_raw.c: revision 1.24
lib/libc/rpc/svc_dg.c: revision 1.17
lib/libc/rpc/getnetconfig.c: revision 1.21
lib/libc/rpc/auth_unix.c: revision 1.25
lib/libc/rpc/svc_auth.c: revision 1.17
lib/libc/rpc/clnt_vc.c: revision 1.21
lib/libc/rpc/svc_auth_unix.c: revision 1.21
lib/libc/rpc/rpcb_st_xdr.c: revision 1.10
lib/libc/rpc/pmap_getmaps.c: revision 1.18
lib/libc/rpc/getnetpath.c: revision 1.17
lib/libc/rpc/clnt_simple.c: revision 1.32
lib/libc/rpc/authunix_prot.c: revision 1.16
lib/libc/rpc/svc_dg.h: revision 1.2
lib/libc/rpc/svc_generic.c: revision 1.15
lib/libc/rpc/clnt_raw.c: revision 1.32
lib/libc/rpc/xdr_array.c: revision 1.19
lib/libc/rpc/pmap_prot.c: revision 1.12
lib/libc/rpc/clnt_bcast.c: revision 1.26
lib/libc/rpc/xdr_rec.c: revision 1.35
lib/libc/rpc/svc.c: revision 1.34
lib/libc/rpc/DISCLAIMER: revision 1.3
lib/libc/rpc/clnt_generic.c: revision 1.30
lib/libc/rpc/xdr.c: revision 1.33
lib/libc/rpc/auth_none.c: revision 1.16
lib/libc/rpc/pmap_rmt.c: revision 1.34
lib/libc/rpc/rpc_callmsg.c: revision 1.20
lib/libc/rpc/clnt_perror.c: revision 1.30
lib/libc/rpc/xdr_stdio.c: revision 1.19
lib/libc/rpc/rpc_commondata.c: revision 1.9
lib/libc/rpc/pmap_prot2.c: revision 1.17
lib/libc/rpc/pmap_clnt.c: revision 1.19
lib/libc/rpc/svc_simple.c: revision 1.33
lib/libc/rpc/rpcb_clnt.c: revision 1.29
lib/libc/rpc/rpc_prot.c: revision 1.21
lib/libc/rpc/rpc_dtablesize.c: revision 1.16
lib/libc/rpc/rpc_generic.c: revision 1.28
lib/libc/rpc/xdr_reference.c: revision 1.18
lib/libc/rpc/rpc_soc.c: revision 1.18
lib/libc/rpc/svc_vc.c: revision 1.30
lib/libc/rpc/getrpcent.c: revision 1.23
lib/libc/rpc/xdr_float.c: revision 1.38
lib/libc/rpc/rpcb_prot.c: revision 1.11
lib/libc/rpc/getrpcport.c: revision 1.18
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.
This fixes PR lib/45293 by Pedro Giffuni.
 1.22.2.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.5 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.4 01-Oct-2002  wiz New sentence, new line. From Robert Elz.
 1.3 05-Feb-1998  perry branches: 1.3.12;
add LIBRARY section to man page
 1.2 25-Feb-1995  cgd save my sanity; stop using Id.
 1.1 07-Oct-1993  cgd move the rpc code into libc
 1.3.12.1 18-Oct-2002  nathanw Catch up to -current.
 1.18 11-Mar-2013  tron Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.

This fixes PR lib/45293 by Pedro Giffuni.
 1.17 20-Mar-2012  matt branches: 1.17.2;
Use C89 definitions
Remove use of __P
 1.16 22-Jan-2000  mycroft branches: 1.16.64; 1.16.66;
Delint.
Remove trailing ; from uses of __weak_alias(). The macro inserts this if
needed.
 1.15 20-Sep-1999  lukem back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.14 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.13 15-Nov-1998  christos delint:
- memmove -> memcpy
- check that we don't get a bogus h->h_length
 1.12 13-Feb-1998  lukem * in get_myaddress(); always return sockaddr_in containing localhost:PMAP_PORT.
(as recommended in Weiste Venema's portmap5_beta distribution)
* deprecate register
* use memmove instead of bcopy
* KNF includes
* use err/warn() instead of perror/fprintf(stderr,)
* fix some typos
 1.11 12-Feb-1998  lukem revert; we can't break the existing ABI and API
 1.10 10-Feb-1998  lukem major cleanup (to sync with changes made in include/rpc/*.h):
* use int32_t, size_t, in_port_t instead of long, u_int, u_short as appropriate
* use uid_t and gid_t instead of int
* KNF, fix typos and spellos
* use const as appropriate
* deprecate register
* use memmove instead of bcopy
* use err/warn()
 1.9 21-Jul-1997  jtc If port provides __weak_alias(), provide an Standard C and POSIX pure
identifier namespace by renaming non standard functions and variables
such that they have a leading underscore. The library will use those
names internally. Weak aliases are used to provide the original names
to the API.

This is only the first part of this change. It is most of the functions
which are implemented in C for all NetBSD ports. Subsequent changes are
to add the same support to the remaining C files, to assembly files, and
to the automagically generated assembly source used for system calls.
When all of the above is done, ports with weak alias support should add
a definition for __weak_alias to <sys/cdefs.h>.
 1.8 13-Jul-1997  christos Fix RCSID's
Fix gcc warnings.
Add missing prototypes
 1.7 20-Dec-1996  cgd pull in rpc/pmap_clnt.h for protos
 1.6 29-Mar-1996  jtc branches: 1.6.2;
Add explict function return types
 1.5 03-Jun-1995  mycroft Fill in sin_len.
 1.4 14-Apr-1995  jtc Changed bzero to memset.
Changed bcmp to memcmp.
Added #include <string.h> to bring prototypes into scope.
 1.3 25-Feb-1995  cgd save my sanity; stop using Id.
 1.2 05-Dec-1993  deraadt should bzero automatic sockaddr's before use
 1.1 07-Oct-1993  cgd move the rpc code into libc
 1.6.2.1 16-Sep-1996  jtc snapshot namespace cleanup: rpc & xdr
 1.16.66.1 14-Mar-2013  riz Pull up following revision(s) (requested by tron in ticket #843):
lib/libc/rpc/clnt_dg.c: revision 1.28
lib/libc/rpc/xdr_sizeof.c: revision 1.5
lib/libc/rpc/pmap_getport.c: revision 1.19
lib/libc/rpc/xdr_mem.c: revision 1.19
lib/libc/rpc/svc_run.c: revision 1.22
lib/libc/rpc/bindresvport.c: revision 1.25
lib/libc/rpc/svc_raw.c: revision 1.24
lib/libc/rpc/svc_dg.c: revision 1.17
lib/libc/rpc/getnetconfig.c: revision 1.21
lib/libc/rpc/auth_unix.c: revision 1.25
lib/libc/rpc/svc_auth.c: revision 1.17
lib/libc/rpc/clnt_vc.c: revision 1.21
lib/libc/rpc/svc_auth_unix.c: revision 1.21
lib/libc/rpc/rpcb_st_xdr.c: revision 1.10
lib/libc/rpc/pmap_getmaps.c: revision 1.18
lib/libc/rpc/getnetpath.c: revision 1.17
lib/libc/rpc/clnt_simple.c: revision 1.32
lib/libc/rpc/authunix_prot.c: revision 1.16
lib/libc/rpc/svc_dg.h: revision 1.2
lib/libc/rpc/svc_generic.c: revision 1.15
lib/libc/rpc/clnt_raw.c: revision 1.32
lib/libc/rpc/xdr_array.c: revision 1.19
lib/libc/rpc/pmap_prot.c: revision 1.12
lib/libc/rpc/clnt_bcast.c: revision 1.26
lib/libc/rpc/xdr_rec.c: revision 1.35
lib/libc/rpc/svc.c: revision 1.34
lib/libc/rpc/DISCLAIMER: revision 1.3
lib/libc/rpc/clnt_generic.c: revision 1.30
lib/libc/rpc/xdr.c: revision 1.33
lib/libc/rpc/auth_none.c: revision 1.16
lib/libc/rpc/pmap_rmt.c: revision 1.34
lib/libc/rpc/rpc_callmsg.c: revision 1.20
lib/libc/rpc/clnt_perror.c: revision 1.30
lib/libc/rpc/xdr_stdio.c: revision 1.19
lib/libc/rpc/rpc_commondata.c: revision 1.9
lib/libc/rpc/pmap_prot2.c: revision 1.17
lib/libc/rpc/pmap_clnt.c: revision 1.19
lib/libc/rpc/svc_simple.c: revision 1.33
lib/libc/rpc/rpcb_clnt.c: revision 1.29
lib/libc/rpc/rpc_prot.c: revision 1.21
lib/libc/rpc/rpc_dtablesize.c: revision 1.16
lib/libc/rpc/rpc_generic.c: revision 1.28
lib/libc/rpc/xdr_reference.c: revision 1.18
lib/libc/rpc/rpc_soc.c: revision 1.18
lib/libc/rpc/svc_vc.c: revision 1.30
lib/libc/rpc/getrpcent.c: revision 1.23
lib/libc/rpc/xdr_float.c: revision 1.38
lib/libc/rpc/rpcb_prot.c: revision 1.11
lib/libc/rpc/getrpcport.c: revision 1.18
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.
This fixes PR lib/45293 by Pedro Giffuni.
 1.16.64.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.16.64.1 17-Apr-2012  yamt sync with head
 1.17.2.1 23-Jun-2013  tls resync from head
 1.9 20-Mar-2012  matt Use C89 definitions
Remove use of __P
 1.8 08-Dec-2010  joerg branches: 1.8.6;
Use __isthreaded from reentrant.h and don't redeclare it.
 1.7 28-Apr-2008  martin branches: 1.7.8;
Remove clause 3 and 4 from TNF licenses
 1.6 25-Apr-2008  christos - always check malloc results
- don't leak fds on error
- don't cast malloc
- don't cast NULL
 1.5 26-Jan-2006  kleink branches: 1.5.18;
Need to give the various rpc locks private names (prefixing them with
__rpc_). Rather than scattering changes around the 3rd-party RPC
code, place them in namespace.h.
 1.4 28-May-2004  christos branches: 1.4.2;
PR/25003: John Kohl: File is missing a copyright.
 1.3 09-Sep-2003  itojun __RCSID police
 1.2 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.1 02-Jun-2000  fvdl branches: 1.1.4; 1.1.6;
Add new RPC code, based on Sun's TI-RPC code. Adapted to not use XTI,
but sockets instead, internally. Old, backward compatible interfaces
maintained.
 1.1.6.2 04-Sep-2001  nathanw Include <string.h> for memset() prototype.
 1.1.6.1 08-Aug-2001  nathanw Convert to our threading style.
__REENT -> _REENTRANT
Statically initialize mutexes.
Use pthread thread-specific data semantics and once_t instead of Sun thread
semantics.
Use __isthreaded to detect presence of thread universe instead of _thr_main().
 1.1.4.2 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 02-Jun-2000  minoura file mt_misc.c was added on branch minoura-xpg4dl on 2000-06-23 16:17:43 +0000
 1.4.2.1 28-Jan-2006  tron Pull up following revision(s) (requested by kleink in ticket #1142):
lib/libc/rpc/mt_misc.c: revision 1.5
lib/libc/include/namespace.h: revision 1.110
Need to give the various rpc locks private names (prefixing them with
__rpc_). Rather than scattering changes around the 3rd-party RPC
code, place them in namespace.h.
 1.5.18.1 18-May-2008  yamt sync with head.
 1.7.8.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.7.8.1 28-Apr-2008  martin file mt_misc.c was added on branch christos-time_t on 2008-04-28 20:23:01 +0000
 1.8.6.1 17-Apr-2012  yamt sync with head
 1.20 23-Jan-2024  christos fix nested extern warnings
 1.19 11-Mar-2013  tron Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.

This fixes PR lib/45293 by Pedro Giffuni.
 1.18 18-Jan-2003  thorpej branches: 1.18.56; 1.18.58; 1.18.62;
Merge the nathanw_sa branch.
 1.17 08-Nov-2002  fvdl * Adapt include files for rpc_com.h/rpc_internal.h split.
* Add rpc_control to svc.c
* Implement non-blocking connections.
 1.16 06-Jul-2000  christos branches: 1.16.2; 1.16.4;
add __RPC_GETXID macro
don't const castway __rpc_getconf and __rpc_getconfig. It might try to
write const strings
fix non-portable casts
remove duplicated prototypes
cast things to proper types
remove extraneous casts to NULL
fix variable cast mismatches
remove register var declarations
 1.15 02-Jun-2000  fvdl Add new RPC code, based on Sun's TI-RPC code. Adapted to not use XTI,
but sockets instead, internally. Old, backward compatible interfaces
maintained.
 1.14 22-Jan-2000  mycroft branches: 1.14.2;
Delint.
Remove trailing ; from uses of __weak_alias(). The macro inserts this if
needed.
 1.13 17-Apr-1999  drochner Use TCP to register RPC services with the portmapper.
This has the advantage that we get an immediate error in case of
network problems (loopback, actually) instead of a nasty timeout.
 1.12 25-Mar-1999  lukem * don't close the socket unless it was opened by the function
* note (in the comments) that the client is responsible for closing
the socket if they opened it, or they didn't use CLNT_DESTROY()

fixes a couple of unnecessary closing of already-closed sockets.
noted by: Matthias Drochner <M.Drochner@fz-juelich.de>
 1.11 31-Jan-1999  christos xdrproc_t casts.
 1.10 20-Jan-1999  lukem * ensure memory is released if operations fail (in authunix_create(),
xdr_callmsg(), xprt_register(), svc_tcp(), svc_udp(), etc)
* don't attempt to close a socket filedescriptor if it's -1 (some from
freebsd, some i found)
* make the initial xid a little more random (from freebsd)
* fix some spelos and tyops in comments (some from freebsd)
* use warn() instead of warnx() for many errors; the user probably
wants to know what the error code was.
* knf & whitespace nitpicks
 1.9 26-Jul-1998  mycroft const poisoning.
 1.8 13-Feb-1998  lukem * in get_myaddress(); always return sockaddr_in containing localhost:PMAP_PORT.
(as recommended in Weiste Venema's portmap5_beta distribution)
* deprecate register
* use memmove instead of bcopy
* KNF includes
* use err/warn() instead of perror/fprintf(stderr,)
* fix some typos
 1.7 12-Feb-1998  lukem revert; we can't break the existing ABI and API
 1.6 10-Feb-1998  lukem major cleanup (to sync with changes made in include/rpc/*.h):
* use int32_t, size_t, in_port_t instead of long, u_int, u_short as appropriate
* use uid_t and gid_t instead of int
* KNF, fix typos and spellos
* use const as appropriate
* deprecate register
* use memmove instead of bcopy
* use err/warn()
 1.5 21-Jul-1997  jtc If port provides __weak_alias(), provide an Standard C and POSIX pure
identifier namespace by renaming non standard functions and variables
such that they have a leading underscore. The library will use those
names internally. Weak aliases are used to provide the original names
to the API.

This is only the first part of this change. It is most of the functions
which are implemented in C for all NetBSD ports. Subsequent changes are
to add the same support to the remaining C files, to assembly files, and
to the automagically generated assembly source used for system calls.
When all of the above is done, ports with weak alias support should add
a definition for __weak_alias to <sys/cdefs.h>.
 1.4 13-Jul-1997  christos Fix RCSID's
Fix gcc warnings.
Add missing prototypes
 1.3 04-Jan-1996  pk branches: 1.3.2;
Return FALSE if get_myaddress() fails.
 1.2 25-Feb-1995  cgd save my sanity; stop using Id.
 1.1 07-Oct-1993  cgd branches: 1.1.4;
move the rpc code into libc
 1.1.4.1 02-May-1995  jtc #include "namespace.h"
 1.3.2.1 16-Sep-1996  jtc snapshot namespace cleanup: rpc & xdr
 1.14.2.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.16.4.1 06-Jan-2003  jmc Pull up revisions 1.16-1.17 (requested by fvdl in ticket #1037)
* Adapt include files for rpc_com.h/rpc_internal.h split.
* Implement non-blocking connections.
* Add rpc_control to svc.c
 1.16.2.1 11-Nov-2002  nathanw Catch up to -current
 1.18.62.1 23-Jun-2013  tls resync from head
 1.18.58.1 14-Mar-2013  riz Pull up following revision(s) (requested by tron in ticket #843):
lib/libc/rpc/clnt_dg.c: revision 1.28
lib/libc/rpc/xdr_sizeof.c: revision 1.5
lib/libc/rpc/pmap_getport.c: revision 1.19
lib/libc/rpc/xdr_mem.c: revision 1.19
lib/libc/rpc/svc_run.c: revision 1.22
lib/libc/rpc/bindresvport.c: revision 1.25
lib/libc/rpc/svc_raw.c: revision 1.24
lib/libc/rpc/svc_dg.c: revision 1.17
lib/libc/rpc/getnetconfig.c: revision 1.21
lib/libc/rpc/auth_unix.c: revision 1.25
lib/libc/rpc/svc_auth.c: revision 1.17
lib/libc/rpc/clnt_vc.c: revision 1.21
lib/libc/rpc/svc_auth_unix.c: revision 1.21
lib/libc/rpc/rpcb_st_xdr.c: revision 1.10
lib/libc/rpc/pmap_getmaps.c: revision 1.18
lib/libc/rpc/getnetpath.c: revision 1.17
lib/libc/rpc/clnt_simple.c: revision 1.32
lib/libc/rpc/authunix_prot.c: revision 1.16
lib/libc/rpc/svc_dg.h: revision 1.2
lib/libc/rpc/svc_generic.c: revision 1.15
lib/libc/rpc/clnt_raw.c: revision 1.32
lib/libc/rpc/xdr_array.c: revision 1.19
lib/libc/rpc/pmap_prot.c: revision 1.12
lib/libc/rpc/clnt_bcast.c: revision 1.26
lib/libc/rpc/xdr_rec.c: revision 1.35
lib/libc/rpc/svc.c: revision 1.34
lib/libc/rpc/DISCLAIMER: revision 1.3
lib/libc/rpc/clnt_generic.c: revision 1.30
lib/libc/rpc/xdr.c: revision 1.33
lib/libc/rpc/auth_none.c: revision 1.16
lib/libc/rpc/pmap_rmt.c: revision 1.34
lib/libc/rpc/rpc_callmsg.c: revision 1.20
lib/libc/rpc/clnt_perror.c: revision 1.30
lib/libc/rpc/xdr_stdio.c: revision 1.19
lib/libc/rpc/rpc_commondata.c: revision 1.9
lib/libc/rpc/pmap_prot2.c: revision 1.17
lib/libc/rpc/pmap_clnt.c: revision 1.19
lib/libc/rpc/svc_simple.c: revision 1.33
lib/libc/rpc/rpcb_clnt.c: revision 1.29
lib/libc/rpc/rpc_prot.c: revision 1.21
lib/libc/rpc/rpc_dtablesize.c: revision 1.16
lib/libc/rpc/rpc_generic.c: revision 1.28
lib/libc/rpc/xdr_reference.c: revision 1.18
lib/libc/rpc/rpc_soc.c: revision 1.18
lib/libc/rpc/svc_vc.c: revision 1.30
lib/libc/rpc/getrpcent.c: revision 1.23
lib/libc/rpc/xdr_float.c: revision 1.38
lib/libc/rpc/rpcb_prot.c: revision 1.11
lib/libc/rpc/getrpcport.c: revision 1.18
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.
This fixes PR lib/45293 by Pedro Giffuni.
 1.18.56.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.18 11-Mar-2013  tron Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.

This fixes PR lib/45293 by Pedro Giffuni.
 1.17 20-Mar-2012  matt branches: 1.17.2;
Use C89 definitions
Remove use of __P
 1.16 06-Jul-2000  christos branches: 1.16.60; 1.16.62;
add __RPC_GETXID macro
don't const castway __rpc_getconf and __rpc_getconfig. It might try to
write const strings
fix non-portable casts
remove duplicated prototypes
cast things to proper types
remove extraneous casts to NULL
fix variable cast mismatches
remove register var declarations
 1.15 22-Jan-2000  mycroft Delint.
Remove trailing ; from uses of __weak_alias(). The macro inserts this if
needed.
 1.14 20-Sep-1999  lukem back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.13 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.12 25-Mar-1999  lukem * don't close the socket unless it was opened by the function
* note (in the comments) that the client is responsible for closing
the socket if they opened it, or they didn't use CLNT_DESTROY()

fixes a couple of unnecessary closing of already-closed sockets.
noted by: Matthias Drochner <M.Drochner@fz-juelich.de>
 1.11 31-Jan-1999  christos xdrproc_t casts.
 1.10 20-Jan-1999  lukem * ensure memory is released if operations fail (in authunix_create(),
xdr_callmsg(), xprt_register(), svc_tcp(), svc_udp(), etc)
* don't attempt to close a socket filedescriptor if it's -1 (some from
freebsd, some i found)
* make the initial xid a little more random (from freebsd)
* fix some spelos and tyops in comments (some from freebsd)
* use warn() instead of warnx() for many errors; the user probably
wants to know what the error code was.
* knf & whitespace nitpicks
 1.9 15-Nov-1998  christos delint
 1.8 13-Feb-1998  lukem * in get_myaddress(); always return sockaddr_in containing localhost:PMAP_PORT.
(as recommended in Weiste Venema's portmap5_beta distribution)
* deprecate register
* use memmove instead of bcopy
* KNF includes
* use err/warn() instead of perror/fprintf(stderr,)
* fix some typos
 1.7 12-Feb-1998  lukem revert; we can't break the existing ABI and API
 1.6 10-Feb-1998  lukem major cleanup (to sync with changes made in include/rpc/*.h):
* use int32_t, size_t, in_port_t instead of long, u_int, u_short as appropriate
* use uid_t and gid_t instead of int
* KNF, fix typos and spellos
* use const as appropriate
* deprecate register
* use memmove instead of bcopy
* use err/warn()
 1.5 21-Jul-1997  jtc If port provides __weak_alias(), provide an Standard C and POSIX pure
identifier namespace by renaming non standard functions and variables
such that they have a leading underscore. The library will use those
names internally. Weak aliases are used to provide the original names
to the API.

This is only the first part of this change. It is most of the functions
which are implemented in C for all NetBSD ports. Subsequent changes are
to add the same support to the remaining C files, to assembly files, and
to the automagically generated assembly source used for system calls.
When all of the above is done, ports with weak alias support should add
a definition for __weak_alias to <sys/cdefs.h>.
 1.4 13-Jul-1997  christos Fix RCSID's
Fix gcc warnings.
Add missing prototypes
 1.3 25-Feb-1995  cgd branches: 1.3.4;
save my sanity; stop using Id.
 1.2 04-Dec-1994  cgd branches: 1.2.2;
be much more careful with types, and add prototype everything.
 1.1 07-Oct-1993  cgd move the rpc code into libc
 1.2.2.1 02-May-1995  jtc #include "namespace.h"
 1.3.4.1 16-Sep-1996  jtc snapshot namespace cleanup: rpc & xdr
 1.16.62.1 14-Mar-2013  riz Pull up following revision(s) (requested by tron in ticket #843):
lib/libc/rpc/clnt_dg.c: revision 1.28
lib/libc/rpc/xdr_sizeof.c: revision 1.5
lib/libc/rpc/pmap_getport.c: revision 1.19
lib/libc/rpc/xdr_mem.c: revision 1.19
lib/libc/rpc/svc_run.c: revision 1.22
lib/libc/rpc/bindresvport.c: revision 1.25
lib/libc/rpc/svc_raw.c: revision 1.24
lib/libc/rpc/svc_dg.c: revision 1.17
lib/libc/rpc/getnetconfig.c: revision 1.21
lib/libc/rpc/auth_unix.c: revision 1.25
lib/libc/rpc/svc_auth.c: revision 1.17
lib/libc/rpc/clnt_vc.c: revision 1.21
lib/libc/rpc/svc_auth_unix.c: revision 1.21
lib/libc/rpc/rpcb_st_xdr.c: revision 1.10
lib/libc/rpc/pmap_getmaps.c: revision 1.18
lib/libc/rpc/getnetpath.c: revision 1.17
lib/libc/rpc/clnt_simple.c: revision 1.32
lib/libc/rpc/authunix_prot.c: revision 1.16
lib/libc/rpc/svc_dg.h: revision 1.2
lib/libc/rpc/svc_generic.c: revision 1.15
lib/libc/rpc/clnt_raw.c: revision 1.32
lib/libc/rpc/xdr_array.c: revision 1.19
lib/libc/rpc/pmap_prot.c: revision 1.12
lib/libc/rpc/clnt_bcast.c: revision 1.26
lib/libc/rpc/xdr_rec.c: revision 1.35
lib/libc/rpc/svc.c: revision 1.34
lib/libc/rpc/DISCLAIMER: revision 1.3
lib/libc/rpc/clnt_generic.c: revision 1.30
lib/libc/rpc/xdr.c: revision 1.33
lib/libc/rpc/auth_none.c: revision 1.16
lib/libc/rpc/pmap_rmt.c: revision 1.34
lib/libc/rpc/rpc_callmsg.c: revision 1.20
lib/libc/rpc/clnt_perror.c: revision 1.30
lib/libc/rpc/xdr_stdio.c: revision 1.19
lib/libc/rpc/rpc_commondata.c: revision 1.9
lib/libc/rpc/pmap_prot2.c: revision 1.17
lib/libc/rpc/pmap_clnt.c: revision 1.19
lib/libc/rpc/svc_simple.c: revision 1.33
lib/libc/rpc/rpcb_clnt.c: revision 1.29
lib/libc/rpc/rpc_prot.c: revision 1.21
lib/libc/rpc/rpc_dtablesize.c: revision 1.16
lib/libc/rpc/rpc_generic.c: revision 1.28
lib/libc/rpc/xdr_reference.c: revision 1.18
lib/libc/rpc/rpc_soc.c: revision 1.18
lib/libc/rpc/svc_vc.c: revision 1.30
lib/libc/rpc/getrpcent.c: revision 1.23
lib/libc/rpc/xdr_float.c: revision 1.38
lib/libc/rpc/rpcb_prot.c: revision 1.11
lib/libc/rpc/getrpcport.c: revision 1.18
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.
This fixes PR lib/45293 by Pedro Giffuni.
 1.16.60.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.16.60.1 17-Apr-2012  yamt sync with head
 1.17.2.1 23-Jun-2013  tls resync from head
 1.19 11-Mar-2013  tron Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.

This fixes PR lib/45293 by Pedro Giffuni.
 1.18 28-Jan-2008  christos branches: 1.18.28; 1.18.30; 1.18.34;
Always try both tcp and udp, trying first the one specified by the protocol
wanted.
 1.17 25-Jan-2008  christos PR/37864: Wolfgang Stukenbrock: when requesting TCP rcp-service port numbers
UDP is used
 1.16 06-Jul-2000  christos branches: 1.16.26;
add __RPC_GETXID macro
don't const castway __rpc_getconf and __rpc_getconfig. It might try to
write const strings
fix non-portable casts
remove duplicated prototypes
cast things to proper types
remove extraneous casts to NULL
fix variable cast mismatches
remove register var declarations
 1.15 22-Jan-2000  mycroft Delint.
Remove trailing ; from uses of __weak_alias(). The macro inserts this if
needed.
 1.14 20-Sep-1999  lukem back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.13 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.12 25-Mar-1999  lukem * don't close the socket unless it was opened by the function
* note (in the comments) that the client is responsible for closing
the socket if they opened it, or they didn't use CLNT_DESTROY()

fixes a couple of unnecessary closing of already-closed sockets.
noted by: Matthias Drochner <M.Drochner@fz-juelich.de>
 1.11 31-Jan-1999  christos xdrproc_t casts.
 1.10 20-Jan-1999  lukem * ensure memory is released if operations fail (in authunix_create(),
xdr_callmsg(), xprt_register(), svc_tcp(), svc_udp(), etc)
* don't attempt to close a socket filedescriptor if it's -1 (some from
freebsd, some i found)
* make the initial xid a little more random (from freebsd)
* fix some spelos and tyops in comments (some from freebsd)
* use warn() instead of warnx() for many errors; the user probably
wants to know what the error code was.
* knf & whitespace nitpicks
 1.9 15-Nov-1998  christos delint
 1.8 26-Jul-1998  mycroft const poisoning.
 1.7 13-Feb-1998  lukem * in get_myaddress(); always return sockaddr_in containing localhost:PMAP_PORT.
(as recommended in Weiste Venema's portmap5_beta distribution)
* deprecate register
* use memmove instead of bcopy
* KNF includes
* use err/warn() instead of perror/fprintf(stderr,)
* fix some typos
 1.6 12-Feb-1998  lukem revert; we can't break the existing ABI and API
 1.5 10-Feb-1998  lukem major cleanup (to sync with changes made in include/rpc/*.h):
* use int32_t, size_t, in_port_t instead of long, u_int, u_short as appropriate
* use uid_t and gid_t instead of int
* KNF, fix typos and spellos
* use const as appropriate
* deprecate register
* use memmove instead of bcopy
* use err/warn()
 1.4 21-Jul-1997  jtc If port provides __weak_alias(), provide an Standard C and POSIX pure
identifier namespace by renaming non standard functions and variables
such that they have a leading underscore. The library will use those
names internally. Weak aliases are used to provide the original names
to the API.

This is only the first part of this change. It is most of the functions
which are implemented in C for all NetBSD ports. Subsequent changes are
to add the same support to the remaining C files, to assembly files, and
to the automagically generated assembly source used for system calls.
When all of the above is done, ports with weak alias support should add
a definition for __weak_alias to <sys/cdefs.h>.
 1.3 13-Jul-1997  christos Fix RCSID's
Fix gcc warnings.
Add missing prototypes
 1.2 25-Feb-1995  cgd branches: 1.2.4;
save my sanity; stop using Id.
 1.1 07-Oct-1993  cgd branches: 1.1.4;
move the rpc code into libc
 1.1.4.1 02-May-1995  jtc #include "namespace.h"
 1.2.4.1 16-Sep-1996  jtc snapshot namespace cleanup: rpc & xdr
 1.16.26.1 23-Mar-2008  matt sync with HEAD
 1.18.34.1 23-Jun-2013  tls resync from head
 1.18.30.1 14-Mar-2013  riz Pull up following revision(s) (requested by tron in ticket #843):
lib/libc/rpc/clnt_dg.c: revision 1.28
lib/libc/rpc/xdr_sizeof.c: revision 1.5
lib/libc/rpc/pmap_getport.c: revision 1.19
lib/libc/rpc/xdr_mem.c: revision 1.19
lib/libc/rpc/svc_run.c: revision 1.22
lib/libc/rpc/bindresvport.c: revision 1.25
lib/libc/rpc/svc_raw.c: revision 1.24
lib/libc/rpc/svc_dg.c: revision 1.17
lib/libc/rpc/getnetconfig.c: revision 1.21
lib/libc/rpc/auth_unix.c: revision 1.25
lib/libc/rpc/svc_auth.c: revision 1.17
lib/libc/rpc/clnt_vc.c: revision 1.21
lib/libc/rpc/svc_auth_unix.c: revision 1.21
lib/libc/rpc/rpcb_st_xdr.c: revision 1.10
lib/libc/rpc/pmap_getmaps.c: revision 1.18
lib/libc/rpc/getnetpath.c: revision 1.17
lib/libc/rpc/clnt_simple.c: revision 1.32
lib/libc/rpc/authunix_prot.c: revision 1.16
lib/libc/rpc/svc_dg.h: revision 1.2
lib/libc/rpc/svc_generic.c: revision 1.15
lib/libc/rpc/clnt_raw.c: revision 1.32
lib/libc/rpc/xdr_array.c: revision 1.19
lib/libc/rpc/pmap_prot.c: revision 1.12
lib/libc/rpc/clnt_bcast.c: revision 1.26
lib/libc/rpc/xdr_rec.c: revision 1.35
lib/libc/rpc/svc.c: revision 1.34
lib/libc/rpc/DISCLAIMER: revision 1.3
lib/libc/rpc/clnt_generic.c: revision 1.30
lib/libc/rpc/xdr.c: revision 1.33
lib/libc/rpc/auth_none.c: revision 1.16
lib/libc/rpc/pmap_rmt.c: revision 1.34
lib/libc/rpc/rpc_callmsg.c: revision 1.20
lib/libc/rpc/clnt_perror.c: revision 1.30
lib/libc/rpc/xdr_stdio.c: revision 1.19
lib/libc/rpc/rpc_commondata.c: revision 1.9
lib/libc/rpc/pmap_prot2.c: revision 1.17
lib/libc/rpc/pmap_clnt.c: revision 1.19
lib/libc/rpc/svc_simple.c: revision 1.33
lib/libc/rpc/rpcb_clnt.c: revision 1.29
lib/libc/rpc/rpc_prot.c: revision 1.21
lib/libc/rpc/rpc_dtablesize.c: revision 1.16
lib/libc/rpc/rpc_generic.c: revision 1.28
lib/libc/rpc/xdr_reference.c: revision 1.18
lib/libc/rpc/rpc_soc.c: revision 1.18
lib/libc/rpc/svc_vc.c: revision 1.30
lib/libc/rpc/getrpcent.c: revision 1.23
lib/libc/rpc/xdr_float.c: revision 1.38
lib/libc/rpc/rpcb_prot.c: revision 1.11
lib/libc/rpc/getrpcport.c: revision 1.18
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.
This fixes PR lib/45293 by Pedro Giffuni.
 1.18.28.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.12 11-Mar-2013  tron Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.

This fixes PR lib/45293 by Pedro Giffuni.
 1.11 20-Mar-2012  matt branches: 1.11.2;
Use C89 definitions
Remove use of __P
 1.10 22-Jan-2000  mycroft branches: 1.10.64; 1.10.66;
Delint.
Remove trailing ; from uses of __weak_alias(). The macro inserts this if
needed.
 1.9 20-Sep-1999  lukem back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.8 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.7 13-Feb-1998  lukem * in get_myaddress(); always return sockaddr_in containing localhost:PMAP_PORT.
(as recommended in Weiste Venema's portmap5_beta distribution)
* deprecate register
* use memmove instead of bcopy
* KNF includes
* use err/warn() instead of perror/fprintf(stderr,)
* fix some typos
 1.6 12-Feb-1998  lukem revert; we can't break the existing ABI and API
 1.5 10-Feb-1998  lukem major cleanup (to sync with changes made in include/rpc/*.h):
* use int32_t, size_t, in_port_t instead of long, u_int, u_short as appropriate
* use uid_t and gid_t instead of int
* KNF, fix typos and spellos
* use const as appropriate
* deprecate register
* use memmove instead of bcopy
* use err/warn()
 1.4 21-Jul-1997  jtc If port provides __weak_alias(), provide an Standard C and POSIX pure
identifier namespace by renaming non standard functions and variables
such that they have a leading underscore. The library will use those
names internally. Weak aliases are used to provide the original names
to the API.

This is only the first part of this change. It is most of the functions
which are implemented in C for all NetBSD ports. Subsequent changes are
to add the same support to the remaining C files, to assembly files, and
to the automagically generated assembly source used for system calls.
When all of the above is done, ports with weak alias support should add
a definition for __weak_alias to <sys/cdefs.h>.
 1.3 13-Jul-1997  christos Fix RCSID's
Fix gcc warnings.
Add missing prototypes
 1.2 25-Feb-1995  cgd branches: 1.2.4;
save my sanity; stop using Id.
 1.1 07-Oct-1993  cgd move the rpc code into libc
 1.2.4.1 16-Sep-1996  jtc snapshot namespace cleanup: rpc & xdr
 1.10.66.1 14-Mar-2013  riz Pull up following revision(s) (requested by tron in ticket #843):
lib/libc/rpc/clnt_dg.c: revision 1.28
lib/libc/rpc/xdr_sizeof.c: revision 1.5
lib/libc/rpc/pmap_getport.c: revision 1.19
lib/libc/rpc/xdr_mem.c: revision 1.19
lib/libc/rpc/svc_run.c: revision 1.22
lib/libc/rpc/bindresvport.c: revision 1.25
lib/libc/rpc/svc_raw.c: revision 1.24
lib/libc/rpc/svc_dg.c: revision 1.17
lib/libc/rpc/getnetconfig.c: revision 1.21
lib/libc/rpc/auth_unix.c: revision 1.25
lib/libc/rpc/svc_auth.c: revision 1.17
lib/libc/rpc/clnt_vc.c: revision 1.21
lib/libc/rpc/svc_auth_unix.c: revision 1.21
lib/libc/rpc/rpcb_st_xdr.c: revision 1.10
lib/libc/rpc/pmap_getmaps.c: revision 1.18
lib/libc/rpc/getnetpath.c: revision 1.17
lib/libc/rpc/clnt_simple.c: revision 1.32
lib/libc/rpc/authunix_prot.c: revision 1.16
lib/libc/rpc/svc_dg.h: revision 1.2
lib/libc/rpc/svc_generic.c: revision 1.15
lib/libc/rpc/clnt_raw.c: revision 1.32
lib/libc/rpc/xdr_array.c: revision 1.19
lib/libc/rpc/pmap_prot.c: revision 1.12
lib/libc/rpc/clnt_bcast.c: revision 1.26
lib/libc/rpc/xdr_rec.c: revision 1.35
lib/libc/rpc/svc.c: revision 1.34
lib/libc/rpc/DISCLAIMER: revision 1.3
lib/libc/rpc/clnt_generic.c: revision 1.30
lib/libc/rpc/xdr.c: revision 1.33
lib/libc/rpc/auth_none.c: revision 1.16
lib/libc/rpc/pmap_rmt.c: revision 1.34
lib/libc/rpc/rpc_callmsg.c: revision 1.20
lib/libc/rpc/clnt_perror.c: revision 1.30
lib/libc/rpc/xdr_stdio.c: revision 1.19
lib/libc/rpc/rpc_commondata.c: revision 1.9
lib/libc/rpc/pmap_prot2.c: revision 1.17
lib/libc/rpc/pmap_clnt.c: revision 1.19
lib/libc/rpc/svc_simple.c: revision 1.33
lib/libc/rpc/rpcb_clnt.c: revision 1.29
lib/libc/rpc/rpc_prot.c: revision 1.21
lib/libc/rpc/rpc_dtablesize.c: revision 1.16
lib/libc/rpc/rpc_generic.c: revision 1.28
lib/libc/rpc/xdr_reference.c: revision 1.18
lib/libc/rpc/rpc_soc.c: revision 1.18
lib/libc/rpc/svc_vc.c: revision 1.30
lib/libc/rpc/getrpcent.c: revision 1.23
lib/libc/rpc/xdr_float.c: revision 1.38
lib/libc/rpc/rpcb_prot.c: revision 1.11
lib/libc/rpc/getrpcport.c: revision 1.18
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.
This fixes PR lib/45293 by Pedro Giffuni.
 1.10.64.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.10.64.1 17-Apr-2012  yamt sync with head
 1.11.2.1 23-Jun-2013  tls resync from head
 1.17 11-Mar-2013  tron Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.

This fixes PR lib/45293 by Pedro Giffuni.
 1.16 20-Mar-2012  matt branches: 1.16.2;
Use C89 definitions
Remove use of __P
 1.15 04-Jan-2001  lukem branches: 1.15.60; 1.15.62;
sprinkle _DIAGASSERT() appropriately. minor other cleanups
 1.14 06-Jul-2000  christos add __RPC_GETXID macro
don't const castway __rpc_getconf and __rpc_getconfig. It might try to
write const strings
fix non-portable casts
remove duplicated prototypes
cast things to proper types
remove extraneous casts to NULL
fix variable cast mismatches
remove register var declarations
 1.13 02-Jun-2000  fvdl Add new RPC code, based on Sun's TI-RPC code. Adapted to not use XTI,
but sockets instead, internally. Old, backward compatible interfaces
maintained.
 1.12 22-Jan-2000  mycroft branches: 1.12.2;
Delint.
Remove trailing ; from uses of __weak_alias(). The macro inserts this if
needed.
 1.11 20-Sep-1999  lukem back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.10 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.9 31-Jan-1999  christos xdrproc_t casts.
 1.8 15-Nov-1998  christos delint
 1.7 13-Feb-1998  lukem * in get_myaddress(); always return sockaddr_in containing localhost:PMAP_PORT.
(as recommended in Weiste Venema's portmap5_beta distribution)
* deprecate register
* use memmove instead of bcopy
* KNF includes
* use err/warn() instead of perror/fprintf(stderr,)
* fix some typos
 1.6 12-Feb-1998  lukem revert; we can't break the existing ABI and API
 1.5 10-Feb-1998  lukem major cleanup (to sync with changes made in include/rpc/*.h):
* use int32_t, size_t, in_port_t instead of long, u_int, u_short as appropriate
* use uid_t and gid_t instead of int
* KNF, fix typos and spellos
* use const as appropriate
* deprecate register
* use memmove instead of bcopy
* use err/warn()
 1.4 21-Jul-1997  jtc If port provides __weak_alias(), provide an Standard C and POSIX pure
identifier namespace by renaming non standard functions and variables
such that they have a leading underscore. The library will use those
names internally. Weak aliases are used to provide the original names
to the API.

This is only the first part of this change. It is most of the functions
which are implemented in C for all NetBSD ports. Subsequent changes are
to add the same support to the remaining C files, to assembly files, and
to the automagically generated assembly source used for system calls.
When all of the above is done, ports with weak alias support should add
a definition for __weak_alias to <sys/cdefs.h>.
 1.3 13-Jul-1997  christos Fix RCSID's
Fix gcc warnings.
Add missing prototypes
 1.2 25-Feb-1995  cgd branches: 1.2.4;
save my sanity; stop using Id.
 1.1 07-Oct-1993  cgd move the rpc code into libc
 1.2.4.1 16-Sep-1996  jtc snapshot namespace cleanup: rpc & xdr
 1.12.2.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.15.62.1 14-Mar-2013  riz Pull up following revision(s) (requested by tron in ticket #843):
lib/libc/rpc/clnt_dg.c: revision 1.28
lib/libc/rpc/xdr_sizeof.c: revision 1.5
lib/libc/rpc/pmap_getport.c: revision 1.19
lib/libc/rpc/xdr_mem.c: revision 1.19
lib/libc/rpc/svc_run.c: revision 1.22
lib/libc/rpc/bindresvport.c: revision 1.25
lib/libc/rpc/svc_raw.c: revision 1.24
lib/libc/rpc/svc_dg.c: revision 1.17
lib/libc/rpc/getnetconfig.c: revision 1.21
lib/libc/rpc/auth_unix.c: revision 1.25
lib/libc/rpc/svc_auth.c: revision 1.17
lib/libc/rpc/clnt_vc.c: revision 1.21
lib/libc/rpc/svc_auth_unix.c: revision 1.21
lib/libc/rpc/rpcb_st_xdr.c: revision 1.10
lib/libc/rpc/pmap_getmaps.c: revision 1.18
lib/libc/rpc/getnetpath.c: revision 1.17
lib/libc/rpc/clnt_simple.c: revision 1.32
lib/libc/rpc/authunix_prot.c: revision 1.16
lib/libc/rpc/svc_dg.h: revision 1.2
lib/libc/rpc/svc_generic.c: revision 1.15
lib/libc/rpc/clnt_raw.c: revision 1.32
lib/libc/rpc/xdr_array.c: revision 1.19
lib/libc/rpc/pmap_prot.c: revision 1.12
lib/libc/rpc/clnt_bcast.c: revision 1.26
lib/libc/rpc/xdr_rec.c: revision 1.35
lib/libc/rpc/svc.c: revision 1.34
lib/libc/rpc/DISCLAIMER: revision 1.3
lib/libc/rpc/clnt_generic.c: revision 1.30
lib/libc/rpc/xdr.c: revision 1.33
lib/libc/rpc/auth_none.c: revision 1.16
lib/libc/rpc/pmap_rmt.c: revision 1.34
lib/libc/rpc/rpc_callmsg.c: revision 1.20
lib/libc/rpc/clnt_perror.c: revision 1.30
lib/libc/rpc/xdr_stdio.c: revision 1.19
lib/libc/rpc/rpc_commondata.c: revision 1.9
lib/libc/rpc/pmap_prot2.c: revision 1.17
lib/libc/rpc/pmap_clnt.c: revision 1.19
lib/libc/rpc/svc_simple.c: revision 1.33
lib/libc/rpc/rpcb_clnt.c: revision 1.29
lib/libc/rpc/rpc_prot.c: revision 1.21
lib/libc/rpc/rpc_dtablesize.c: revision 1.16
lib/libc/rpc/rpc_generic.c: revision 1.28
lib/libc/rpc/xdr_reference.c: revision 1.18
lib/libc/rpc/rpc_soc.c: revision 1.18
lib/libc/rpc/svc_vc.c: revision 1.30
lib/libc/rpc/getrpcent.c: revision 1.23
lib/libc/rpc/xdr_float.c: revision 1.38
lib/libc/rpc/rpcb_prot.c: revision 1.11
lib/libc/rpc/getrpcport.c: revision 1.18
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.
This fixes PR lib/45293 by Pedro Giffuni.
 1.15.60.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.15.60.1 17-Apr-2012  yamt sync with head
 1.16.2.1 23-Jun-2013  tls resync from head
 1.34 11-Mar-2013  tron Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.

This fixes PR lib/45293 by Pedro Giffuni.
 1.33 25-Jun-2012  abs branches: 1.33.2;
Update old-style definitions to ANSI, remove a couple of register
definitions along the way. Fixed gcc 4.1 build (thank you vax)
 1.32 20-Mar-2012  matt Use C89 definitions
Remove use of __P
 1.31 13-Mar-2012  christos PR/45989: Martin Husemann: lint invocation does include -w only on i386

- turn lint -w for all the platforms after fixing the lint warnings.
- add _DIAGASSERTS() for casts that would assign values to types that
would not fit.
- change types, add casts
- change into ansii prototypes
- turn on _DIAGNOSTIC for libc (during current, to be eliminated for release
builds)

approved by core@
 1.30 23-Mar-2010  drochner branches: 1.30.6; 1.30.8;
remove some stray __weak_aliases, where the target functions were
__RENAMEd due to the time_t/dev_t type changes, which caused bogus
references to compat functions
now a libc built with BUILDCOLD is usable
 1.29 06-Jul-2000  christos add __RPC_GETXID macro
don't const castway __rpc_getconf and __rpc_getconfig. It might try to
write const strings
fix non-portable casts
remove duplicated prototypes
cast things to proper types
remove extraneous casts to NULL
fix variable cast mismatches
remove register var declarations
 1.28 02-Jun-2000  fvdl Add new RPC code, based on Sun's TI-RPC code. Adapted to not use XTI,
but sockets instead, internally. Old, backward compatible interfaces
maintained.
 1.27 15-May-2000  itojun branches: 1.27.2;
remove unnecessary _DISGASSERT().
 1.26 15-May-2000  itojun use getifaddrs instead of SIOCGIFCONF (do we need to keep old code around?)

avoid buffer overrun, when you configure more than 20 IPv4 broadcast addresses
on a node.
 1.25 18-Feb-2000  itojun fix alignment issue with 64bit arch (packed struct/SIOCGIFCONF).
From: =?iso-8859-1?Q?G=F6ran_Bengtson?= <goeran@cdg.chalmers.se>
 1.24 22-Jan-2000  mycroft Delint.
Remove trailing ; from uses of __weak_alias(). The macro inserts this if
needed.
 1.23 20-Sep-1999  lukem back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.22 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.21 03-May-1999  christos int -> socklen_t
 1.20 25-Mar-1999  lukem * don't close the socket unless it was opened by the function
* note (in the comments) that the client is responsible for closing
the socket if they opened it, or they didn't use CLNT_DESTROY()

fixes a couple of unnecessary closing of already-closed sockets.
noted by: Matthias Drochner <M.Drochner@fz-juelich.de>
 1.19 31-Jan-1999  christos xdrproc_t casts.
 1.18 20-Jan-1999  lukem * ensure memory is released if operations fail (in authunix_create(),
xdr_callmsg(), xprt_register(), svc_tcp(), svc_udp(), etc)
* don't attempt to close a socket filedescriptor if it's -1 (some from
freebsd, some i found)
* make the initial xid a little more random (from freebsd)
* fix some spelos and tyops in comments (some from freebsd)
* use warn() instead of warnx() for many errors; the user probably
wants to know what the error code was.
* knf & whitespace nitpicks
 1.17 15-Nov-1998  christos delint
 1.16 26-Jul-1998  mycroft const poisoning.
 1.15 23-May-1998  tv Initialize variable "stat" in case it falls through the timeout "for" loop.
 1.14 13-Feb-1998  lukem * in get_myaddress(); always return sockaddr_in containing localhost:PMAP_PORT.
(as recommended in Weiste Venema's portmap5_beta distribution)
* deprecate register
* use memmove instead of bcopy
* KNF includes
* use err/warn() instead of perror/fprintf(stderr,)
* fix some typos
 1.13 12-Feb-1998  lukem revert; we can't break the existing ABI and API
 1.12 11-Feb-1998  lukem use u_int32_t instead of size_t...
 1.11 10-Feb-1998  lukem major cleanup (to sync with changes made in include/rpc/*.h):
* use int32_t, size_t, in_port_t instead of long, u_int, u_short as appropriate
* use uid_t and gid_t instead of int
* KNF, fix typos and spellos
* use const as appropriate
* deprecate register
* use memmove instead of bcopy
* use err/warn()
 1.10 21-Jul-1997  jtc If port provides __weak_alias(), provide an Standard C and POSIX pure
identifier namespace by renaming non standard functions and variables
such that they have a leading underscore. The library will use those
names internally. Weak aliases are used to provide the original names
to the API.

This is only the first part of this change. It is most of the functions
which are implemented in C for all NetBSD ports. Subsequent changes are
to add the same support to the remaining C files, to assembly files, and
to the automagically generated assembly source used for system calls.
When all of the above is done, ports with weak alias support should add
a definition for __weak_alias to <sys/cdefs.h>.
 1.9 13-Jul-1997  christos Fix RCSID's
Fix gcc warnings.
Add missing prototypes
 1.8 08-Feb-1997  mycroft It's not necessary to initialize the `revents' field of struct pollfd.
 1.7 17-Dec-1996  mrg use poll() instead of select()
 1.6 03-Jun-1995  mycroft branches: 1.6.4;
Fill in sin_len.
 1.5 14-Apr-1995  jtc Changed bzero to memset.
Changed bcmp to memcmp.
Added #include <string.h> to bring prototypes into scope.
 1.4 25-Feb-1995  cgd save my sanity; stop using Id.
 1.3 04-Dec-1994  cgd branches: 1.3.2;
be much more careful with types, and add prototype everything.
 1.2 20-Aug-1994  deraadt branches: 1.2.2;
rpc library no longer uses _rpc_dtablesize() internally -- keeps track
of highest active file descriptor. limit fd usage to FD_SETSIZE, until
a better solution is found. remove non-FD_SETSIZE code.
 1.1 07-Oct-1993  cgd move the rpc code into libc
 1.2.2.2 20-Aug-1994  deraadt rpc library no longer uses _rpc_dtablesize() internally -- keeps track
of highest active file descriptor. limit fd usage to FD_SETSIZE, until
a better solution is found. remove non-FD_SETSIZE code.
 1.2.2.1 20-Aug-1994  deraadt file pmap_rmt.c was added on branch netbsd-1-0 on 1994-08-20 00:55:30 +0000
 1.3.2.1 02-May-1995  jtc #include "namespace.h"
 1.6.4.1 16-Sep-1996  jtc snapshot namespace cleanup: rpc & xdr
 1.27.2.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.30.8.1 14-Mar-2013  riz Pull up following revision(s) (requested by tron in ticket #843):
lib/libc/rpc/clnt_dg.c: revision 1.28
lib/libc/rpc/xdr_sizeof.c: revision 1.5
lib/libc/rpc/pmap_getport.c: revision 1.19
lib/libc/rpc/xdr_mem.c: revision 1.19
lib/libc/rpc/svc_run.c: revision 1.22
lib/libc/rpc/bindresvport.c: revision 1.25
lib/libc/rpc/svc_raw.c: revision 1.24
lib/libc/rpc/svc_dg.c: revision 1.17
lib/libc/rpc/getnetconfig.c: revision 1.21
lib/libc/rpc/auth_unix.c: revision 1.25
lib/libc/rpc/svc_auth.c: revision 1.17
lib/libc/rpc/clnt_vc.c: revision 1.21
lib/libc/rpc/svc_auth_unix.c: revision 1.21
lib/libc/rpc/rpcb_st_xdr.c: revision 1.10
lib/libc/rpc/pmap_getmaps.c: revision 1.18
lib/libc/rpc/getnetpath.c: revision 1.17
lib/libc/rpc/clnt_simple.c: revision 1.32
lib/libc/rpc/authunix_prot.c: revision 1.16
lib/libc/rpc/svc_dg.h: revision 1.2
lib/libc/rpc/svc_generic.c: revision 1.15
lib/libc/rpc/clnt_raw.c: revision 1.32
lib/libc/rpc/xdr_array.c: revision 1.19
lib/libc/rpc/pmap_prot.c: revision 1.12
lib/libc/rpc/clnt_bcast.c: revision 1.26
lib/libc/rpc/xdr_rec.c: revision 1.35
lib/libc/rpc/svc.c: revision 1.34
lib/libc/rpc/DISCLAIMER: revision 1.3
lib/libc/rpc/clnt_generic.c: revision 1.30
lib/libc/rpc/xdr.c: revision 1.33
lib/libc/rpc/auth_none.c: revision 1.16
lib/libc/rpc/pmap_rmt.c: revision 1.34
lib/libc/rpc/rpc_callmsg.c: revision 1.20
lib/libc/rpc/clnt_perror.c: revision 1.30
lib/libc/rpc/xdr_stdio.c: revision 1.19
lib/libc/rpc/rpc_commondata.c: revision 1.9
lib/libc/rpc/pmap_prot2.c: revision 1.17
lib/libc/rpc/pmap_clnt.c: revision 1.19
lib/libc/rpc/svc_simple.c: revision 1.33
lib/libc/rpc/rpcb_clnt.c: revision 1.29
lib/libc/rpc/rpc_prot.c: revision 1.21
lib/libc/rpc/rpc_dtablesize.c: revision 1.16
lib/libc/rpc/rpc_generic.c: revision 1.28
lib/libc/rpc/xdr_reference.c: revision 1.18
lib/libc/rpc/rpc_soc.c: revision 1.18
lib/libc/rpc/svc_vc.c: revision 1.30
lib/libc/rpc/getrpcent.c: revision 1.23
lib/libc/rpc/xdr_float.c: revision 1.38
lib/libc/rpc/rpcb_prot.c: revision 1.11
lib/libc/rpc/getrpcport.c: revision 1.18
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.
This fixes PR lib/45293 by Pedro Giffuni.
 1.30.6.3 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.30.6.2 30-Oct-2012  yamt sync with head
 1.30.6.1 17-Apr-2012  yamt sync with head
 1.33.2.1 23-Jun-2013  tls resync from head
 1.25 03-Jul-2017  wiz Remove workaround for ancient HTML generation code.
 1.24 13-May-2012  wiz Remove unneeded commas in table.
From Bug Hunting.
 1.23 30-Aug-2011  plunky branches: 1.23.2;
provide a complete prototype for xdrproc_t

(I found no instances where three arguments were actually
used, as per the claim in the comment. If there are any
in third party code then they will need to use a cast)
 1.22 22-Mar-2010  joerg Use .In for header files instead of .Ar Pa and variations.
 1.21 11-Apr-2009  joerg Fix markup.
 1.20 16-Sep-2006  yamt branches: 1.20.24; 1.20.28;
fix a typo pointed by efnbl06 at bn2.maus.net.
 1.19 26-Dec-2005  perry u_intN_t -> uintN_t
 1.18 27-Jun-2003  wiz Use Aq Pa instead of Fd \*[Lt]...\*[Gt].
 1.17 16-Apr-2003  wiz Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
 1.16 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.15 01-Jan-2003  jschauma Fix typos pointed out by Igor Sobrado in PR misc/19632

rpc(3) - addres (address)
rpc_reg(3) - truct (struct, in struct rpc_msg)
rpcb_getaddr(3) - Copyright: Sun Microsystems (not Microsystem's)
All Rights Reserved (not Right's)
 1.14 07-Feb-2002  ross generate & symbolically
 1.13 07-Feb-2002  ross Generate <>& symbolically.
 1.12 15-Jan-2002  wiz Drop some unnecessary .Pps, use .Ss instead of .Sh.
 1.11 09-Apr-2001  wiz netconfig(5), not (4), and whitespace.
 1.10 02-Jun-2000  fvdl branches: 1.10.2; 1.10.4;
Add new RPC code, based on Sun's TI-RPC code. Adapted to not use XTI,
but sockets instead, internally. Old, backward compatible interfaces
maintained.
 1.9 04-Mar-1999  lukem branches: 1.9.8;
* don't reference rpc_secure(3N) (yet)
* use section (3) not (3N) (from freebsd)
 1.8 12-Feb-1998  lukem revert; we can't break the existing ABI and API
 1.7 10-Feb-1998  lukem major cleanup (to sync with changes made in include/rpc/*.h):
* use int32_t, size_t, in_port_t instead of long, u_int, u_short as appropriate
* use uid_t and gid_t instead of int
* KNF, fix typos and spellos
* use const as appropriate
* deprecate register
* use memmove instead of bcopy
* use err/warn()
 1.6 03-Feb-1998  lukem fix tyop
 1.5 14-Nov-1997  mrg add missing .Nm entries. from spz@serpens.swb.de.
 1.4 19-Jun-1996  jtc branches: 1.4.6;
Changed clnt_{s,}p{errno,error,createerror} so that the functions that
output emit newlines and those that return a pointer to string do not
append them.

The existing behavior was inherited from RPC4.0, but this seems to have
been corrected sometime before SunOS 4.1.

The documentation has been updated to reflect the new behavior.
 1.3 04-Jan-1996  pk Note return value of get_myaddress().
 1.2 25-Feb-1995  cgd save my sanity; stop using Id.
 1.1 07-Oct-1993  cgd move the rpc code into libc
 1.4.6.1 14-Nov-1997  mrg pull up from trunk: add missing .Nm entries. from spz@serpens.swb.de.
 1.9.8.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.10.4.5 08-Jan-2003  thorpej Sync with HEAD.
 1.10.4.4 22-Mar-2002  nathanw Catch up to -current.
 1.10.4.3 08-Mar-2002  nathanw Catch up to -current.
 1.10.4.2 28-Jan-2002  nathanw Catch up to -current.
 1.10.4.1 08-Oct-2001  nathanw Catch up to -current.
 1.10.2.1 26-Apr-2001  he Pull up revision 1.11 (requested by wiz):
Correct netconfig(5) reference and whitespace fixes.
 1.20.28.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.20.24.1 12-Apr-2009  snj Pull up following revision(s) (requested by joerg in ticket #692):
lib/libc/rpc/rpc.3: revision 1.21
Fix markup.
 1.23.2.1 23-May-2012  yamt sync with head.
 1.20 11-Mar-2013  tron Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.

This fixes PR lib/45293 by Pedro Giffuni.
 1.19 20-Mar-2012  matt branches: 1.19.2;
Use C89 definitions
Remove use of __P
 1.18 25-Apr-2008  christos branches: 1.18.4; 1.18.8; 1.18.24;
- always check malloc results
- don't leak fds on error
- don't cast malloc
- don't cast NULL
 1.17 29-May-2003  christos branches: 1.17.30;
de-lint pointer casts.
 1.16 14-Jul-2000  fvdl Use explicit int32 get/put macros. Needed for 64bit big-endian systems.
 1.15 22-Jan-2000  mycroft branches: 1.15.4;
Delint.
Remove trailing ; from uses of __weak_alias(). The macro inserts this if
needed.
 1.14 20-Sep-1999  lukem back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.13 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.12 20-Jan-1999  lukem * ensure memory is released if operations fail (in authunix_create(),
xdr_callmsg(), xprt_register(), svc_tcp(), svc_udp(), etc)
* don't attempt to close a socket filedescriptor if it's -1 (some from
freebsd, some i found)
* make the initial xid a little more random (from freebsd)
* fix some spelos and tyops in comments (some from freebsd)
* use warn() instead of warnx() for many errors; the user probably
wants to know what the error code was.
* knf & whitespace nitpicks
 1.11 15-Nov-1998  christos delint
 1.10 13-Feb-1998  lukem * in get_myaddress(); always return sockaddr_in containing localhost:PMAP_PORT.
(as recommended in Weiste Venema's portmap5_beta distribution)
* deprecate register
* use memmove instead of bcopy
* KNF includes
* use err/warn() instead of perror/fprintf(stderr,)
* fix some typos
 1.9 12-Feb-1998  lukem revert; we can't break the existing ABI and API
 1.8 10-Feb-1998  lukem major cleanup (to sync with changes made in include/rpc/*.h):
* use int32_t, size_t, in_port_t instead of long, u_int, u_short as appropriate
* use uid_t and gid_t instead of int
* KNF, fix typos and spellos
* use const as appropriate
* deprecate register
* use memmove instead of bcopy
* use err/warn()
 1.7 21-Jul-1997  jtc If port provides __weak_alias(), provide an Standard C and POSIX pure
identifier namespace by renaming non standard functions and variables
such that they have a leading underscore. The library will use those
names internally. Weak aliases are used to provide the original names
to the API.

This is only the first part of this change. It is most of the functions
which are implemented in C for all NetBSD ports. Subsequent changes are
to add the same support to the remaining C files, to assembly files, and
to the automagically generated assembly source used for system calls.
When all of the above is done, ports with weak alias support should add
a definition for __weak_alias to <sys/cdefs.h>.
 1.6 13-Jul-1997  christos Fix RCSID's
Fix gcc warnings.
Add missing prototypes
 1.5 20-Dec-1996  cgd string.h for prototypes
 1.4 29-Apr-1995  cgd branches: 1.4.4;
change some of the rpc "on-the-wire" structures' fields to be explicitly-sized
types. add xdr_{,u_}int{16,32}_t() functions to convert them.
This is necessary, because things like BPF use the RPC headers to look
at the on-the-wire data, so the headers must accurately represent
what's on the wire, too.
 1.3 25-Feb-1995  cgd save my sanity; stop using Id.
 1.2 04-Dec-1994  cgd be much more careful with types, and add prototype everything.
 1.1 07-Oct-1993  cgd move the rpc code into libc
 1.4.4.1 16-Sep-1996  jtc snapshot namespace cleanup: rpc & xdr
 1.15.4.1 14-Jul-2000  fvdl Pullup from trunk: use explicit 32 bit operations and types where
appropriate, to make things work on 64bit BE systems.
 1.17.30.1 18-May-2008  yamt sync with head.
 1.18.24.1 14-Mar-2013  riz Pull up following revision(s) (requested by tron in ticket #843):
lib/libc/rpc/clnt_dg.c: revision 1.28
lib/libc/rpc/xdr_sizeof.c: revision 1.5
lib/libc/rpc/pmap_getport.c: revision 1.19
lib/libc/rpc/xdr_mem.c: revision 1.19
lib/libc/rpc/svc_run.c: revision 1.22
lib/libc/rpc/bindresvport.c: revision 1.25
lib/libc/rpc/svc_raw.c: revision 1.24
lib/libc/rpc/svc_dg.c: revision 1.17
lib/libc/rpc/getnetconfig.c: revision 1.21
lib/libc/rpc/auth_unix.c: revision 1.25
lib/libc/rpc/svc_auth.c: revision 1.17
lib/libc/rpc/clnt_vc.c: revision 1.21
lib/libc/rpc/svc_auth_unix.c: revision 1.21
lib/libc/rpc/rpcb_st_xdr.c: revision 1.10
lib/libc/rpc/pmap_getmaps.c: revision 1.18
lib/libc/rpc/getnetpath.c: revision 1.17
lib/libc/rpc/clnt_simple.c: revision 1.32
lib/libc/rpc/authunix_prot.c: revision 1.16
lib/libc/rpc/svc_dg.h: revision 1.2
lib/libc/rpc/svc_generic.c: revision 1.15
lib/libc/rpc/clnt_raw.c: revision 1.32
lib/libc/rpc/xdr_array.c: revision 1.19
lib/libc/rpc/pmap_prot.c: revision 1.12
lib/libc/rpc/clnt_bcast.c: revision 1.26
lib/libc/rpc/xdr_rec.c: revision 1.35
lib/libc/rpc/svc.c: revision 1.34
lib/libc/rpc/DISCLAIMER: revision 1.3
lib/libc/rpc/clnt_generic.c: revision 1.30
lib/libc/rpc/xdr.c: revision 1.33
lib/libc/rpc/auth_none.c: revision 1.16
lib/libc/rpc/pmap_rmt.c: revision 1.34
lib/libc/rpc/rpc_callmsg.c: revision 1.20
lib/libc/rpc/clnt_perror.c: revision 1.30
lib/libc/rpc/xdr_stdio.c: revision 1.19
lib/libc/rpc/rpc_commondata.c: revision 1.9
lib/libc/rpc/pmap_prot2.c: revision 1.17
lib/libc/rpc/pmap_clnt.c: revision 1.19
lib/libc/rpc/svc_simple.c: revision 1.33
lib/libc/rpc/rpcb_clnt.c: revision 1.29
lib/libc/rpc/rpc_prot.c: revision 1.21
lib/libc/rpc/rpc_dtablesize.c: revision 1.16
lib/libc/rpc/rpc_generic.c: revision 1.28
lib/libc/rpc/xdr_reference.c: revision 1.18
lib/libc/rpc/rpc_soc.c: revision 1.18
lib/libc/rpc/svc_vc.c: revision 1.30
lib/libc/rpc/getrpcent.c: revision 1.23
lib/libc/rpc/xdr_float.c: revision 1.38
lib/libc/rpc/rpcb_prot.c: revision 1.11
lib/libc/rpc/getrpcport.c: revision 1.18
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.
This fixes PR lib/45293 by Pedro Giffuni.
 1.18.8.2 25-Apr-2008  christos - always check malloc results
- don't leak fds on error
- don't cast malloc
- don't cast NULL
 1.18.8.1 25-Apr-2008  christos file rpc_callmsg.c was added on branch christos-time_t on 2008-04-25 17:44:45 +0000
 1.18.4.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.18.4.1 17-Apr-2012  yamt sync with head
 1.19.2.1 23-Jun-2013  tls resync from head
 1.7 03-Oct-2020  christos Add set_rpc_maxgrouplist
 1.6 16-Apr-2003  wiz Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
 1.5 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.4 07-Feb-2002  ross Generate <>& symbolically.
 1.3 16-Sep-2001  wiz Mostly punctuation fixes; uppercase some .Sh arguments, and misc. fixes.
 1.2 16-Sep-2001  wiz Boring whitespace fixes.
 1.1 03-Jun-2000  fvdl branches: 1.1.4; 1.1.6;
Add missed manual page when updating RPC dode.
 1.1.6.3 22-Mar-2002  nathanw Catch up to -current.
 1.1.6.2 08-Mar-2002  nathanw Catch up to -current.
 1.1.6.1 08-Oct-2001  nathanw Catch up to -current.
 1.1.4.2 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 03-Jun-2000  minoura file rpc_clnt_auth.3 was added on branch minoura-xpg4dl on 2000-06-23 16:17:45 +0000
 1.7 03-Dec-2005  yamt - constify and remove __UNCONST from caller of clnt_call().
- use __UNCONST where approproate.
 1.6 16-Apr-2003  wiz Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
 1.5 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.4 07-Feb-2002  ross Generate <>& symbolically.
 1.3 16-Sep-2001  wiz Mostly punctuation fixes; uppercase some .Sh arguments, and misc. fixes.
 1.2 16-Sep-2001  wiz Boring whitespace fixes.
 1.1 02-Jun-2000  fvdl branches: 1.1.4; 1.1.6;
Add new RPC code, based on Sun's TI-RPC code. Adapted to not use XTI,
but sockets instead, internally. Old, backward compatible interfaces
maintained.
 1.1.6.3 22-Mar-2002  nathanw Catch up to -current.
 1.1.6.2 08-Mar-2002  nathanw Catch up to -current.
 1.1.6.1 08-Oct-2001  nathanw Catch up to -current.
 1.1.4.2 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 02-Jun-2000  minoura file rpc_clnt_calls.3 was added on branch minoura-xpg4dl on 2000-06-23 16:17:45 +0000
 1.13 03-Jul-2017  wiz Remove workaround for ancient HTML generation code.
 1.12 17-May-2011  enami Use Pq or Po macro for better output rather than putting raw open paren
at the end of line.
 1.11 23-May-2009  christos remove stray comma, from anon ymous.
 1.10 09-Apr-2009  joerg Fix markup
 1.9 16-Apr-2003  wiz branches: 1.9.38; 1.9.42;
Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
 1.8 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.7 03-Jan-2003  mjl Fix typos (from PR 19650)
 1.6 01-Oct-2002  wiz New sentence, new line. From Robert Elz.
 1.5 07-Feb-2002  ross Generate <>& symbolically.
 1.4 16-Sep-2001  wiz Mostly punctuation fixes; uppercase some .Sh arguments, and misc. fixes.
 1.3 16-Sep-2001  wiz Boring whitespace fixes.
 1.2 20-Jun-2000  fvdl branches: 1.2.2; 1.2.4; 1.2.6;
Fix 2 items.
 1.1 02-Jun-2000  fvdl Add new RPC code, based on Sun's TI-RPC code. Adapted to not use XTI,
but sockets instead, internally. Old, backward compatible interfaces
maintained.
 1.2.6.5 08-Jan-2003  thorpej Sync with HEAD.
 1.2.6.4 18-Oct-2002  nathanw Catch up to -current.
 1.2.6.3 22-Mar-2002  nathanw Catch up to -current.
 1.2.6.2 08-Mar-2002  nathanw Catch up to -current.
 1.2.6.1 08-Oct-2001  nathanw Catch up to -current.
 1.2.4.2 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.2.4.1 20-Jun-2000  minoura file rpc_clnt_create.3 was added on branch minoura-xpg4dl on 2000-06-23 16:17:45 +0000
 1.2.2.2 20-Jun-2000  fvdl Fix 2 items.
 1.2.2.1 20-Jun-2000  fvdl file rpc_clnt_create.3 was added on branch netbsd-1-5 on 2000-06-20 00:53:09 +0000
 1.9.42.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.9.38.1 10-Apr-2009  snj Pull up following revision(s) (requested by joerg in ticket #682):
lib/libc/rpc/rpc_clnt_create.3: revision 1.10
Fix markup
 1.4 08-Nov-2002  fvdl * Adapt include files for rpc_com.h/rpc_internal.h split.
* Add rpc_control to svc.c
* Implement non-blocking connections.
 1.3 10-Dec-2000  christos branches: 1.3.2; 1.3.4;
remove redundant declaration of _seterr_reply. Already declared in
<rpc/rpc_msg.h>
 1.2 06-Jul-2000  christos add __RPC_GETXID macro
don't const castway __rpc_getconf and __rpc_getconfig. It might try to
write const strings
fix non-portable casts
remove duplicated prototypes
cast things to proper types
remove extraneous casts to NULL
fix variable cast mismatches
remove register var declarations
 1.1 02-Jun-2000  fvdl branches: 1.1.4;
Add new RPC code, based on Sun's TI-RPC code. Adapted to not use XTI,
but sockets instead, internally. Old, backward compatible interfaces
maintained.
 1.1.4.2 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 02-Jun-2000  minoura file rpc_com.h was added on branch minoura-xpg4dl on 2000-06-23 16:17:46 +0000
 1.3.4.1 06-Jan-2003  jmc Pull up revisions 1.3-1.0 (requested by fvdl in ticket #1037)
* Adapt include files for rpc_com.h/rpc_internal.h split.
* Implement non-blocking connections.
* Add rpc_control to svc.c
 1.3.2.1 11-Nov-2002  nathanw Catch up to -current
 1.15 06-May-2025  uwe libc: g/c duplicate definition of rpc_createerr for !_REENTRANT

rpc_createerr is defined in rpc/mt_misc.c along with the
__rpc_createerr() wrapper. Apparently nobody tried to compile libc
!_REENTRANT since gcc became -fno-common by default.

I'm not sure if that global variable should not be defined for
_REENTRANT at all, so I'm not touching the other definition.
 1.14 08-Nov-2015  christos branches: 1.14.28;
Only do the compat cruft if we are compiling libc.
 1.13 07-Nov-2015  christos don't compile with SVC_LEGACY
 1.12 07-Nov-2015  christos Introduce a binary compatible __fd_set_256 that is what the original fdset
size was for libc. Now we can bump it.
 1.11 06-Nov-2015  christos Cleanup and simplify.
undef svc_fdset and svc_maxfd to get to the real data for the compat code.
 1.10 06-Nov-2015  joerg Don't use macros as types or variable names.
 1.9 11-Mar-2013  tron Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.

This fixes PR lib/45293 by Pedro Giffuni.
 1.8 18-Jan-2003  thorpej branches: 1.8.56; 1.8.58; 1.8.62;
Merge the nathanw_sa branch.
 1.7 02-Jun-2000  fvdl branches: 1.7.4;
Add new RPC code, based on Sun's TI-RPC code. Adapted to not use XTI,
but sockets instead, internally. Old, backward compatible interfaces
maintained.
 1.6 13-Feb-1998  lukem branches: 1.6.8;
* in get_myaddress(); always return sockaddr_in containing localhost:PMAP_PORT.
(as recommended in Weiste Venema's portmap5_beta distribution)
* deprecate register
* use memmove instead of bcopy
* KNF includes
* use err/warn() instead of perror/fprintf(stderr,)
* fix some typos
 1.5 13-Jul-1997  christos Fix RCSID's
Fix gcc warnings.
Add missing prototypes
 1.4 25-Feb-1995  cgd branches: 1.4.4;
save my sanity; stop using Id.
 1.3 23-Aug-1994  deraadt branches: 1.3.2;
fix my dumb bug
 1.2 20-Aug-1994  deraadt rpc library no longer uses _rpc_dtablesize() internally -- keeps track
of highest active file descriptor. limit fd usage to FD_SETSIZE, until
a better solution is found. remove non-FD_SETSIZE code.
 1.1 07-Oct-1993  cgd move the rpc code into libc
 1.3.2.2 23-Aug-1994  deraadt fix my dumb bug
 1.3.2.1 23-Aug-1994  deraadt file rpc_commondata.c was added on branch netbsd-1-0 on 1994-08-23 18:42:11 +0000
 1.4.4.1 16-Sep-1996  jtc snapshot namespace cleanup: rpc & xdr
 1.6.8.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.7.4.1 08-Aug-2001  nathanw Convert to our threading style.
__REENT -> _REENTRANT
Statically initialize mutexes.
Use pthread thread-specific data semantics and once_t instead of Sun thread
semantics.
Use __isthreaded to detect presence of thread universe instead of _thr_main().
 1.8.62.1 23-Jun-2013  tls resync from head
 1.8.58.1 14-Mar-2013  riz Pull up following revision(s) (requested by tron in ticket #843):
lib/libc/rpc/clnt_dg.c: revision 1.28
lib/libc/rpc/xdr_sizeof.c: revision 1.5
lib/libc/rpc/pmap_getport.c: revision 1.19
lib/libc/rpc/xdr_mem.c: revision 1.19
lib/libc/rpc/svc_run.c: revision 1.22
lib/libc/rpc/bindresvport.c: revision 1.25
lib/libc/rpc/svc_raw.c: revision 1.24
lib/libc/rpc/svc_dg.c: revision 1.17
lib/libc/rpc/getnetconfig.c: revision 1.21
lib/libc/rpc/auth_unix.c: revision 1.25
lib/libc/rpc/svc_auth.c: revision 1.17
lib/libc/rpc/clnt_vc.c: revision 1.21
lib/libc/rpc/svc_auth_unix.c: revision 1.21
lib/libc/rpc/rpcb_st_xdr.c: revision 1.10
lib/libc/rpc/pmap_getmaps.c: revision 1.18
lib/libc/rpc/getnetpath.c: revision 1.17
lib/libc/rpc/clnt_simple.c: revision 1.32
lib/libc/rpc/authunix_prot.c: revision 1.16
lib/libc/rpc/svc_dg.h: revision 1.2
lib/libc/rpc/svc_generic.c: revision 1.15
lib/libc/rpc/clnt_raw.c: revision 1.32
lib/libc/rpc/xdr_array.c: revision 1.19
lib/libc/rpc/pmap_prot.c: revision 1.12
lib/libc/rpc/clnt_bcast.c: revision 1.26
lib/libc/rpc/xdr_rec.c: revision 1.35
lib/libc/rpc/svc.c: revision 1.34
lib/libc/rpc/DISCLAIMER: revision 1.3
lib/libc/rpc/clnt_generic.c: revision 1.30
lib/libc/rpc/xdr.c: revision 1.33
lib/libc/rpc/auth_none.c: revision 1.16
lib/libc/rpc/pmap_rmt.c: revision 1.34
lib/libc/rpc/rpc_callmsg.c: revision 1.20
lib/libc/rpc/clnt_perror.c: revision 1.30
lib/libc/rpc/xdr_stdio.c: revision 1.19
lib/libc/rpc/rpc_commondata.c: revision 1.9
lib/libc/rpc/pmap_prot2.c: revision 1.17
lib/libc/rpc/pmap_clnt.c: revision 1.19
lib/libc/rpc/svc_simple.c: revision 1.33
lib/libc/rpc/rpcb_clnt.c: revision 1.29
lib/libc/rpc/rpc_prot.c: revision 1.21
lib/libc/rpc/rpc_dtablesize.c: revision 1.16
lib/libc/rpc/rpc_generic.c: revision 1.28
lib/libc/rpc/xdr_reference.c: revision 1.18
lib/libc/rpc/rpc_soc.c: revision 1.18
lib/libc/rpc/svc_vc.c: revision 1.30
lib/libc/rpc/getrpcent.c: revision 1.23
lib/libc/rpc/xdr_float.c: revision 1.38
lib/libc/rpc/rpcb_prot.c: revision 1.11
lib/libc/rpc/getrpcport.c: revision 1.18
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.
This fixes PR lib/45293 by Pedro Giffuni.
 1.8.56.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.14.28.1 02-Aug-2025  perseant Sync with HEAD
 1.16 11-Mar-2013  tron Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.

This fixes PR lib/45293 by Pedro Giffuni.
 1.15 20-Mar-2012  matt branches: 1.15.2;
Use C89 definitions
Remove use of __P
 1.14 15-Nov-1998  christos branches: 1.14.70; 1.14.72;
delint
 1.13 13-Feb-1998  lukem * in get_myaddress(); always return sockaddr_in containing localhost:PMAP_PORT.
(as recommended in Weiste Venema's portmap5_beta distribution)
* deprecate register
* use memmove instead of bcopy
* KNF includes
* use err/warn() instead of perror/fprintf(stderr,)
* fix some typos
 1.12 12-Feb-1998  lukem revert; we can't break the existing ABI and API
 1.11 10-Feb-1998  lukem major cleanup (to sync with changes made in include/rpc/*.h):
* use int32_t, size_t, in_port_t instead of long, u_int, u_short as appropriate
* use uid_t and gid_t instead of int
* KNF, fix typos and spellos
* use const as appropriate
* deprecate register
* use memmove instead of bcopy
* use err/warn()
 1.10 21-Jul-1997  jtc If port provides __weak_alias(), provide an Standard C and POSIX pure
identifier namespace by renaming non standard functions and variables
such that they have a leading underscore. The library will use those
names internally. Weak aliases are used to provide the original names
to the API.

This is only the first part of this change. It is most of the functions
which are implemented in C for all NetBSD ports. Subsequent changes are
to add the same support to the remaining C files, to assembly files, and
to the automagically generated assembly source used for system calls.
When all of the above is done, ports with weak alias support should add
a definition for __weak_alias to <sys/cdefs.h>.
 1.9 13-Jul-1997  christos Fix RCSID's
Fix gcc warnings.
Add missing prototypes
 1.8 18-Dec-1996  cgd sysconf() definitions are in unistd.h; use it rather than sys/param.h and
sys/sysctl.h. (without this, the previous checkin doesn't work.)
 1.7 18-Dec-1996  mrg oops; use _SC_OPEN_MAX instead of sysctl.
 1.6 17-Dec-1996  cgd repeat after me: size_t != int, especially when you're taking pointers.
 1.5 17-Dec-1996  mrg use sysctl() instead of getdtablesize()
 1.4 29-Mar-1996  jtc branches: 1.4.2;
Add explict function return types
 1.3 25-Feb-1995  cgd save my sanity; stop using Id.
 1.2 15-Aug-1994  andrew branches: 1.2.2;
Limit the upper bound of the value returned by _rpc_dtablesize() to not
break select(2) calls.
 1.1 07-Oct-1993  cgd move the rpc code into libc
 1.2.2.2 15-Aug-1994  andrew Limit the upper bound of the value returned by _rpc_dtablesize() to not
break select(2) calls.
 1.2.2.1 15-Aug-1994  andrew file rpc_dtablesize.c was added on branch netbsd-1-0 on 1994-08-15 07:56:51 +0000
 1.4.2.1 16-Sep-1996  jtc snapshot namespace cleanup: rpc & xdr
 1.14.72.1 14-Mar-2013  riz Pull up following revision(s) (requested by tron in ticket #843):
lib/libc/rpc/clnt_dg.c: revision 1.28
lib/libc/rpc/xdr_sizeof.c: revision 1.5
lib/libc/rpc/pmap_getport.c: revision 1.19
lib/libc/rpc/xdr_mem.c: revision 1.19
lib/libc/rpc/svc_run.c: revision 1.22
lib/libc/rpc/bindresvport.c: revision 1.25
lib/libc/rpc/svc_raw.c: revision 1.24
lib/libc/rpc/svc_dg.c: revision 1.17
lib/libc/rpc/getnetconfig.c: revision 1.21
lib/libc/rpc/auth_unix.c: revision 1.25
lib/libc/rpc/svc_auth.c: revision 1.17
lib/libc/rpc/clnt_vc.c: revision 1.21
lib/libc/rpc/svc_auth_unix.c: revision 1.21
lib/libc/rpc/rpcb_st_xdr.c: revision 1.10
lib/libc/rpc/pmap_getmaps.c: revision 1.18
lib/libc/rpc/getnetpath.c: revision 1.17
lib/libc/rpc/clnt_simple.c: revision 1.32
lib/libc/rpc/authunix_prot.c: revision 1.16
lib/libc/rpc/svc_dg.h: revision 1.2
lib/libc/rpc/svc_generic.c: revision 1.15
lib/libc/rpc/clnt_raw.c: revision 1.32
lib/libc/rpc/xdr_array.c: revision 1.19
lib/libc/rpc/pmap_prot.c: revision 1.12
lib/libc/rpc/clnt_bcast.c: revision 1.26
lib/libc/rpc/xdr_rec.c: revision 1.35
lib/libc/rpc/svc.c: revision 1.34
lib/libc/rpc/DISCLAIMER: revision 1.3
lib/libc/rpc/clnt_generic.c: revision 1.30
lib/libc/rpc/xdr.c: revision 1.33
lib/libc/rpc/auth_none.c: revision 1.16
lib/libc/rpc/pmap_rmt.c: revision 1.34
lib/libc/rpc/rpc_callmsg.c: revision 1.20
lib/libc/rpc/clnt_perror.c: revision 1.30
lib/libc/rpc/xdr_stdio.c: revision 1.19
lib/libc/rpc/rpc_commondata.c: revision 1.9
lib/libc/rpc/pmap_prot2.c: revision 1.17
lib/libc/rpc/pmap_clnt.c: revision 1.19
lib/libc/rpc/svc_simple.c: revision 1.33
lib/libc/rpc/rpcb_clnt.c: revision 1.29
lib/libc/rpc/rpc_prot.c: revision 1.21
lib/libc/rpc/rpc_dtablesize.c: revision 1.16
lib/libc/rpc/rpc_generic.c: revision 1.28
lib/libc/rpc/xdr_reference.c: revision 1.18
lib/libc/rpc/rpc_soc.c: revision 1.18
lib/libc/rpc/svc_vc.c: revision 1.30
lib/libc/rpc/getrpcent.c: revision 1.23
lib/libc/rpc/xdr_float.c: revision 1.38
lib/libc/rpc/rpcb_prot.c: revision 1.11
lib/libc/rpc/getrpcport.c: revision 1.18
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.
This fixes PR lib/45293 by Pedro Giffuni.
 1.14.70.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.14.70.1 17-Apr-2012  yamt sync with head
 1.15.2.1 23-Jun-2013  tls resync from head
 1.30 03-May-2017  christos - limit size of buffers to RPC_MAXDATASIZE
- don't leak memory
- be more picky about bad parameters
https://raw.githubusercontent.com/guidovranken/rpcbomb/master/libtirpc_patch.txt

XXX: pullup-7
 1.29 05-Apr-2013  dholland branches: 1.29.18;
stdlib.h, not malloc.h
 1.28 11-Mar-2013  tron Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.

This fixes PR lib/45293 by Pedro Giffuni.
 1.27 05-Mar-2013  christos make this usable from RUMP
 1.26 20-Mar-2012  matt branches: 1.26.2;
Use C89 definitions
Remove use of __P
 1.25 13-Mar-2012  christos PR/45989: Martin Husemann: lint invocation does include -w only on i386

- turn lint -w for all the platforms after fixing the lint warnings.
- add _DIAGASSERTS() for casts that would assign values to types that
would not fit.
- change types, add casts
- change into ansii prototypes
- turn on _DIAGNOSTIC for libc (during current, to be eliminated for release
builds)

approved by core@
 1.24 08-Dec-2010  joerg branches: 1.24.6; 1.24.8;
Use __isthreaded from reentrant.h and don't redeclare it.
 1.23 25-Apr-2008  christos branches: 1.23.8;
- always check malloc results
- don't leak fds on error
- don't cast malloc
- don't cast NULL
 1.22 22-Jun-2006  christos branches: 1.22.18;
Centralize the TCP_NODELAY handling as discussed in tech-net.
 1.21 19-Mar-2006  christos Coverity CID 2277: Don't leak memory on error.
 1.20 29-Nov-2005  christos WARNS=4
 1.19 01-Jun-2005  lukem appease gcc -Wuninitialized
 1.18 09-Feb-2005  kleink A little libc namespace housekeeping exercise:
* Make vfprintf_unlocked() an internal function, c.f. __svfscanf_unlocked().
* Add internal names for arc4random(), endnetpath(), fhstatvfs(),
fstatvfs(), mkstemp(), shquote(), statvfs(), taddr2uaddr(), uaddr2taddr(),
uuid_create_nil(), uuid_is_nil(), and wcwidth().
* Include namespace.h where supposed to.
 1.17 08-Jan-2005  lukem delint -UINET6
 1.16 21-Oct-2003  fvdl Don't use NULL to compare against a char.
 1.15 09-Sep-2003  itojun __RCSID police
 1.14 09-Sep-2003  itojun use niels provos' random sequence number generator to initialize RPC XID.
 1.13 07-Jun-2003  yamt - change default message size for udp to UDPMSGSIZE(8800) from 8192.
(to be compatible with pre-TIRPC)
- bump message size limit to 256k.

from FreeBSD's rev.1.3.
 1.12 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.11 11-Nov-2002  thorpej Fix signed/unsigned comparison warnings.
 1.10 08-Nov-2002  fvdl * Adapt include files for rpc_com.h/rpc_internal.h split.
* Add rpc_control to svc.c
* Implement non-blocking connections.
 1.9 04-Nov-2001  lukem branches: 1.9.2;
fix WARNS=2 (-Wshadow) warnings
 1.8 26-May-2001  kristerw Free the correct buffer in error handling.
Handle that malloc may return NULL.
 1.7 22-Apr-2001  fvdl In __rpc_uaddr2taddr_af, actually return useful data for the AF_LOCAL
case. From FreeBSD.
 1.6 25-Jan-2001  jdolecek branches: 1.6.2;
make local constant arrays const
 1.5 04-Jan-2001  lukem sprinkle _DIAGASSERT() appropriately. minor other cleanups
 1.4 28-Sep-2000  kleink Need "namespace.h".
 1.3 06-Jul-2000  christos add __RPC_GETXID macro
don't const castway __rpc_getconf and __rpc_getconfig. It might try to
write const strings
fix non-portable casts
remove duplicated prototypes
cast things to proper types
remove extraneous casts to NULL
fix variable cast mismatches
remove register var declarations
 1.2 11-Jun-2000  assar branches: 1.2.2; 1.2.4;
syslog an error if /etc/netconfig is not found. fixes lib/10275
 1.1 02-Jun-2000  fvdl Add new RPC code, based on Sun's TI-RPC code. Adapted to not use XTI,
but sockets instead, internally. Old, backward compatible interfaces
maintained.
 1.2.4.2 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.2.4.1 11-Jun-2000  minoura file rpc_generic.c was added on branch minoura-xpg4dl on 2000-06-23 16:17:46 +0000
 1.2.2.1 17-Nov-2000  tv 1.5 last minute fix: bump UDP RPC maximum limit from 8192 to 65508.
Original patch by soda, will be fixed more `appropriately' for 1.5.1,
but this will allow things like rumba and amq to work properly with >8K
RPC-over-UDP request sizes.
 1.6.2.5 10-Dec-2002  thorpej Sync with HEAD.
 1.6.2.4 11-Nov-2002  nathanw Catch up to -current
 1.6.2.3 14-Nov-2001  nathanw Catch up to -current.
 1.6.2.2 08-Oct-2001  nathanw Catch up to -current.
 1.6.2.1 08-Aug-2001  nathanw Convert to our threading style.
__REENT -> _REENTRANT
Statically initialize mutexes.
Use pthread thread-specific data semantics and once_t instead of Sun thread
semantics.
Use __isthreaded to detect presence of thread universe instead of _thr_main().
 1.9.2.1 06-Jan-2003  jmc Pull up revisions 1.9-1.10 (requested by fvdl in ticket #1037)
* Adapt include files for rpc_com.h/rpc_internal.h split.
* Implement non-blocking connections.
* Add rpc_control to svc.c
 1.22.18.1 18-May-2008  yamt sync with head.
 1.23.8.2 25-Apr-2008  christos - always check malloc results
- don't leak fds on error
- don't cast malloc
- don't cast NULL
 1.23.8.1 25-Apr-2008  christos file rpc_generic.c was added on branch christos-time_t on 2008-04-25 17:44:45 +0000
 1.24.8.1 14-Mar-2013  riz Pull up following revision(s) (requested by tron in ticket #843):
lib/libc/rpc/clnt_dg.c: revision 1.28
lib/libc/rpc/xdr_sizeof.c: revision 1.5
lib/libc/rpc/pmap_getport.c: revision 1.19
lib/libc/rpc/xdr_mem.c: revision 1.19
lib/libc/rpc/svc_run.c: revision 1.22
lib/libc/rpc/bindresvport.c: revision 1.25
lib/libc/rpc/svc_raw.c: revision 1.24
lib/libc/rpc/svc_dg.c: revision 1.17
lib/libc/rpc/getnetconfig.c: revision 1.21
lib/libc/rpc/auth_unix.c: revision 1.25
lib/libc/rpc/svc_auth.c: revision 1.17
lib/libc/rpc/clnt_vc.c: revision 1.21
lib/libc/rpc/svc_auth_unix.c: revision 1.21
lib/libc/rpc/rpcb_st_xdr.c: revision 1.10
lib/libc/rpc/pmap_getmaps.c: revision 1.18
lib/libc/rpc/getnetpath.c: revision 1.17
lib/libc/rpc/clnt_simple.c: revision 1.32
lib/libc/rpc/authunix_prot.c: revision 1.16
lib/libc/rpc/svc_dg.h: revision 1.2
lib/libc/rpc/svc_generic.c: revision 1.15
lib/libc/rpc/clnt_raw.c: revision 1.32
lib/libc/rpc/xdr_array.c: revision 1.19
lib/libc/rpc/pmap_prot.c: revision 1.12
lib/libc/rpc/clnt_bcast.c: revision 1.26
lib/libc/rpc/xdr_rec.c: revision 1.35
lib/libc/rpc/svc.c: revision 1.34
lib/libc/rpc/DISCLAIMER: revision 1.3
lib/libc/rpc/clnt_generic.c: revision 1.30
lib/libc/rpc/xdr.c: revision 1.33
lib/libc/rpc/auth_none.c: revision 1.16
lib/libc/rpc/pmap_rmt.c: revision 1.34
lib/libc/rpc/rpc_callmsg.c: revision 1.20
lib/libc/rpc/clnt_perror.c: revision 1.30
lib/libc/rpc/xdr_stdio.c: revision 1.19
lib/libc/rpc/rpc_commondata.c: revision 1.9
lib/libc/rpc/pmap_prot2.c: revision 1.17
lib/libc/rpc/pmap_clnt.c: revision 1.19
lib/libc/rpc/svc_simple.c: revision 1.33
lib/libc/rpc/rpcb_clnt.c: revision 1.29
lib/libc/rpc/rpc_prot.c: revision 1.21
lib/libc/rpc/rpc_dtablesize.c: revision 1.16
lib/libc/rpc/rpc_generic.c: revision 1.28
lib/libc/rpc/xdr_reference.c: revision 1.18
lib/libc/rpc/rpc_soc.c: revision 1.18
lib/libc/rpc/svc_vc.c: revision 1.30
lib/libc/rpc/getrpcent.c: revision 1.23
lib/libc/rpc/xdr_float.c: revision 1.38
lib/libc/rpc/rpcb_prot.c: revision 1.11
lib/libc/rpc/getrpcport.c: revision 1.18
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.
This fixes PR lib/45293 by Pedro Giffuni.
 1.24.6.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.24.6.1 17-Apr-2012  yamt sync with head
 1.26.2.1 23-Jun-2013  tls resync from head
 1.29.18.1 11-May-2017  pgoyette Sync with HEAD
 1.9 23-Jan-2024  christos fix nested extern warnings
 1.8 07-Nov-2015  christos PR/50408: Pedro Giffuni: Provide a way for rpc to use poll(2) instead of
select(2), and the linux svc_pollfd and svc_maxpollfd members. Our select(2)
implementation does not suffer from the FD_SETSIZE limitation so this is
not turned on by default.
 1.7 07-May-2013  christos - add __clnt_sigfillset() that does not blindly block all signals but excludes
the tty generated ones (int, quit, tstp), plus term and hup. This makes
command line clients behave on connect(2) where before they would need
to be killed from a different tty. Much easier than making the file
descriptor non-blocking for the duration of connect and then using
pselect/pollts to detect when actual connection or timeout occured using
a different sigmask.
- factor out some of the error paths.
 1.6 04-Apr-2009  christos branches: 1.6.6; 1.6.12;
PR/41138: Henning Petersen: Redundant declarations in rpc_internal.h
While here remove __P, KNF.
 1.5 28-Apr-2008  martin branches: 1.5.8; 1.5.10;
Remove clause 3 and 4 from TNF licenses
 1.4 28-May-2004  christos branches: 1.4.24;
PR/25003: John Kohl: File is missing a copyright.
 1.3 09-Sep-2003  itojun use niels provos' random sequence number generator to initialize RPC XID.
 1.2 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.1 08-Nov-2002  fvdl branches: 1.1.2; 1.1.4;
* Adapt include files for rpc_com.h/rpc_internal.h split.
* Add rpc_control to svc.c
* Implement non-blocking connections.
 1.1.4.2 08-Nov-2002  fvdl * Adapt include files for rpc_com.h/rpc_internal.h split.
* Add rpc_control to svc.c
* Implement non-blocking connections.
 1.1.4.1 08-Nov-2002  fvdl file rpc_internal.h was added on branch netbsd-1-6 on 2002-11-08 00:13:09 +0000
 1.1.2.2 11-Nov-2002  nathanw Catch up to -current
 1.1.2.1 08-Nov-2002  nathanw file rpc_internal.h was added on branch nathanw_sa on 2002-11-11 22:22:43 +0000
 1.4.24.1 18-May-2008  yamt sync with head.
 1.5.10.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.5.8.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.5.8.1 28-Apr-2008  martin file rpc_internal.h was added on branch christos-time_t on 2008-04-28 20:23:01 +0000
 1.6.12.1 23-Jun-2013  tls resync from head
 1.6.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.21 11-Mar-2013  tron Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.

This fixes PR lib/45293 by Pedro Giffuni.
 1.20 20-Mar-2012  matt branches: 1.20.2;
Use C89 definitions
Remove use of __P
 1.19 13-Mar-2012  christos PR/45989: Martin Husemann: lint invocation does include -w only on i386

- turn lint -w for all the platforms after fixing the lint warnings.
- add _DIAGASSERTS() for casts that would assign values to types that
would not fit.
- change types, add casts
- change into ansii prototypes
- turn on _DIAGNOSTIC for libc (during current, to be eliminated for release
builds)

approved by core@
 1.18 29-May-2003  christos branches: 1.18.56; 1.18.58;
de-lint pointer casts.
 1.17 20-Dec-2000  christos remove redundant declarations.
 1.16 02-Jun-2000  fvdl Add new RPC code, based on Sun's TI-RPC code. Adapted to not use XTI,
but sockets instead, internally. Old, backward compatible interfaces
maintained.
 1.15 22-Jan-2000  mycroft branches: 1.15.2;
Delint.
Remove trailing ; from uses of __weak_alias(). The macro inserts this if
needed.
 1.14 20-Sep-1999  lukem back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.13 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.12 31-Jan-1999  christos xdrproc_t casts.
 1.11 20-Jan-1999  lukem * ensure memory is released if operations fail (in authunix_create(),
xdr_callmsg(), xprt_register(), svc_tcp(), svc_udp(), etc)
* don't attempt to close a socket filedescriptor if it's -1 (some from
freebsd, some i found)
* make the initial xid a little more random (from freebsd)
* fix some spelos and tyops in comments (some from freebsd)
* use warn() instead of warnx() for many errors; the user probably
wants to know what the error code was.
* knf & whitespace nitpicks
 1.10 15-Nov-1998  christos delint
 1.9 26-Jul-1998  mycroft const poisoning.
 1.8 13-Feb-1998  lukem * in get_myaddress(); always return sockaddr_in containing localhost:PMAP_PORT.
(as recommended in Weiste Venema's portmap5_beta distribution)
* deprecate register
* use memmove instead of bcopy
* KNF includes
* use err/warn() instead of perror/fprintf(stderr,)
* fix some typos
 1.7 12-Feb-1998  lukem revert; we can't break the existing ABI and API
 1.6 10-Feb-1998  lukem major cleanup (to sync with changes made in include/rpc/*.h):
* use int32_t, size_t, in_port_t instead of long, u_int, u_short as appropriate
* use uid_t and gid_t instead of int
* KNF, fix typos and spellos
* use const as appropriate
* deprecate register
* use memmove instead of bcopy
* use err/warn()
 1.5 21-Jul-1997  jtc If port provides __weak_alias(), provide an Standard C and POSIX pure
identifier namespace by renaming non standard functions and variables
such that they have a leading underscore. The library will use those
names internally. Weak aliases are used to provide the original names
to the API.

This is only the first part of this change. It is most of the functions
which are implemented in C for all NetBSD ports. Subsequent changes are
to add the same support to the remaining C files, to assembly files, and
to the automagically generated assembly source used for system calls.
When all of the above is done, ports with weak alias support should add
a definition for __weak_alias to <sys/cdefs.h>.
 1.4 13-Jul-1997  christos Fix bug where RPC_VERSMISMATCH was used instead of RPC_MISMATCH.
Fix RCSID's
Fix gcc warnings.
 1.3 29-Apr-1995  cgd branches: 1.3.4;
change some of the rpc "on-the-wire" structures' fields to be explicitly-sized
types. add xdr_{,u_}int{16,32}_t() functions to convert them.
This is necessary, because things like BPF use the RPC headers to look
at the on-the-wire data, so the headers must accurately represent
what's on the wire, too.
 1.2 25-Feb-1995  cgd save my sanity; stop using Id.
 1.1 07-Oct-1993  cgd move the rpc code into libc
 1.3.4.1 16-Sep-1996  jtc snapshot namespace cleanup: rpc & xdr
 1.15.2.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.18.58.1 14-Mar-2013  riz Pull up following revision(s) (requested by tron in ticket #843):
lib/libc/rpc/clnt_dg.c: revision 1.28
lib/libc/rpc/xdr_sizeof.c: revision 1.5
lib/libc/rpc/pmap_getport.c: revision 1.19
lib/libc/rpc/xdr_mem.c: revision 1.19
lib/libc/rpc/svc_run.c: revision 1.22
lib/libc/rpc/bindresvport.c: revision 1.25
lib/libc/rpc/svc_raw.c: revision 1.24
lib/libc/rpc/svc_dg.c: revision 1.17
lib/libc/rpc/getnetconfig.c: revision 1.21
lib/libc/rpc/auth_unix.c: revision 1.25
lib/libc/rpc/svc_auth.c: revision 1.17
lib/libc/rpc/clnt_vc.c: revision 1.21
lib/libc/rpc/svc_auth_unix.c: revision 1.21
lib/libc/rpc/rpcb_st_xdr.c: revision 1.10
lib/libc/rpc/pmap_getmaps.c: revision 1.18
lib/libc/rpc/getnetpath.c: revision 1.17
lib/libc/rpc/clnt_simple.c: revision 1.32
lib/libc/rpc/authunix_prot.c: revision 1.16
lib/libc/rpc/svc_dg.h: revision 1.2
lib/libc/rpc/svc_generic.c: revision 1.15
lib/libc/rpc/clnt_raw.c: revision 1.32
lib/libc/rpc/xdr_array.c: revision 1.19
lib/libc/rpc/pmap_prot.c: revision 1.12
lib/libc/rpc/clnt_bcast.c: revision 1.26
lib/libc/rpc/xdr_rec.c: revision 1.35
lib/libc/rpc/svc.c: revision 1.34
lib/libc/rpc/DISCLAIMER: revision 1.3
lib/libc/rpc/clnt_generic.c: revision 1.30
lib/libc/rpc/xdr.c: revision 1.33
lib/libc/rpc/auth_none.c: revision 1.16
lib/libc/rpc/pmap_rmt.c: revision 1.34
lib/libc/rpc/rpc_callmsg.c: revision 1.20
lib/libc/rpc/clnt_perror.c: revision 1.30
lib/libc/rpc/xdr_stdio.c: revision 1.19
lib/libc/rpc/rpc_commondata.c: revision 1.9
lib/libc/rpc/pmap_prot2.c: revision 1.17
lib/libc/rpc/pmap_clnt.c: revision 1.19
lib/libc/rpc/svc_simple.c: revision 1.33
lib/libc/rpc/rpcb_clnt.c: revision 1.29
lib/libc/rpc/rpc_prot.c: revision 1.21
lib/libc/rpc/rpc_dtablesize.c: revision 1.16
lib/libc/rpc/rpc_generic.c: revision 1.28
lib/libc/rpc/xdr_reference.c: revision 1.18
lib/libc/rpc/rpc_soc.c: revision 1.18
lib/libc/rpc/svc_vc.c: revision 1.30
lib/libc/rpc/getrpcent.c: revision 1.23
lib/libc/rpc/xdr_float.c: revision 1.38
lib/libc/rpc/rpcb_prot.c: revision 1.11
lib/libc/rpc/getrpcport.c: revision 1.18
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.
This fixes PR lib/45293 by Pedro Giffuni.
 1.18.56.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.18.56.1 17-Apr-2012  yamt sync with head
 1.20.2.1 23-Jun-2013  tls resync from head
 1.17 03-Jul-2017  wiz Remove workaround for ancient HTML generation code.
 1.16 29-Dec-2016  wiz Update prototypes to match current RPC code.
Bump date.
 1.15 08-Aug-2016  dholland Typo.
 1.14 04-Mar-2013  christos branches: 1.14.12;
PR/47617: Thorsten Brehm: Memory and socket leak in librpc
 1.13 11-Jan-2009  christos branches: 1.13.8; 1.13.14;
merge christos-time_t
 1.12 12-Dec-2008  christos document svc_getrpccaller
 1.11 16-Feb-2004  lukem branches: 1.11.40;
document svcudp_create
 1.10 26-Jul-2003  salo netbsd.org->NetBSD.org
 1.9 27-Jun-2003  wiz Fix typos in macro names.
 1.8 17-Apr-2003  wiz Convert to mdoc. Fix one or two bugs while here, hope I didn't introduce
more :)
 1.7 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.6 01-Oct-2002  wiz New sentence, new line. From Robert Elz.
 1.5 31-Jul-2002  soren Make pmap_set(3) prototype match reality.
Fixes PR lib/6064.
 1.4 07-Feb-2002  ross Generate <>& symbolically.
 1.3 16-Sep-2001  wiz Boring whitespace fixes.
 1.2 07-Jun-2000  simonb branches: 1.2.4; 1.2.6;
Spell registerrpc properly.
 1.1 02-Jun-2000  fvdl Add new RPC code, based on Sun's TI-RPC code. Adapted to not use XTI,
but sockets instead, internally. Old, backward compatible interfaces
maintained.
 1.2.6.5 18-Oct-2002  nathanw Catch up to -current.
 1.2.6.4 01-Aug-2002  nathanw Catch up to -current.
 1.2.6.3 22-Mar-2002  nathanw Catch up to -current.
 1.2.6.2 08-Mar-2002  nathanw Catch up to -current.
 1.2.6.1 08-Oct-2001  nathanw Catch up to -current.
 1.2.4.2 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.2.4.1 07-Jun-2000  minoura file rpc_soc.3 was added on branch minoura-xpg4dl on 2000-06-23 16:17:47 +0000
 1.11.40.1 04-Jan-2009  christos merge with head.
 1.13.14.1 23-Jun-2013  tls resync from head
 1.13.8.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.14.12.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.24 23-Jan-2024  christos fix nested extern warnings
 1.23 13-Nov-2015  christos Generalize the test, compare on the protocol semantics instead of the name
since it could be udp6...
 1.22 13-Nov-2015  tron Don't try to use listen(2) on a UDP socket which will always fail.
Previously this was not a problem because the return value of listen(2)
was ignored. With this fix amd(8) no longer fails to start with the
error message "cannot create rpc/udp service".

TL;DR: Make amd(8) work again
 1.21 10-Nov-2015  christos fix compilation/lint
 1.20 10-Nov-2015  christos CID 1338513: Check listen(2) return
 1.19 28-May-2014  christos CID 97511{4,5}: Ignore bindresvport return. It only works for root.
 1.18 11-Mar-2013  tron branches: 1.18.6;
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.

This fixes PR lib/45293 by Pedro Giffuni.
 1.17 05-Mar-2013  christos make this usable from RUMP
 1.16 25-Jun-2012  abs branches: 1.16.2;
Update old-style definitions to ANSI, remove a couple of register
definitions along the way. Fixed gcc 4.1 build (thank you vax)
 1.15 24-Jun-2012  christos fix old style definitions; XXX: gcc should have picked them up but it did not.
 1.14 20-Mar-2012  matt Use C89 definitions
Remove use of __P
 1.13 08-Dec-2010  joerg branches: 1.13.6; 1.13.8;
Use __isthreaded from reentrant.h and don't redeclare it.
 1.12 29-Nov-2005  christos WARNS=4
 1.11 09-Sep-2003  itojun __RCSID police
 1.10 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.9 08-Nov-2002  fvdl * Adapt include files for rpc_com.h/rpc_internal.h split.
* Add rpc_control to svc.c
* Implement non-blocking connections.
 1.8 04-Nov-2001  lukem branches: 1.8.2;
fix WARNS=2 (-Wshadow) warnings
 1.7 04-Jan-2001  lukem branches: 1.7.2;
sprinkle _DIAGASSERT() appropriately. minor other cleanups
 1.6 06-Jul-2000  christos add __RPC_GETXID macro
don't const castway __rpc_getconf and __rpc_getconfig. It might try to
write const strings
fix non-portable casts
remove duplicated prototypes
cast things to proper types
remove extraneous casts to NULL
fix variable cast mismatches
remove register var declarations
 1.5 07-Jun-2000  fvdl branches: 1.5.4;
Always do a listen() in the old svctcp_create backward compat code.
 1.4 04-Jun-2000  thorpej Need <string.h> for LP64 systems.
 1.3 03-Jun-2000  fvdl Add missing weak alias for svcfd_create.
 1.2 03-Jun-2000  fvdl Fix typo in weak alias, causing unresolved externals.
 1.1 02-Jun-2000  fvdl Add new RPC code, based on Sun's TI-RPC code. Adapted to not use XTI,
but sockets instead, internally. Old, backward compatible interfaces
maintained.
 1.5.4.2 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.5.4.1 07-Jun-2000  minoura file rpc_soc.c was added on branch minoura-xpg4dl on 2000-06-23 16:17:47 +0000
 1.7.2.3 11-Nov-2002  nathanw Catch up to -current
 1.7.2.2 14-Nov-2001  nathanw Catch up to -current.
 1.7.2.1 08-Aug-2001  nathanw Convert to our threading style.
__REENT -> _REENTRANT
Statically initialize mutexes.
Use pthread thread-specific data semantics and once_t instead of Sun thread
semantics.
Use __isthreaded to detect presence of thread universe instead of _thr_main().
 1.8.2.1 06-Jan-2003  jmc Pull up revisions 1.8-1.9 (requested by fvdl in ticket #1037)
* Adapt include files for rpc_com.h/rpc_internal.h split.
* Implement non-blocking connections.
* Add rpc_control to svc.c
 1.13.8.1 14-Mar-2013  riz Pull up following revision(s) (requested by tron in ticket #843):
lib/libc/rpc/clnt_dg.c: revision 1.28
lib/libc/rpc/xdr_sizeof.c: revision 1.5
lib/libc/rpc/pmap_getport.c: revision 1.19
lib/libc/rpc/xdr_mem.c: revision 1.19
lib/libc/rpc/svc_run.c: revision 1.22
lib/libc/rpc/bindresvport.c: revision 1.25
lib/libc/rpc/svc_raw.c: revision 1.24
lib/libc/rpc/svc_dg.c: revision 1.17
lib/libc/rpc/getnetconfig.c: revision 1.21
lib/libc/rpc/auth_unix.c: revision 1.25
lib/libc/rpc/svc_auth.c: revision 1.17
lib/libc/rpc/clnt_vc.c: revision 1.21
lib/libc/rpc/svc_auth_unix.c: revision 1.21
lib/libc/rpc/rpcb_st_xdr.c: revision 1.10
lib/libc/rpc/pmap_getmaps.c: revision 1.18
lib/libc/rpc/getnetpath.c: revision 1.17
lib/libc/rpc/clnt_simple.c: revision 1.32
lib/libc/rpc/authunix_prot.c: revision 1.16
lib/libc/rpc/svc_dg.h: revision 1.2
lib/libc/rpc/svc_generic.c: revision 1.15
lib/libc/rpc/clnt_raw.c: revision 1.32
lib/libc/rpc/xdr_array.c: revision 1.19
lib/libc/rpc/pmap_prot.c: revision 1.12
lib/libc/rpc/clnt_bcast.c: revision 1.26
lib/libc/rpc/xdr_rec.c: revision 1.35
lib/libc/rpc/svc.c: revision 1.34
lib/libc/rpc/DISCLAIMER: revision 1.3
lib/libc/rpc/clnt_generic.c: revision 1.30
lib/libc/rpc/xdr.c: revision 1.33
lib/libc/rpc/auth_none.c: revision 1.16
lib/libc/rpc/pmap_rmt.c: revision 1.34
lib/libc/rpc/rpc_callmsg.c: revision 1.20
lib/libc/rpc/clnt_perror.c: revision 1.30
lib/libc/rpc/xdr_stdio.c: revision 1.19
lib/libc/rpc/rpc_commondata.c: revision 1.9
lib/libc/rpc/pmap_prot2.c: revision 1.17
lib/libc/rpc/pmap_clnt.c: revision 1.19
lib/libc/rpc/svc_simple.c: revision 1.33
lib/libc/rpc/rpcb_clnt.c: revision 1.29
lib/libc/rpc/rpc_prot.c: revision 1.21
lib/libc/rpc/rpc_dtablesize.c: revision 1.16
lib/libc/rpc/rpc_generic.c: revision 1.28
lib/libc/rpc/xdr_reference.c: revision 1.18
lib/libc/rpc/rpc_soc.c: revision 1.18
lib/libc/rpc/svc_vc.c: revision 1.30
lib/libc/rpc/getrpcent.c: revision 1.23
lib/libc/rpc/xdr_float.c: revision 1.38
lib/libc/rpc/rpcb_prot.c: revision 1.11
lib/libc/rpc/getrpcport.c: revision 1.18
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.
This fixes PR lib/45293 by Pedro Giffuni.
 1.13.6.3 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.13.6.2 30-Oct-2012  yamt sync with head
 1.13.6.1 17-Apr-2012  yamt sync with head
 1.16.2.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.16.2.1 23-Jun-2013  tls resync from head
 1.18.6.1 10-Aug-2014  tls Rebase.
 1.13 25-Oct-2017  abhinav Add __svc_getcallercreds to the NAME section
Remove Pp before It at various places
 1.12 22-Mar-2010  joerg Use .In for header files instead of .Ar Pa and variations.
 1.11 11-Apr-2009  joerg Remove .IP, it doesn't change output.
 1.10 03-May-2004  lukem branches: 1.10.36;
fix description for svc_getreqset()
 1.9 01-Jul-2003  wiz Use Em instead of weird Bf usage.
 1.8 27-Jun-2003  wiz Use Aq Pa instead of Fd \*[Lt]...\*[Gt].
 1.7 16-Apr-2003  wiz Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
 1.6 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.5 01-Oct-2002  wiz New sentence, new line. From Robert Elz.
 1.4 07-Feb-2002  ross Generate <>& symbolically.
 1.3 16-Sep-2001  wiz Mostly punctuation fixes; uppercase some .Sh arguments, and misc. fixes.
 1.2 05-Jun-2001  wiz NetBSD -> Nx, and some whitespace nits.
 1.1 02-Jun-2000  fvdl branches: 1.1.4; 1.1.6;
Add new RPC code, based on Sun's TI-RPC code. Adapted to not use XTI,
but sockets instead, internally. Old, backward compatible interfaces
maintained.
 1.1.6.4 18-Oct-2002  nathanw Catch up to -current.
 1.1.6.3 22-Mar-2002  nathanw Catch up to -current.
 1.1.6.2 08-Mar-2002  nathanw Catch up to -current.
 1.1.6.1 08-Oct-2001  nathanw Catch up to -current.
 1.1.4.2 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 02-Jun-2000  minoura file rpc_svc_calls.3 was added on branch minoura-xpg4dl on 2000-06-23 16:17:47 +0000
 1.10.36.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.11 22-Mar-2010  joerg Use .In for header files instead of .Ar Pa and variations.
 1.10 11-Mar-2009  wiz Do not mark up punctuation.
 1.9 11-Mar-2009  joerg Fix markup
 1.8 27-Jun-2003  wiz branches: 1.8.42;
Use Aq Pa instead of Fd \*[Lt]...\*[Gt].
 1.7 16-Apr-2003  wiz Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
 1.6 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.5 01-Oct-2002  wiz New sentence, new line. From Robert Elz.
 1.4 07-Feb-2002  ross Generate <>& symbolically.
 1.3 16-Sep-2001  wiz Mostly punctuation fixes; uppercase some .Sh arguments, and misc. fixes.
 1.2 09-Apr-2001  wiz Add RCS Id, and some whitespace/punctuation fixes.
 1.1 02-Jun-2000  fvdl branches: 1.1.4; 1.1.6;
Add new RPC code, based on Sun's TI-RPC code. Adapted to not use XTI,
but sockets instead, internally. Old, backward compatible interfaces
maintained.
 1.1.6.4 18-Oct-2002  nathanw Catch up to -current.
 1.1.6.3 22-Mar-2002  nathanw Catch up to -current.
 1.1.6.2 08-Mar-2002  nathanw Catch up to -current.
 1.1.6.1 08-Oct-2001  nathanw Catch up to -current.
 1.1.4.2 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 02-Jun-2000  minoura file rpc_svc_create.3 was added on branch minoura-xpg4dl on 2000-06-23 16:17:47 +0000
 1.8.42.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.6 16-Apr-2003  wiz Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
 1.5 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.4 07-Feb-2002  ross Generate <>& symbolically.
 1.3 16-Sep-2001  wiz Mostly punctuation fixes; uppercase some .Sh arguments, and misc. fixes.
 1.2 16-Sep-2001  wiz Boring whitespace fixes.
 1.1 02-Jun-2000  fvdl branches: 1.1.4; 1.1.6;
Add new RPC code, based on Sun's TI-RPC code. Adapted to not use XTI,
but sockets instead, internally. Old, backward compatible interfaces
maintained.
 1.1.6.3 22-Mar-2002  nathanw Catch up to -current.
 1.1.6.2 08-Mar-2002  nathanw Catch up to -current.
 1.1.6.1 08-Oct-2001  nathanw Catch up to -current.
 1.1.4.2 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 02-Jun-2000  minoura file rpc_svc_err.3 was added on branch minoura-xpg4dl on 2000-06-23 16:17:48 +0000
 1.11 03-Jul-2017  wiz Remove workaround for ancient HTML generation code.
 1.10 04-Mar-2013  christos PR/47617: Thorsten Brehm: Memory and socket leak in librpc
 1.9 11-Mar-2009  joerg branches: 1.9.6; 1.9.12;
Fix preamble
 1.8 16-Apr-2003  wiz branches: 1.8.42;
Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
 1.7 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.6 01-Jan-2003  jschauma Fix typos pointed out by Igor Sobrado in PR misc/19632

rpc(3) - addres (address)
rpc_reg(3) - truct (struct, in struct rpc_msg)
rpcb_getaddr(3) - Copyright: Sun Microsystems (not Microsystem's)
All Rights Reserved (not Right's)
 1.5 01-Oct-2002  wiz New sentence, new line. From Robert Elz.
 1.4 07-Feb-2002  ross Generate <>& symbolically.
 1.3 16-Sep-2001  wiz Mostly punctuation fixes; uppercase some .Sh arguments, and misc. fixes.
 1.2 09-Apr-2001  wiz select(2), not (3); order SEE ALSO; whitespace and punctuation fixes.
 1.1 02-Jun-2000  fvdl branches: 1.1.2; 1.1.4; 1.1.6;
Add new RPC code, based on Sun's TI-RPC code. Adapted to not use XTI,
but sockets instead, internally. Old, backward compatible interfaces
maintained.
 1.1.6.5 08-Jan-2003  thorpej Sync with HEAD.
 1.1.6.4 18-Oct-2002  nathanw Catch up to -current.
 1.1.6.3 22-Mar-2002  nathanw Catch up to -current.
 1.1.6.2 08-Mar-2002  nathanw Catch up to -current.
 1.1.6.1 08-Oct-2001  nathanw Catch up to -current.
 1.1.4.2 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 02-Jun-2000  minoura file rpc_svc_reg.3 was added on branch minoura-xpg4dl on 2000-06-23 16:17:48 +0000
 1.1.2.1 26-Apr-2001  he Pull up revision 1.2 (requested by wiz):
Correct select(2) reference; order SEE ALSO; whitespace and
punctuation fixes.
 1.8.42.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.9.12.1 23-Jun-2013  tls resync from head
 1.9.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.8 11-Apr-2009  joerg Fix markup.
 1.7 16-Apr-2003  wiz branches: 1.7.38; 1.7.42;
Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
 1.6 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.5 01-Oct-2002  wiz New sentence, new line. From Robert Elz.
 1.4 07-Feb-2002  ross Generate <>& symbolically.
 1.3 16-Sep-2001  wiz Mostly punctuation fixes; uppercase some .Sh arguments, and misc. fixes.
 1.2 09-Apr-2001  wiz Add RCS Id; whitespace and punctuation fixes.
 1.1 02-Jun-2000  fvdl branches: 1.1.4; 1.1.6;
Add new RPC code, based on Sun's TI-RPC code. Adapted to not use XTI,
but sockets instead, internally. Old, backward compatible interfaces
maintained.
 1.1.6.4 18-Oct-2002  nathanw Catch up to -current.
 1.1.6.3 22-Mar-2002  nathanw Catch up to -current.
 1.1.6.2 08-Mar-2002  nathanw Catch up to -current.
 1.1.6.1 08-Oct-2001  nathanw Catch up to -current.
 1.1.4.2 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 02-Jun-2000  minoura file rpc_xdr.3 was added on branch minoura-xpg4dl on 2000-06-23 16:17:49 +0000
 1.7.42.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.7.38.1 12-Apr-2009  snj Pull up following revision(s) (requested by joerg in ticket #693):
lib/libc/rpc/rpc_xdr.3: revision 1.8
Fix markup.
 1.32 23-Jan-2024  christos fix nested extern warnings
 1.31 26-Mar-2015  justin Fix definitions to match headers
 1.30 02-Jan-2014  christos don't lose the RPC error from CLNT_CALL.
 1.29 11-Mar-2013  tron Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.

This fixes PR lib/45293 by Pedro Giffuni.
 1.28 05-Mar-2013  christos make this usable from RUMP
 1.27 20-Mar-2012  matt branches: 1.27.2;
Use C89 definitions
Remove use of __P
 1.26 13-Mar-2012  christos PR/45989: Martin Husemann: lint invocation does include -w only on i386

- turn lint -w for all the platforms after fixing the lint warnings.
- add _DIAGASSERTS() for casts that would assign values to types that
would not fit.
- change types, add casts
- change into ansii prototypes
- turn on _DIAGNOSTIC for libc (during current, to be eliminated for release
builds)

approved by core@
 1.25 23-Mar-2010  drochner branches: 1.25.6; 1.25.8;
remove some stray __weak_aliases, where the target functions were
__RENAMEd due to the time_t/dev_t type changes, which caused bogus
references to compat functions
now a libc built with BUILDCOLD is usable
 1.24 25-Jul-2008  christos branches: 1.24.6;
fix gcc warnings from Alexander Shishkin
 1.23 25-Apr-2008  dogcow branches: 1.23.2;
make this compile again. (hi, xtos!)
 1.22 25-Apr-2008  christos - always check malloc results
- don't leak fds on error
- don't cast malloc
- don't cast NULL
 1.21 19-Mar-2006  christos branches: 1.21.18;
Coverity CID 710: Remove unreachable code.
 1.20 19-Mar-2006  christos Coverity CID 2284: Fix multiple memory leaks.
 1.19 03-Dec-2005  yamt - constify and remove __UNCONST from caller of clnt_call().
- use __UNCONST where approproate.
 1.18 29-Nov-2005  christos WARNS=4
 1.17 07-Jun-2005  he Initialize a variable to appease -Wuninitialized.
Marked with XXXGCC for dreamcast (found while compiling for it).

Reviewed by lukem.
 1.16 01-Jun-2005  lukem appease gcc -Wuninitialized
 1.15 21-Oct-2003  fvdl Don't compare NULL against a character.
 1.14 09-Sep-2003  itojun __RCSID police
 1.13 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.12 08-Nov-2002  fvdl * Adapt include files for rpc_com.h/rpc_internal.h split.
* Add rpc_control to svc.c
* Implement non-blocking connections.
 1.11 02-Oct-2002  yamt add missing __rpc_fixup_addr.
it's needed to make mount_nfs -T work for scoped addresses.
 1.10 04-Nov-2001  lukem branches: 1.10.2;
Close socket correctly in three places.
Fixes various problems such as inetd not reloading correctly.
Fix provided by Michael van Elst in [lib/14454] - thanks!
Should also fix [bin/12651] and [bin/13657]
 1.9 27-Sep-2001  jdolecek Fix !INET6 build. Noted by Bruno Clermont on tech-userlevel@
 1.8 04-Jan-2001  lukem branches: 1.8.2;
sprinkle _DIAGASSERT() appropriately. minor other cleanups
 1.7 20-Dec-2000  christos remove redundant declarations.
 1.6 16-Jul-2000  itojun correct delint mistake (missing "&").
may fix recent rpc/nfs-related PRs, including 10579 and 10601.
 1.5 14-Jul-2000  fvdl Use rpcvers_t, not long, for some variables holding version numbers. They
were sometimes passed by reference, creating problems on 64bit be systems.
 1.4 06-Jul-2000  christos add __RPC_GETXID macro
don't const castway __rpc_getconf and __rpc_getconfig. It might try to
write const strings
fix non-portable casts
remove duplicated prototypes
cast things to proper types
remove extraneous casts to NULL
fix variable cast mismatches
remove register var declarations
 1.3 11-Jun-2000  assar branches: 1.3.2; 1.3.4;
syslog an error if /etc/netconfig is not found. fixes lib/10275
 1.2 07-Jun-2000  fvdl Set the error code sanely in a few cases.

When connecting to a version 2 portmapper, don't use the "udp" nettype,
since that includes udp on ipv6, but just use the "udp" netconfig entry
directly.
 1.1 02-Jun-2000  fvdl Add new RPC code, based on Sun's TI-RPC code. Adapted to not use XTI,
but sockets instead, internally. Old, backward compatible interfaces
maintained.
 1.3.4.2 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.3.4.1 11-Jun-2000  minoura file rpcb_clnt.c was added on branch minoura-xpg4dl on 2000-06-23 16:17:49 +0000
 1.3.2.2 25-Nov-2001  he Pull up revision 1.10 (requested by lukem):
Close socket correctly in three places. Fixes various problems
such as inetd not reloading correctly. Fixes PR#14454, PR#12651,
and PR#13657.
 1.3.2.1 14-Jul-2000  fvdl Pullup from trunk: use explicit 32 bit operations and types where
appropriate, to make things work on 64bit BE systems.
 1.8.2.5 11-Nov-2002  nathanw Catch up to -current
 1.8.2.4 18-Oct-2002  nathanw Catch up to -current.
 1.8.2.3 14-Nov-2001  nathanw Catch up to -current.
 1.8.2.2 08-Oct-2001  nathanw Catch up to -current.
 1.8.2.1 08-Aug-2001  nathanw Convert to our threading style.
__REENT -> _REENTRANT
Statically initialize mutexes.
Use pthread thread-specific data semantics and once_t instead of Sun thread
semantics.
Use __isthreaded to detect presence of thread universe instead of _thr_main().
 1.10.2.2 06-Jan-2003  jmc Pull up revisions 1.11-1.12 (requested by fvdl in ticket #1037)
* Adapt include files for rpc_com.h/rpc_internal.h split.
* Implement non-blocking connections.
* Add rpc_control to svc.c
 1.10.2.1 07-Dec-2002  he Pull up revision 1.11 (requested by yamt in ticket #924):
Add missing __rpc_fixup_addr. This is needed to make
mount_nfs -T work for scoped addresses.
 1.21.18.1 18-May-2008  yamt sync with head.
 1.23.2.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.24.6.2 25-Jul-2008  christos fix gcc warnings from Alexander Shishkin
 1.24.6.1 25-Jul-2008  christos file rpcb_clnt.c was added on branch christos-time_t on 2008-07-25 14:05:26 +0000
 1.25.8.1 14-Mar-2013  riz Pull up following revision(s) (requested by tron in ticket #843):
lib/libc/rpc/clnt_dg.c: revision 1.28
lib/libc/rpc/xdr_sizeof.c: revision 1.5
lib/libc/rpc/pmap_getport.c: revision 1.19
lib/libc/rpc/xdr_mem.c: revision 1.19
lib/libc/rpc/svc_run.c: revision 1.22
lib/libc/rpc/bindresvport.c: revision 1.25
lib/libc/rpc/svc_raw.c: revision 1.24
lib/libc/rpc/svc_dg.c: revision 1.17
lib/libc/rpc/getnetconfig.c: revision 1.21
lib/libc/rpc/auth_unix.c: revision 1.25
lib/libc/rpc/svc_auth.c: revision 1.17
lib/libc/rpc/clnt_vc.c: revision 1.21
lib/libc/rpc/svc_auth_unix.c: revision 1.21
lib/libc/rpc/rpcb_st_xdr.c: revision 1.10
lib/libc/rpc/pmap_getmaps.c: revision 1.18
lib/libc/rpc/getnetpath.c: revision 1.17
lib/libc/rpc/clnt_simple.c: revision 1.32
lib/libc/rpc/authunix_prot.c: revision 1.16
lib/libc/rpc/svc_dg.h: revision 1.2
lib/libc/rpc/svc_generic.c: revision 1.15
lib/libc/rpc/clnt_raw.c: revision 1.32
lib/libc/rpc/xdr_array.c: revision 1.19
lib/libc/rpc/pmap_prot.c: revision 1.12
lib/libc/rpc/clnt_bcast.c: revision 1.26
lib/libc/rpc/xdr_rec.c: revision 1.35
lib/libc/rpc/svc.c: revision 1.34
lib/libc/rpc/DISCLAIMER: revision 1.3
lib/libc/rpc/clnt_generic.c: revision 1.30
lib/libc/rpc/xdr.c: revision 1.33
lib/libc/rpc/auth_none.c: revision 1.16
lib/libc/rpc/pmap_rmt.c: revision 1.34
lib/libc/rpc/rpc_callmsg.c: revision 1.20
lib/libc/rpc/clnt_perror.c: revision 1.30
lib/libc/rpc/xdr_stdio.c: revision 1.19
lib/libc/rpc/rpc_commondata.c: revision 1.9
lib/libc/rpc/pmap_prot2.c: revision 1.17
lib/libc/rpc/pmap_clnt.c: revision 1.19
lib/libc/rpc/svc_simple.c: revision 1.33
lib/libc/rpc/rpcb_clnt.c: revision 1.29
lib/libc/rpc/rpc_prot.c: revision 1.21
lib/libc/rpc/rpc_dtablesize.c: revision 1.16
lib/libc/rpc/rpc_generic.c: revision 1.28
lib/libc/rpc/xdr_reference.c: revision 1.18
lib/libc/rpc/rpc_soc.c: revision 1.18
lib/libc/rpc/svc_vc.c: revision 1.30
lib/libc/rpc/getrpcent.c: revision 1.23
lib/libc/rpc/xdr_float.c: revision 1.38
lib/libc/rpc/rpcb_prot.c: revision 1.11
lib/libc/rpc/getrpcport.c: revision 1.18
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.
This fixes PR lib/45293 by Pedro Giffuni.
 1.25.6.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.25.6.1 17-Apr-2012  yamt sync with head
 1.27.2.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.27.2.1 23-Jun-2013  tls resync from head
 1.12 03-May-2017  christos - limit size of buffers to RPC_MAXDATASIZE
- don't leak memory
- be more picky about bad parameters
https://raw.githubusercontent.com/guidovranken/rpcbomb/master/libtirpc_patch.txt

XXX: pullup-7
 1.11 11-Mar-2013  tron branches: 1.11.20;
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.

This fixes PR lib/45293 by Pedro Giffuni.
 1.10 25-Jun-2012  abs branches: 1.10.2;
Update old-style definitions to ANSI, remove a couple of register
definitions along the way. Fixed gcc 4.1 build (thank you vax)
 1.9 11-May-2006  mrg branches: 1.9.44; 1.9.46;
xdr sucks. sprinkle some (void *) casts into it's functions taking void **,
and shut up GCC4.
 1.8 19-Mar-2006  christos Coverity CID 779: Avoid NULL pointer deref.
 1.7 19-Mar-2006  christos Coverity CID 780: Avoid NULL pointer deref.
 1.6 01-Jun-2005  lukem appease gcc -Wuninitialized
 1.5 09-Sep-2003  itojun __RCSID police
 1.4 04-Jan-2001  lukem sprinkle _DIAGASSERT() appropriately. minor other cleanups
 1.3 14-Jul-2000  fvdl Use explicit int32 get/put macros. Needed for 64bit big-endian systems.
 1.2 06-Jul-2000  christos add __RPC_GETXID macro
don't const castway __rpc_getconf and __rpc_getconfig. It might try to
write const strings
fix non-portable casts
remove duplicated prototypes
cast things to proper types
remove extraneous casts to NULL
fix variable cast mismatches
remove register var declarations
 1.1 02-Jun-2000  fvdl branches: 1.1.2; 1.1.4;
Add new RPC code, based on Sun's TI-RPC code. Adapted to not use XTI,
but sockets instead, internally. Old, backward compatible interfaces
maintained.
 1.1.4.2 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 02-Jun-2000  minoura file rpcb_prot.c was added on branch minoura-xpg4dl on 2000-06-23 16:17:49 +0000
 1.1.2.1 14-Jul-2000  fvdl Pullup from trunk: use explicit 32 bit operations and types where
appropriate, to make things work on 64bit BE systems.
 1.9.46.1 14-Mar-2013  riz Pull up following revision(s) (requested by tron in ticket #843):
lib/libc/rpc/clnt_dg.c: revision 1.28
lib/libc/rpc/xdr_sizeof.c: revision 1.5
lib/libc/rpc/pmap_getport.c: revision 1.19
lib/libc/rpc/xdr_mem.c: revision 1.19
lib/libc/rpc/svc_run.c: revision 1.22
lib/libc/rpc/bindresvport.c: revision 1.25
lib/libc/rpc/svc_raw.c: revision 1.24
lib/libc/rpc/svc_dg.c: revision 1.17
lib/libc/rpc/getnetconfig.c: revision 1.21
lib/libc/rpc/auth_unix.c: revision 1.25
lib/libc/rpc/svc_auth.c: revision 1.17
lib/libc/rpc/clnt_vc.c: revision 1.21
lib/libc/rpc/svc_auth_unix.c: revision 1.21
lib/libc/rpc/rpcb_st_xdr.c: revision 1.10
lib/libc/rpc/pmap_getmaps.c: revision 1.18
lib/libc/rpc/getnetpath.c: revision 1.17
lib/libc/rpc/clnt_simple.c: revision 1.32
lib/libc/rpc/authunix_prot.c: revision 1.16
lib/libc/rpc/svc_dg.h: revision 1.2
lib/libc/rpc/svc_generic.c: revision 1.15
lib/libc/rpc/clnt_raw.c: revision 1.32
lib/libc/rpc/xdr_array.c: revision 1.19
lib/libc/rpc/pmap_prot.c: revision 1.12
lib/libc/rpc/clnt_bcast.c: revision 1.26
lib/libc/rpc/xdr_rec.c: revision 1.35
lib/libc/rpc/svc.c: revision 1.34
lib/libc/rpc/DISCLAIMER: revision 1.3
lib/libc/rpc/clnt_generic.c: revision 1.30
lib/libc/rpc/xdr.c: revision 1.33
lib/libc/rpc/auth_none.c: revision 1.16
lib/libc/rpc/pmap_rmt.c: revision 1.34
lib/libc/rpc/rpc_callmsg.c: revision 1.20
lib/libc/rpc/clnt_perror.c: revision 1.30
lib/libc/rpc/xdr_stdio.c: revision 1.19
lib/libc/rpc/rpc_commondata.c: revision 1.9
lib/libc/rpc/pmap_prot2.c: revision 1.17
lib/libc/rpc/pmap_clnt.c: revision 1.19
lib/libc/rpc/svc_simple.c: revision 1.33
lib/libc/rpc/rpcb_clnt.c: revision 1.29
lib/libc/rpc/rpc_prot.c: revision 1.21
lib/libc/rpc/rpc_dtablesize.c: revision 1.16
lib/libc/rpc/rpc_generic.c: revision 1.28
lib/libc/rpc/xdr_reference.c: revision 1.18
lib/libc/rpc/rpc_soc.c: revision 1.18
lib/libc/rpc/svc_vc.c: revision 1.30
lib/libc/rpc/getrpcent.c: revision 1.23
lib/libc/rpc/xdr_float.c: revision 1.38
lib/libc/rpc/rpcb_prot.c: revision 1.11
lib/libc/rpc/getrpcport.c: revision 1.18
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.
This fixes PR lib/45293 by Pedro Giffuni.
 1.9.44.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.9.44.1 30-Oct-2012  yamt sync with head
 1.10.2.1 23-Jun-2013  tls resync from head
 1.11.20.1 11-May-2017  pgoyette Sync with HEAD
 1.3 03-Jun-2000  fvdl Move rpcb_prot.x to include/rpc.
 1.2 03-Jun-2000  fvdl Change unix domain socket to rpcbind.sock.
 1.1 02-Jun-2000  fvdl Add new RPC code, based on Sun's TI-RPC code. Adapted to not use XTI,
but sockets instead, internally. Old, backward compatible interfaces
maintained.
 1.12 13-Aug-2017  ginsbach PR lib/15802: Shuuichirou Murata: Add missing xdr_rpcbs_rmtcalllist_ptr

There was a missing call to xdr_rpcbs_rmtcalllist_ptr in xdr_rpcb_stat.
This fixes issues with RPCBPROC_GETSTAT not working correctly with
systems that correctly implement the XDR encode/decode routine.

XXX: pullup-8
XXX: pullup-7
XXX: pullup-6
 1.11 03-May-2017  christos branches: 1.11.2;
- limit size of buffers to RPC_MAXDATASIZE
- don't leak memory
- be more picky about bad parameters
https://raw.githubusercontent.com/guidovranken/rpcbomb/master/libtirpc_patch.txt

XXX: pullup-7
 1.10 11-Mar-2013  tron branches: 1.10.8; 1.10.20;
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.

This fixes PR lib/45293 by Pedro Giffuni.
 1.9 25-Jun-2012  abs branches: 1.9.2;
Update old-style definitions to ANSI, remove a couple of register
definitions along the way. Fixed gcc 4.1 build (thank you vax)
 1.8 13-Mar-2012  christos PR/45989: Martin Husemann: lint invocation does include -w only on i386

- turn lint -w for all the platforms after fixing the lint warnings.
- add _DIAGASSERTS() for casts that would assign values to types that
would not fit.
- change types, add casts
- change into ansii prototypes
- turn on _DIAGNOSTIC for libc (during current, to be eliminated for release
builds)

approved by core@
 1.7 11-May-2006  mrg branches: 1.7.44; 1.7.46;
xdr sucks. sprinkle some (void *) casts into it's functions taking void **,
and shut up GCC4.
 1.6 09-Sep-2003  itojun __RCSID police
 1.5 04-Jan-2001  lukem whitespace consistency fixups
 1.4 04-Jan-2001  lukem sprinkle _DIAGASSERT() appropriately. minor other cleanups
 1.3 14-Jul-2000  fvdl Use explicit int32 get/put macros. Needed for 64bit big-endian systems.
 1.2 06-Jul-2000  christos add __RPC_GETXID macro
don't const castway __rpc_getconf and __rpc_getconfig. It might try to
write const strings
fix non-portable casts
remove duplicated prototypes
cast things to proper types
remove extraneous casts to NULL
fix variable cast mismatches
remove register var declarations
 1.1 02-Jun-2000  fvdl branches: 1.1.2; 1.1.4;
Add new RPC code, based on Sun's TI-RPC code. Adapted to not use XTI,
but sockets instead, internally. Old, backward compatible interfaces
maintained.
 1.1.4.2 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 02-Jun-2000  minoura file rpcb_st_xdr.c was added on branch minoura-xpg4dl on 2000-06-23 16:17:50 +0000
 1.1.2.1 14-Jul-2000  fvdl Pullup from trunk: use explicit 32 bit operations and types where
appropriate, to make things work on 64bit BE systems.
 1.7.46.2 31-Aug-2017  martin Pull up following revision(s) (requested by ginsbach in ticket #1494):
lib/libc/rpc/rpcb_st_xdr.c: revision 1.12
PR lib/15802: Shuuichirou Murata: Add missing xdr_rpcbs_rmtcalllist_ptr
There was a missing call to xdr_rpcbs_rmtcalllist_ptr in xdr_rpcb_stat.
This fixes issues with RPCBPROC_GETSTAT not working correctly with
systems that correctly implement the XDR encode/decode routine.
XXX: pullup-8
XXX: pullup-7
XXX: pullup-6
 1.7.46.1 14-Mar-2013  riz Pull up following revision(s) (requested by tron in ticket #843):
lib/libc/rpc/clnt_dg.c: revision 1.28
lib/libc/rpc/xdr_sizeof.c: revision 1.5
lib/libc/rpc/pmap_getport.c: revision 1.19
lib/libc/rpc/xdr_mem.c: revision 1.19
lib/libc/rpc/svc_run.c: revision 1.22
lib/libc/rpc/bindresvport.c: revision 1.25
lib/libc/rpc/svc_raw.c: revision 1.24
lib/libc/rpc/svc_dg.c: revision 1.17
lib/libc/rpc/getnetconfig.c: revision 1.21
lib/libc/rpc/auth_unix.c: revision 1.25
lib/libc/rpc/svc_auth.c: revision 1.17
lib/libc/rpc/clnt_vc.c: revision 1.21
lib/libc/rpc/svc_auth_unix.c: revision 1.21
lib/libc/rpc/rpcb_st_xdr.c: revision 1.10
lib/libc/rpc/pmap_getmaps.c: revision 1.18
lib/libc/rpc/getnetpath.c: revision 1.17
lib/libc/rpc/clnt_simple.c: revision 1.32
lib/libc/rpc/authunix_prot.c: revision 1.16
lib/libc/rpc/svc_dg.h: revision 1.2
lib/libc/rpc/svc_generic.c: revision 1.15
lib/libc/rpc/clnt_raw.c: revision 1.32
lib/libc/rpc/xdr_array.c: revision 1.19
lib/libc/rpc/pmap_prot.c: revision 1.12
lib/libc/rpc/clnt_bcast.c: revision 1.26
lib/libc/rpc/xdr_rec.c: revision 1.35
lib/libc/rpc/svc.c: revision 1.34
lib/libc/rpc/DISCLAIMER: revision 1.3
lib/libc/rpc/clnt_generic.c: revision 1.30
lib/libc/rpc/xdr.c: revision 1.33
lib/libc/rpc/auth_none.c: revision 1.16
lib/libc/rpc/pmap_rmt.c: revision 1.34
lib/libc/rpc/rpc_callmsg.c: revision 1.20
lib/libc/rpc/clnt_perror.c: revision 1.30
lib/libc/rpc/xdr_stdio.c: revision 1.19
lib/libc/rpc/rpc_commondata.c: revision 1.9
lib/libc/rpc/pmap_prot2.c: revision 1.17
lib/libc/rpc/pmap_clnt.c: revision 1.19
lib/libc/rpc/svc_simple.c: revision 1.33
lib/libc/rpc/rpcb_clnt.c: revision 1.29
lib/libc/rpc/rpc_prot.c: revision 1.21
lib/libc/rpc/rpc_dtablesize.c: revision 1.16
lib/libc/rpc/rpc_generic.c: revision 1.28
lib/libc/rpc/xdr_reference.c: revision 1.18
lib/libc/rpc/rpc_soc.c: revision 1.18
lib/libc/rpc/svc_vc.c: revision 1.30
lib/libc/rpc/getrpcent.c: revision 1.23
lib/libc/rpc/xdr_float.c: revision 1.38
lib/libc/rpc/rpcb_prot.c: revision 1.11
lib/libc/rpc/getrpcport.c: revision 1.18
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.
This fixes PR lib/45293 by Pedro Giffuni.
 1.7.44.3 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.7.44.2 30-Oct-2012  yamt sync with head
 1.7.44.1 17-Apr-2012  yamt sync with head
 1.9.2.1 23-Jun-2013  tls resync from head
 1.10.20.1 11-May-2017  pgoyette Sync with HEAD
 1.10.8.1 04-Sep-2017  snj Pull up following revision(s) (requested by ginsbach in ticket #1494):
lib/libc/rpc/rpcb_st_xdr.c: revision 1.12
PR lib/15802: Shuuichirou Murata: Add missing xdr_rpcbs_rmtcalllist_ptr
There was a missing call to xdr_rpcbs_rmtcalllist_ptr in xdr_rpcb_stat.
This fixes issues with RPCBPROC_GETSTAT not working correctly with
systems that correctly implement the XDR encode/decode routine.
 1.11.2.1 20-Aug-2017  snj Pull up following revision(s) (requested by ginsbach in ticket #213):
lib/libc/rpc/rpcb_st_xdr.c: revision 1.12
PR lib/15802: Shuuichirou Murata: Add missing xdr_rpcbs_rmtcalllist_ptr
There was a missing call to xdr_rpcbs_rmtcalllist_ptr in xdr_rpcb_stat.
This fixes issues with RPCBPROC_GETSTAT not working correctly with
systems that correctly implement the XDR encode/decode routine.
 1.12 03-Jul-2017  wiz Remove workaround for ancient HTML generation code.
 1.11 11-Apr-2009  joerg Fix markup.
 1.10 03-Dec-2005  yamt branches: 1.10.26; 1.10.30;
- constify and remove __UNCONST from caller of clnt_call().
- use __UNCONST where approproate.
 1.9 16-Apr-2003  wiz Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
 1.8 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.7 01-Jan-2003  jschauma Fix typos pointed out by Igor Sobrado in PR misc/19632

rpc(3) - addres (address)
rpc_reg(3) - truct (struct, in struct rpc_msg)
rpcb_getaddr(3) - Copyright: Sun Microsystems (not Microsystem's)
All Rights Reserved (not Right's)
 1.6 01-Oct-2002  wiz New sentence, new line. From Robert Elz.
 1.5 07-Feb-2002  ross Generate <>& symbolically.
 1.4 16-Sep-2001  wiz Mostly punctuation fixes; uppercase some .Sh arguments, and misc. fixes.
 1.3 09-Apr-2001  wiz rpc_clnt_calls and rpc_svc_calls live in 3, not 8.
Whitespace and punctuation fixes.
 1.2 03-Jun-2000  fvdl branches: 1.2.2; 1.2.4; 1.2.6;
Correct prototype for rpcb_unset().
 1.1 02-Jun-2000  fvdl Add new RPC code, based on Sun's TI-RPC code. Adapted to not use XTI,
but sockets instead, internally. Old, backward compatible interfaces
maintained.
 1.2.6.5 08-Jan-2003  thorpej Sync with HEAD.
 1.2.6.4 18-Oct-2002  nathanw Catch up to -current.
 1.2.6.3 22-Mar-2002  nathanw Catch up to -current.
 1.2.6.2 08-Mar-2002  nathanw Catch up to -current.
 1.2.6.1 08-Oct-2001  nathanw Catch up to -current.
 1.2.4.2 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.2.4.1 03-Jun-2000  minoura file rpcbind.3 was added on branch minoura-xpg4dl on 2000-06-23 16:17:50 +0000
 1.2.2.1 26-Apr-2001  he Pull up revision 1.3 (requested by wiz):
Correct rpc_clnt_calls(3) and rpc_svc_calls(3) references,
and whitespace/punctuation fixes.
 1.10.30.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.10.26.1 12-Apr-2009  snj Pull up following revision(s) (requested by joerg in ticket #693):
lib/libc/rpc/rpcbind.3: revision 1.11
Fix markup.
 1.41 23-Jan-2024  christos fix nested extern warnings
 1.40 21-Aug-2021  andvar fix mainly same typos as in my previous commit but outside sys/dev/dm.
 1.39 13-Nov-2015  christos Do proper accounting for the extra -1 slot. Perhaps this is too confusing
and it would be better to just access the array with [fd + 1] instead?
 1.38 13-Nov-2015  tron Remove now unnecessary cast.
 1.37 13-Nov-2015  tron Avoid broken state if realloc(3) fails.
 1.36 07-Nov-2015  christos check for errors and recover instead of core-dumping.
 1.35 06-Nov-2015  christos - Provide multi-threaded fdset's for everyone not just rump if requested.
- Abstract fd_set access, and don't limit the fd_set size.
- Maintain binary compatibility by keeping the old global variables around.
 1.34 11-Mar-2013  tron Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.

This fixes PR lib/45293 by Pedro Giffuni.
 1.33 05-Mar-2013  christos make this usable from RUMP
 1.32 04-Mar-2013  christos PR/47617: Thorsten Brehm: Memory and socket leak in librpc
 1.31 20-Mar-2012  matt branches: 1.31.2;
Use C89 definitions
Remove use of __P
 1.30 08-Jul-2010  tron branches: 1.30.6; 1.30.8;
Explicitly cast argument of ffs(3) to fix lint error.
 1.29 08-Jul-2010  rmind svc_getreq[set]: use unsigned when assigning to fds_bits.
XXX: This code should not invade fd_set internals at all.
 1.28 25-Apr-2008  christos branches: 1.28.8;
- always check malloc results
- don't leak fds on error
- don't cast malloc
- don't cast NULL
 1.27 03-Dec-2005  yamt branches: 1.27.18;
- constify and remove __UNCONST from caller of clnt_call().
- use __UNCONST where approproate.
 1.26 29-Nov-2005  christos WARNS=4
 1.25 09-Sep-2005  christos Convert the rest of the code to use pollts for consistency. XXX: We should
really use kqueue.
 1.24 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.23 08-Nov-2002  fvdl * Adapt include files for rpc_com.h/rpc_internal.h split.
* Add rpc_control to svc.c
* Implement non-blocking connections.
 1.22 04-Jan-2001  lukem branches: 1.22.2; 1.22.4;
sprinkle _DIAGASSERT() appropriately. minor other cleanups
 1.21 06-Jul-2000  christos add __RPC_GETXID macro
don't const castway __rpc_getconf and __rpc_getconfig. It might try to
write const strings
fix non-portable casts
remove duplicated prototypes
cast things to proper types
remove extraneous casts to NULL
fix variable cast mismatches
remove register var declarations
 1.20 02-Jun-2000  fvdl Add new RPC code, based on Sun's TI-RPC code. Adapted to not use XTI,
but sockets instead, internally. Old, backward compatible interfaces
maintained.
 1.19 22-Jan-2000  mycroft branches: 1.19.2;
Delint.
Remove trailing ; from uses of __weak_alias(). The macro inserts this if
needed.
 1.18 20-Sep-1999  lukem back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.17 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.16 20-Jan-1999  lukem * ensure memory is released if operations fail (in authunix_create(),
xdr_callmsg(), xprt_register(), svc_tcp(), svc_udp(), etc)
* don't attempt to close a socket filedescriptor if it's -1 (some from
freebsd, some i found)
* make the initial xid a little more random (from freebsd)
* fix some spelos and tyops in comments (some from freebsd)
* use warn() instead of warnx() for many errors; the user probably
wants to know what the error code was.
* knf & whitespace nitpicks
 1.15 15-Nov-1998  christos delint
 1.14 13-Feb-1998  lukem * in get_myaddress(); always return sockaddr_in containing localhost:PMAP_PORT.
(as recommended in Weiste Venema's portmap5_beta distribution)
* deprecate register
* use memmove instead of bcopy
* KNF includes
* use err/warn() instead of perror/fprintf(stderr,)
* fix some typos
 1.13 12-Feb-1998  lukem revert; we can't break the existing ABI and API
 1.12 10-Feb-1998  lukem major cleanup (to sync with changes made in include/rpc/*.h):
* use int32_t, size_t, in_port_t instead of long, u_int, u_short as appropriate
* use uid_t and gid_t instead of int
* KNF, fix typos and spellos
* use const as appropriate
* deprecate register
* use memmove instead of bcopy
* use err/warn()
 1.11 21-Jul-1997  jtc If port provides __weak_alias(), provide an Standard C and POSIX pure
identifier namespace by renaming non standard functions and variables
such that they have a leading underscore. The library will use those
names internally. Weak aliases are used to provide the original names
to the API.

This is only the first part of this change. It is most of the functions
which are implemented in C for all NetBSD ports. Subsequent changes are
to add the same support to the remaining C files, to assembly files, and
to the automagically generated assembly source used for system calls.
When all of the above is done, ports with weak alias support should add
a definition for __weak_alias to <sys/cdefs.h>.
 1.10 13-Jul-1997  christos Fix RCSID's
Fix gcc warnings.
Add missing prototypes
 1.9 17-May-1996  jtc branches: 1.9.2;
Use memset instead of bzero to clear xports array.

To be strictly conforming, we should iterate through the array and set
each pointer to NULL. But memset is faster, and can be inlined by the
compiler. If we ever encounter a machine where a NULL ptr != all bits
zero, we'll have to handle this differently.
 1.8 16-May-1996  pk Clear `xports' array after allocation (PR#2424, Arne Juul).
 1.7 25-Feb-1995  cgd save my sanity; stop using Id.
 1.6 06-Jan-1995  pk svc_getreq(): pay attention to registered sockets only. This allows
passing a `fd_set' with unrelated bits set.
 1.5 04-Jan-1995  mycroft Remove local definitions of svc_maxfd.
 1.4 04-Dec-1994  cgd be much more careful with types, and add prototype everything.
 1.3 23-Aug-1994  deraadt branches: 1.3.2;
fix my dumb bug
 1.2 20-Aug-1994  deraadt rpc library no longer uses _rpc_dtablesize() internally -- keeps track
of highest active file descriptor. limit fd usage to FD_SETSIZE, until
a better solution is found. remove non-FD_SETSIZE code.
 1.1 07-Oct-1993  cgd move the rpc code into libc
 1.3.2.2 23-Aug-1994  deraadt fix my dumb bug
 1.3.2.1 23-Aug-1994  deraadt file svc.c was added on branch netbsd-1-0 on 1994-08-23 18:42:12 +0000
 1.9.2.1 16-Sep-1996  jtc snapshot namespace cleanup: rpc & xdr
 1.19.2.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.22.4.1 06-Jan-2003  jmc Pull up revisions 1.22-1.23 (requested by fvdl in ticket #1037)
* Adapt include files for rpc_com.h/rpc_internal.h split.
* Implement non-blocking connections.
* Add rpc_control to svc.c
 1.22.2.2 11-Nov-2002  nathanw Catch up to -current
 1.22.2.1 08-Aug-2001  nathanw Convert to our threading style.
__REENT -> _REENTRANT
Statically initialize mutexes.
Use pthread thread-specific data semantics and once_t instead of Sun thread
semantics.
Use __isthreaded to detect presence of thread universe instead of _thr_main().
 1.27.18.1 18-May-2008  yamt sync with head.
 1.28.8.2 25-Apr-2008  christos - always check malloc results
- don't leak fds on error
- don't cast malloc
- don't cast NULL
 1.28.8.1 25-Apr-2008  christos file svc.c was added on branch christos-time_t on 2008-04-25 17:44:45 +0000
 1.30.8.1 14-Mar-2013  riz Pull up following revision(s) (requested by tron in ticket #843):
lib/libc/rpc/clnt_dg.c: revision 1.28
lib/libc/rpc/xdr_sizeof.c: revision 1.5
lib/libc/rpc/pmap_getport.c: revision 1.19
lib/libc/rpc/xdr_mem.c: revision 1.19
lib/libc/rpc/svc_run.c: revision 1.22
lib/libc/rpc/bindresvport.c: revision 1.25
lib/libc/rpc/svc_raw.c: revision 1.24
lib/libc/rpc/svc_dg.c: revision 1.17
lib/libc/rpc/getnetconfig.c: revision 1.21
lib/libc/rpc/auth_unix.c: revision 1.25
lib/libc/rpc/svc_auth.c: revision 1.17
lib/libc/rpc/clnt_vc.c: revision 1.21
lib/libc/rpc/svc_auth_unix.c: revision 1.21
lib/libc/rpc/rpcb_st_xdr.c: revision 1.10
lib/libc/rpc/pmap_getmaps.c: revision 1.18
lib/libc/rpc/getnetpath.c: revision 1.17
lib/libc/rpc/clnt_simple.c: revision 1.32
lib/libc/rpc/authunix_prot.c: revision 1.16
lib/libc/rpc/svc_dg.h: revision 1.2
lib/libc/rpc/svc_generic.c: revision 1.15
lib/libc/rpc/clnt_raw.c: revision 1.32
lib/libc/rpc/xdr_array.c: revision 1.19
lib/libc/rpc/pmap_prot.c: revision 1.12
lib/libc/rpc/clnt_bcast.c: revision 1.26
lib/libc/rpc/xdr_rec.c: revision 1.35
lib/libc/rpc/svc.c: revision 1.34
lib/libc/rpc/DISCLAIMER: revision 1.3
lib/libc/rpc/clnt_generic.c: revision 1.30
lib/libc/rpc/xdr.c: revision 1.33
lib/libc/rpc/auth_none.c: revision 1.16
lib/libc/rpc/pmap_rmt.c: revision 1.34
lib/libc/rpc/rpc_callmsg.c: revision 1.20
lib/libc/rpc/clnt_perror.c: revision 1.30
lib/libc/rpc/xdr_stdio.c: revision 1.19
lib/libc/rpc/rpc_commondata.c: revision 1.9
lib/libc/rpc/pmap_prot2.c: revision 1.17
lib/libc/rpc/pmap_clnt.c: revision 1.19
lib/libc/rpc/svc_simple.c: revision 1.33
lib/libc/rpc/rpcb_clnt.c: revision 1.29
lib/libc/rpc/rpc_prot.c: revision 1.21
lib/libc/rpc/rpc_dtablesize.c: revision 1.16
lib/libc/rpc/rpc_generic.c: revision 1.28
lib/libc/rpc/xdr_reference.c: revision 1.18
lib/libc/rpc/rpc_soc.c: revision 1.18
lib/libc/rpc/svc_vc.c: revision 1.30
lib/libc/rpc/getrpcent.c: revision 1.23
lib/libc/rpc/xdr_float.c: revision 1.38
lib/libc/rpc/rpcb_prot.c: revision 1.11
lib/libc/rpc/getrpcport.c: revision 1.18
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.
This fixes PR lib/45293 by Pedro Giffuni.
 1.30.6.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.30.6.1 17-Apr-2012  yamt sync with head
 1.31.2.1 23-Jun-2013  tls resync from head
 1.19 23-Jan-2024  christos fix nested extern warnings
 1.18 22-Mar-2022  andvar fix typos in comments.
 1.17 11-Mar-2013  tron Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.

This fixes PR lib/45293 by Pedro Giffuni.
 1.16 20-Mar-2012  matt branches: 1.16.2;
Use C89 definitions
Remove use of __P
 1.15 09-Sep-2003  itojun branches: 1.15.56; 1.15.58;
__RCSID police
 1.14 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.13 04-Jan-2001  lukem branches: 1.13.2;
sprinkle _DIAGASSERT() appropriately. minor other cleanups
 1.12 06-Jul-2000  christos add __RPC_GETXID macro
don't const castway __rpc_getconf and __rpc_getconfig. It might try to
write const strings
fix non-portable casts
remove duplicated prototypes
cast things to proper types
remove extraneous casts to NULL
fix variable cast mismatches
remove register var declarations
 1.11 02-Jun-2000  fvdl Add new RPC code, based on Sun's TI-RPC code. Adapted to not use XTI,
but sockets instead, internally. Old, backward compatible interfaces
maintained.
 1.10 20-Sep-1999  lukem branches: 1.10.6;
back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.9 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.8 15-Nov-1998  christos delint
 1.7 26-Jul-1998  mycroft const poisoning.
 1.6 13-Feb-1998  lukem * in get_myaddress(); always return sockaddr_in containing localhost:PMAP_PORT.
(as recommended in Weiste Venema's portmap5_beta distribution)
* deprecate register
* use memmove instead of bcopy
* KNF includes
* use err/warn() instead of perror/fprintf(stderr,)
* fix some typos
 1.5 12-Feb-1998  lukem revert; we can't break the existing ABI and API
 1.4 10-Feb-1998  lukem major cleanup (to sync with changes made in include/rpc/*.h):
* use int32_t, size_t, in_port_t instead of long, u_int, u_short as appropriate
* use uid_t and gid_t instead of int
* KNF, fix typos and spellos
* use const as appropriate
* deprecate register
* use memmove instead of bcopy
* use err/warn()
 1.3 13-Jul-1997  christos Fix RCSID's
Fix gcc warnings.
Add missing prototypes
 1.2 25-Feb-1995  cgd branches: 1.2.4;
save my sanity; stop using Id.
 1.1 07-Oct-1993  cgd move the rpc code into libc
 1.2.4.1 16-Sep-1996  jtc snapshot namespace cleanup: rpc & xdr
 1.10.6.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.13.2.1 08-Aug-2001  nathanw Convert to our threading style.
__REENT -> _REENTRANT
Statically initialize mutexes.
Use pthread thread-specific data semantics and once_t instead of Sun thread
semantics.
Use __isthreaded to detect presence of thread universe instead of _thr_main().
 1.15.58.1 14-Mar-2013  riz Pull up following revision(s) (requested by tron in ticket #843):
lib/libc/rpc/clnt_dg.c: revision 1.28
lib/libc/rpc/xdr_sizeof.c: revision 1.5
lib/libc/rpc/pmap_getport.c: revision 1.19
lib/libc/rpc/xdr_mem.c: revision 1.19
lib/libc/rpc/svc_run.c: revision 1.22
lib/libc/rpc/bindresvport.c: revision 1.25
lib/libc/rpc/svc_raw.c: revision 1.24
lib/libc/rpc/svc_dg.c: revision 1.17
lib/libc/rpc/getnetconfig.c: revision 1.21
lib/libc/rpc/auth_unix.c: revision 1.25
lib/libc/rpc/svc_auth.c: revision 1.17
lib/libc/rpc/clnt_vc.c: revision 1.21
lib/libc/rpc/svc_auth_unix.c: revision 1.21
lib/libc/rpc/rpcb_st_xdr.c: revision 1.10
lib/libc/rpc/pmap_getmaps.c: revision 1.18
lib/libc/rpc/getnetpath.c: revision 1.17
lib/libc/rpc/clnt_simple.c: revision 1.32
lib/libc/rpc/authunix_prot.c: revision 1.16
lib/libc/rpc/svc_dg.h: revision 1.2
lib/libc/rpc/svc_generic.c: revision 1.15
lib/libc/rpc/clnt_raw.c: revision 1.32
lib/libc/rpc/xdr_array.c: revision 1.19
lib/libc/rpc/pmap_prot.c: revision 1.12
lib/libc/rpc/clnt_bcast.c: revision 1.26
lib/libc/rpc/xdr_rec.c: revision 1.35
lib/libc/rpc/svc.c: revision 1.34
lib/libc/rpc/DISCLAIMER: revision 1.3
lib/libc/rpc/clnt_generic.c: revision 1.30
lib/libc/rpc/xdr.c: revision 1.33
lib/libc/rpc/auth_none.c: revision 1.16
lib/libc/rpc/pmap_rmt.c: revision 1.34
lib/libc/rpc/rpc_callmsg.c: revision 1.20
lib/libc/rpc/clnt_perror.c: revision 1.30
lib/libc/rpc/xdr_stdio.c: revision 1.19
lib/libc/rpc/rpc_commondata.c: revision 1.9
lib/libc/rpc/pmap_prot2.c: revision 1.17
lib/libc/rpc/pmap_clnt.c: revision 1.19
lib/libc/rpc/svc_simple.c: revision 1.33
lib/libc/rpc/rpcb_clnt.c: revision 1.29
lib/libc/rpc/rpc_prot.c: revision 1.21
lib/libc/rpc/rpc_dtablesize.c: revision 1.16
lib/libc/rpc/rpc_generic.c: revision 1.28
lib/libc/rpc/xdr_reference.c: revision 1.18
lib/libc/rpc/rpc_soc.c: revision 1.18
lib/libc/rpc/svc_vc.c: revision 1.30
lib/libc/rpc/getrpcent.c: revision 1.23
lib/libc/rpc/xdr_float.c: revision 1.38
lib/libc/rpc/rpcb_prot.c: revision 1.11
lib/libc/rpc/getrpcport.c: revision 1.18
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.
This fixes PR lib/45293 by Pedro Giffuni.
 1.15.56.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.15.56.1 17-Apr-2012  yamt sync with head
 1.16.2.1 23-Jun-2013  tls resync from head
 1.21 11-Mar-2013  tron Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.

This fixes PR lib/45293 by Pedro Giffuni.
 1.20 25-Jun-2012  abs branches: 1.20.2;
Update old-style definitions to ANSI, remove a couple of register
definitions along the way. Fixed gcc 4.1 build (thank you vax)
 1.19 13-Mar-2012  christos PR/45989: Martin Husemann: lint invocation does include -w only on i386

- turn lint -w for all the platforms after fixing the lint warnings.
- add _DIAGASSERTS() for casts that would assign values to types that
would not fit.
- change types, add casts
- change into ansii prototypes
- turn on _DIAGNOSTIC for libc (during current, to be eliminated for release
builds)

approved by core@
 1.18 18-Jan-2003  thorpej branches: 1.18.56; 1.18.58;
Merge the nathanw_sa branch.
 1.17 11-Nov-2002  thorpej Fix signed/unsigned comparison warnings.
 1.16 14-Jul-2000  fvdl branches: 1.16.2;
Use explicit int32 get/put macros. Needed for 64bit big-endian systems.
 1.15 20-Sep-1999  lukem branches: 1.15.8;
back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.14 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.13 22-Nov-1998  mrg deal with printf()ing another size_t. print a u_int %u.
 1.12 22-Nov-1998  mrg deal with printf()ing a size_t.
 1.11 15-Nov-1998  christos delint
 1.10 13-Feb-1998  lukem * in get_myaddress(); always return sockaddr_in containing localhost:PMAP_PORT.
(as recommended in Weiste Venema's portmap5_beta distribution)
* deprecate register
* use memmove instead of bcopy
* KNF includes
* use err/warn() instead of perror/fprintf(stderr,)
* fix some typos
 1.9 12-Feb-1998  lukem revert; we can't break the existing ABI and API
 1.8 11-Feb-1998  lukem use u_int32_t instead of size_t...
 1.7 10-Feb-1998  lukem major cleanup (to sync with changes made in include/rpc/*.h):
* use int32_t, size_t, in_port_t instead of long, u_int, u_short as appropriate
* use uid_t and gid_t instead of int
* KNF, fix typos and spellos
* use const as appropriate
* deprecate register
* use memmove instead of bcopy
* use err/warn()
 1.6 21-Jul-1997  jtc If port provides __weak_alias(), provide an Standard C and POSIX pure
identifier namespace by renaming non standard functions and variables
such that they have a leading underscore. The library will use those
names internally. Weak aliases are used to provide the original names
to the API.

This is only the first part of this change. It is most of the functions
which are implemented in C for all NetBSD ports. Subsequent changes are
to add the same support to the remaining C files, to assembly files, and
to the automagically generated assembly source used for system calls.
When all of the above is done, ports with weak alias support should add
a definition for __weak_alias to <sys/cdefs.h>.
 1.5 13-Jul-1997  christos Fix RCSID's
Fix gcc warnings.
Add missing prototypes
 1.4 20-Dec-1996  cgd string.h for prototypes
 1.3 25-Feb-1995  cgd branches: 1.3.4;
save my sanity; stop using Id.
 1.2 04-Dec-1994  cgd be much more careful with types, and add prototype everything.
 1.1 07-Oct-1993  cgd move the rpc code into libc
 1.3.4.1 16-Sep-1996  jtc snapshot namespace cleanup: rpc & xdr
 1.15.8.1 14-Jul-2000  fvdl Pullup from trunk: use explicit 32 bit operations and types where
appropriate, to make things work on 64bit BE systems.
 1.16.2.1 10-Dec-2002  thorpej Sync with HEAD.
 1.18.58.1 14-Mar-2013  riz Pull up following revision(s) (requested by tron in ticket #843):
lib/libc/rpc/clnt_dg.c: revision 1.28
lib/libc/rpc/xdr_sizeof.c: revision 1.5
lib/libc/rpc/pmap_getport.c: revision 1.19
lib/libc/rpc/xdr_mem.c: revision 1.19
lib/libc/rpc/svc_run.c: revision 1.22
lib/libc/rpc/bindresvport.c: revision 1.25
lib/libc/rpc/svc_raw.c: revision 1.24
lib/libc/rpc/svc_dg.c: revision 1.17
lib/libc/rpc/getnetconfig.c: revision 1.21
lib/libc/rpc/auth_unix.c: revision 1.25
lib/libc/rpc/svc_auth.c: revision 1.17
lib/libc/rpc/clnt_vc.c: revision 1.21
lib/libc/rpc/svc_auth_unix.c: revision 1.21
lib/libc/rpc/rpcb_st_xdr.c: revision 1.10
lib/libc/rpc/pmap_getmaps.c: revision 1.18
lib/libc/rpc/getnetpath.c: revision 1.17
lib/libc/rpc/clnt_simple.c: revision 1.32
lib/libc/rpc/authunix_prot.c: revision 1.16
lib/libc/rpc/svc_dg.h: revision 1.2
lib/libc/rpc/svc_generic.c: revision 1.15
lib/libc/rpc/clnt_raw.c: revision 1.32
lib/libc/rpc/xdr_array.c: revision 1.19
lib/libc/rpc/pmap_prot.c: revision 1.12
lib/libc/rpc/clnt_bcast.c: revision 1.26
lib/libc/rpc/xdr_rec.c: revision 1.35
lib/libc/rpc/svc.c: revision 1.34
lib/libc/rpc/DISCLAIMER: revision 1.3
lib/libc/rpc/clnt_generic.c: revision 1.30
lib/libc/rpc/xdr.c: revision 1.33
lib/libc/rpc/auth_none.c: revision 1.16
lib/libc/rpc/pmap_rmt.c: revision 1.34
lib/libc/rpc/rpc_callmsg.c: revision 1.20
lib/libc/rpc/clnt_perror.c: revision 1.30
lib/libc/rpc/xdr_stdio.c: revision 1.19
lib/libc/rpc/rpc_commondata.c: revision 1.9
lib/libc/rpc/pmap_prot2.c: revision 1.17
lib/libc/rpc/pmap_clnt.c: revision 1.19
lib/libc/rpc/svc_simple.c: revision 1.33
lib/libc/rpc/rpcb_clnt.c: revision 1.29
lib/libc/rpc/rpc_prot.c: revision 1.21
lib/libc/rpc/rpc_dtablesize.c: revision 1.16
lib/libc/rpc/rpc_generic.c: revision 1.28
lib/libc/rpc/xdr_reference.c: revision 1.18
lib/libc/rpc/rpc_soc.c: revision 1.18
lib/libc/rpc/svc_vc.c: revision 1.30
lib/libc/rpc/getrpcent.c: revision 1.23
lib/libc/rpc/xdr_float.c: revision 1.38
lib/libc/rpc/rpcb_prot.c: revision 1.11
lib/libc/rpc/getrpcport.c: revision 1.18
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.
This fixes PR lib/45293 by Pedro Giffuni.
 1.18.56.3 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.18.56.2 30-Oct-2012  yamt sync with head
 1.18.56.1 17-Apr-2012  yamt sync with head
 1.20.2.1 23-Jun-2013  tls resync from head
 1.18 23-Jan-2024  christos fix nested extern warnings
 1.17 11-Mar-2013  tron Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.

This fixes PR lib/45293 by Pedro Giffuni.
 1.16 05-Mar-2013  christos make this usable from RUMP
 1.15 04-Mar-2013  christos PR/47617: Thorsten Brehm: Memory and socket leak in librpc
 1.14 20-Mar-2012  matt branches: 1.14.2;
Use C89 definitions
Remove use of __P
 1.13 13-Mar-2012  christos PR/45989: Martin Husemann: lint invocation does include -w only on i386

- turn lint -w for all the platforms after fixing the lint warnings.
- add _DIAGASSERTS() for casts that would assign values to types that
would not fit.
- change types, add casts
- change into ansii prototypes
- turn on _DIAGNOSTIC for libc (during current, to be eliminated for release
builds)

approved by core@
 1.12 25-Apr-2008  christos branches: 1.12.4; 1.12.8; 1.12.24;
- always check malloc results
- don't leak fds on error
- don't cast malloc
- don't cast NULL
 1.11 09-Jun-2005  yamt branches: 1.11.18;
use malloc rather than mem_alloc (which is implemented using calloc)
for receive/send buffers to avoid unnecessarily anonymous memory bloat.
 1.10 09-Sep-2003  itojun branches: 1.10.6;
__RCSID police
 1.9 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.8 11-Nov-2002  thorpej Fix signed/unsigned comparison warnings.
 1.7 08-Nov-2002  fvdl * Adapt include files for rpc_com.h/rpc_internal.h split.
* Add rpc_control to svc.c
* Implement non-blocking connections.
 1.6 04-Jan-2001  lukem branches: 1.6.2; 1.6.4;
sprinkle _DIAGASSERT() appropriately. minor other cleanups
 1.5 20-Dec-2000  christos remove redundant declarations.
 1.4 06-Jul-2000  christos add __RPC_GETXID macro
don't const castway __rpc_getconf and __rpc_getconfig. It might try to
write const strings
fix non-portable casts
remove duplicated prototypes
cast things to proper types
remove extraneous casts to NULL
fix variable cast mismatches
remove register var declarations
 1.3 22-Jun-2000  fvdl branches: 1.3.2;
Plug a memory leak.
 1.2 04-Jun-2000  thorpej branches: 1.2.2;
Need <string.h> for LP64 systems.
 1.1 02-Jun-2000  fvdl Add new RPC code, based on Sun's TI-RPC code. Adapted to not use XTI,
but sockets instead, internally. Old, backward compatible interfaces
maintained.
 1.2.2.1 23-Jun-2000  hannken Pull up revision 1.3:
- Fix memory leaks.
 1.3.2.2 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.3.2.1 22-Jun-2000  minoura file svc_dg.c was added on branch minoura-xpg4dl on 2000-06-23 16:17:51 +0000
 1.6.4.1 06-Jan-2003  jmc Pull up revisions 1.6-1.7 (requested by fvdl in ticket #1037)
* Adapt include files for rpc_com.h/rpc_internal.h split.
* Implement non-blocking connections.
* Add rpc_control to svc.c
 1.6.2.3 10-Dec-2002  thorpej Sync with HEAD.
 1.6.2.2 11-Nov-2002  nathanw Catch up to -current
 1.6.2.1 08-Aug-2001  nathanw Convert to our threading style.
__REENT -> _REENTRANT
Statically initialize mutexes.
Use pthread thread-specific data semantics and once_t instead of Sun thread
semantics.
Use __isthreaded to detect presence of thread universe instead of _thr_main().
 1.10.6.1 21-Nov-2005  tron Pull up following revision(s) (requested by chs in ticket #964):
lib/libc/rpc/svc_dg.c: revision 1.11
lib/libc/rpc/clnt_dg.c: revision 1.15
lib/libc/rpc/svc_raw.c: revision 1.18
lib/libc/rpc/xdr_rec.c: revision 1.25
lib/libc/rpc/clnt_raw.c: revision 1.26
use malloc rather than mem_alloc (which is implemented using calloc)
for receive/send buffers to avoid unnecessarily anonymous memory bloat.
 1.11.18.1 18-May-2008  yamt sync with head.
 1.12.24.1 14-Mar-2013  riz Pull up following revision(s) (requested by tron in ticket #843):
lib/libc/rpc/clnt_dg.c: revision 1.28
lib/libc/rpc/xdr_sizeof.c: revision 1.5
lib/libc/rpc/pmap_getport.c: revision 1.19
lib/libc/rpc/xdr_mem.c: revision 1.19
lib/libc/rpc/svc_run.c: revision 1.22
lib/libc/rpc/bindresvport.c: revision 1.25
lib/libc/rpc/svc_raw.c: revision 1.24
lib/libc/rpc/svc_dg.c: revision 1.17
lib/libc/rpc/getnetconfig.c: revision 1.21
lib/libc/rpc/auth_unix.c: revision 1.25
lib/libc/rpc/svc_auth.c: revision 1.17
lib/libc/rpc/clnt_vc.c: revision 1.21
lib/libc/rpc/svc_auth_unix.c: revision 1.21
lib/libc/rpc/rpcb_st_xdr.c: revision 1.10
lib/libc/rpc/pmap_getmaps.c: revision 1.18
lib/libc/rpc/getnetpath.c: revision 1.17
lib/libc/rpc/clnt_simple.c: revision 1.32
lib/libc/rpc/authunix_prot.c: revision 1.16
lib/libc/rpc/svc_dg.h: revision 1.2
lib/libc/rpc/svc_generic.c: revision 1.15
lib/libc/rpc/clnt_raw.c: revision 1.32
lib/libc/rpc/xdr_array.c: revision 1.19
lib/libc/rpc/pmap_prot.c: revision 1.12
lib/libc/rpc/clnt_bcast.c: revision 1.26
lib/libc/rpc/xdr_rec.c: revision 1.35
lib/libc/rpc/svc.c: revision 1.34
lib/libc/rpc/DISCLAIMER: revision 1.3
lib/libc/rpc/clnt_generic.c: revision 1.30
lib/libc/rpc/xdr.c: revision 1.33
lib/libc/rpc/auth_none.c: revision 1.16
lib/libc/rpc/pmap_rmt.c: revision 1.34
lib/libc/rpc/rpc_callmsg.c: revision 1.20
lib/libc/rpc/clnt_perror.c: revision 1.30
lib/libc/rpc/xdr_stdio.c: revision 1.19
lib/libc/rpc/rpc_commondata.c: revision 1.9
lib/libc/rpc/pmap_prot2.c: revision 1.17
lib/libc/rpc/pmap_clnt.c: revision 1.19
lib/libc/rpc/svc_simple.c: revision 1.33
lib/libc/rpc/rpcb_clnt.c: revision 1.29
lib/libc/rpc/rpc_prot.c: revision 1.21
lib/libc/rpc/rpc_dtablesize.c: revision 1.16
lib/libc/rpc/rpc_generic.c: revision 1.28
lib/libc/rpc/xdr_reference.c: revision 1.18
lib/libc/rpc/rpc_soc.c: revision 1.18
lib/libc/rpc/svc_vc.c: revision 1.30
lib/libc/rpc/getrpcent.c: revision 1.23
lib/libc/rpc/xdr_float.c: revision 1.38
lib/libc/rpc/rpcb_prot.c: revision 1.11
lib/libc/rpc/getrpcport.c: revision 1.18
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.
This fixes PR lib/45293 by Pedro Giffuni.
 1.12.8.2 25-Apr-2008  christos - always check malloc results
- don't leak fds on error
- don't cast malloc
- don't cast NULL
 1.12.8.1 25-Apr-2008  christos file svc_dg.c was added on branch christos-time_t on 2008-04-25 17:44:45 +0000
 1.12.4.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.12.4.1 17-Apr-2012  yamt sync with head
 1.14.2.1 23-Jun-2013  tls resync from head
 1.2 11-Mar-2013  tron Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.

This fixes PR lib/45293 by Pedro Giffuni.
 1.1 02-Jun-2000  fvdl branches: 1.1.4; 1.1.64; 1.1.66; 1.1.70;
Add new RPC code, based on Sun's TI-RPC code. Adapted to not use XTI,
but sockets instead, internally. Old, backward compatible interfaces
maintained.
 1.1.70.1 23-Jun-2013  tls resync from head
 1.1.66.1 14-Mar-2013  riz Pull up following revision(s) (requested by tron in ticket #843):
lib/libc/rpc/clnt_dg.c: revision 1.28
lib/libc/rpc/xdr_sizeof.c: revision 1.5
lib/libc/rpc/pmap_getport.c: revision 1.19
lib/libc/rpc/xdr_mem.c: revision 1.19
lib/libc/rpc/svc_run.c: revision 1.22
lib/libc/rpc/bindresvport.c: revision 1.25
lib/libc/rpc/svc_raw.c: revision 1.24
lib/libc/rpc/svc_dg.c: revision 1.17
lib/libc/rpc/getnetconfig.c: revision 1.21
lib/libc/rpc/auth_unix.c: revision 1.25
lib/libc/rpc/svc_auth.c: revision 1.17
lib/libc/rpc/clnt_vc.c: revision 1.21
lib/libc/rpc/svc_auth_unix.c: revision 1.21
lib/libc/rpc/rpcb_st_xdr.c: revision 1.10
lib/libc/rpc/pmap_getmaps.c: revision 1.18
lib/libc/rpc/getnetpath.c: revision 1.17
lib/libc/rpc/clnt_simple.c: revision 1.32
lib/libc/rpc/authunix_prot.c: revision 1.16
lib/libc/rpc/svc_dg.h: revision 1.2
lib/libc/rpc/svc_generic.c: revision 1.15
lib/libc/rpc/clnt_raw.c: revision 1.32
lib/libc/rpc/xdr_array.c: revision 1.19
lib/libc/rpc/pmap_prot.c: revision 1.12
lib/libc/rpc/clnt_bcast.c: revision 1.26
lib/libc/rpc/xdr_rec.c: revision 1.35
lib/libc/rpc/svc.c: revision 1.34
lib/libc/rpc/DISCLAIMER: revision 1.3
lib/libc/rpc/clnt_generic.c: revision 1.30
lib/libc/rpc/xdr.c: revision 1.33
lib/libc/rpc/auth_none.c: revision 1.16
lib/libc/rpc/pmap_rmt.c: revision 1.34
lib/libc/rpc/rpc_callmsg.c: revision 1.20
lib/libc/rpc/clnt_perror.c: revision 1.30
lib/libc/rpc/xdr_stdio.c: revision 1.19
lib/libc/rpc/rpc_commondata.c: revision 1.9
lib/libc/rpc/pmap_prot2.c: revision 1.17
lib/libc/rpc/pmap_clnt.c: revision 1.19
lib/libc/rpc/svc_simple.c: revision 1.33
lib/libc/rpc/rpcb_clnt.c: revision 1.29
lib/libc/rpc/rpc_prot.c: revision 1.21
lib/libc/rpc/rpc_dtablesize.c: revision 1.16
lib/libc/rpc/rpc_generic.c: revision 1.28
lib/libc/rpc/xdr_reference.c: revision 1.18
lib/libc/rpc/rpc_soc.c: revision 1.18
lib/libc/rpc/svc_vc.c: revision 1.30
lib/libc/rpc/getrpcent.c: revision 1.23
lib/libc/rpc/xdr_float.c: revision 1.38
lib/libc/rpc/rpcb_prot.c: revision 1.11
lib/libc/rpc/getrpcport.c: revision 1.18
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.
This fixes PR lib/45293 by Pedro Giffuni.
 1.1.64.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.4.2 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 02-Jun-2000  minoura file svc_dg.h was added on branch minoura-xpg4dl on 2000-06-23 16:17:51 +0000
 1.17 06-May-2025  riastradh libc: Fix _REENTRANT build.

This svc_fdset.c has some pretty heinous abuse of thread_key_t, but
I'll pretend I didn't see that for now so I don't have to wade
further into the sunrpc business.

Prompted by:

PR lib/59401: libc: thr_sigsetmask definition is incoherent
PR lib/59391: unnecessary __PIC__ conditionals clutter .S files
 1.16 18-Apr-2017  maya branches: 1.16.24;
avoid calloc(1,0).
from clang static analyzer

ok christos
 1.15 10-Nov-2015  christos branches: 1.15.2; 1.15.4;
fix compilation/lint
 1.14 10-Nov-2015  christos CID 1338520: Check NULL
CID 1338521: Fix error (realloc returns different pointer)
 1.13 10-Nov-2015  christos CID 1338517: Check negative returns
 1.12 08-Nov-2015  christos Add debugging for pollfd
 1.11 08-Nov-2015  christos Only do the compat cruft if we are compiling libc.
 1.10 07-Nov-2015  christos initialize revents too.
 1.9 07-Nov-2015  christos PR/50408: Pedro Giffuni: Provide a way for rpc to use poll(2) instead of
select(2), and the linux svc_pollfd and svc_maxpollfd members. Our select(2)
implementation does not suffer from the FD_SETSIZE limitation so this is
not turned on by default.
 1.8 07-Nov-2015  christos spell reserved.
 1.7 07-Nov-2015  christos Put back NULL tests for allocation failures.
 1.6 07-Nov-2015  christos simplify more.
 1.5 07-Nov-2015  christos Introduce a binary compatible __fd_set_256 that is what the original fdset
size was for libc. Now we can bump it.
 1.4 06-Nov-2015  christos Cleanup and simplify.
undef svc_fdset and svc_maxfd to get to the real data for the compat code.
 1.3 06-Nov-2015  joerg Don't use macros as types or variable names.
 1.2 06-Nov-2015  christos - Provide multi-threaded fdset's for everyone not just rump if requested.
- Abstract fd_set access, and don't limit the fd_set size.
- Maintain binary compatibility by keeping the old global variables around.
 1.1 05-Mar-2013  christos branches: 1.1.4; 1.1.10;
make this usable from RUMP
 1.1.10.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.10.1 05-Mar-2013  yamt file svc_fdset.c was added on branch yamt-pagecache on 2014-05-22 11:36:53 +0000
 1.1.4.2 23-Jun-2013  tls resync from head
 1.1.4.1 05-Mar-2013  tls file svc_fdset.c was added on branch tls-maxphys on 2013-06-23 06:21:05 +0000
 1.15.4.1 21-Apr-2017  bouyer Sync with HEAD
 1.15.2.1 26-Apr-2017  pgoyette Sync with HEAD
 1.16.24.1 02-Aug-2025  perseant Sync with HEAD
 1.5 17-Jun-2020  kamil Include explicitly <rump/rump_syscallshotgun.h> for previous indirect users
via <rump/rump.h>.
 1.4 08-Nov-2015  christos Only do the compat cruft if we are compiling libc.
 1.3 07-Nov-2015  christos Introduce a binary compatible __fd_set_256 that is what the original fdset
size was for libc. Now we can bump it.
 1.2 06-Nov-2015  christos - Provide multi-threaded fdset's for everyone not just rump if requested.
- Abstract fd_set access, and don't limit the fd_set size.
- Maintain binary compatibility by keeping the old global variables around.
 1.1 05-Mar-2013  christos branches: 1.1.4; 1.1.10;
make this usable from RUMP
 1.1.10.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.10.1 05-Mar-2013  yamt file svc_fdset.h was added on branch yamt-pagecache on 2014-05-22 11:36:53 +0000
 1.1.4.2 23-Jun-2013  tls resync from head
 1.1.4.1 05-Mar-2013  tls file svc_fdset.h was added on branch tls-maxphys on 2013-06-23 06:21:05 +0000
 1.18 23-Jan-2024  christos fix nested extern warnings
 1.17 29-May-2014  christos Don't try to listen on UDP sockets.
 1.16 28-May-2014  christos CID 975117: check listen(2) return .
 1.15 11-Mar-2013  tron branches: 1.15.6;
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.

This fixes PR lib/45293 by Pedro Giffuni.
 1.14 05-Mar-2013  christos make this usable from RUMP
 1.13 04-Mar-2013  christos fix error messages and warnings.
 1.12 20-Mar-2012  matt branches: 1.12.2;
Use C89 definitions
Remove use of __P
 1.11 02-Jan-2012  dholland branches: 1.11.2;
stdlib.h, not malloc.h
 1.10 25-Apr-2008  christos branches: 1.10.4; 1.10.8;
- always check malloc results
- don't leak fds on error
- don't cast malloc
- don't cast NULL
 1.9 19-Mar-2006  christos branches: 1.9.18;
Coverity CID 711: Remove dead code.
 1.8 29-Nov-2005  christos WARNS=4
 1.7 09-Sep-2003  itojun __RCSID police
 1.6 13-May-2003  yamt fix a simple bug that prevents svc_tli_create to bind to the address
specified by caller.
 1.5 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.4 08-Nov-2002  fvdl * Adapt include files for rpc_com.h/rpc_internal.h split.
* Add rpc_control to svc.c
* Implement non-blocking connections.
 1.3 06-Jul-2000  christos branches: 1.3.2; 1.3.4;
add __RPC_GETXID macro
don't const castway __rpc_getconf and __rpc_getconfig. It might try to
write const strings
fix non-portable casts
remove duplicated prototypes
cast things to proper types
remove extraneous casts to NULL
fix variable cast mismatches
remove register var declarations
 1.2 07-Jun-2000  fvdl branches: 1.2.4;
The two unchanged interfaces (svc_create and clnt_create) resulted
in sockets bound to reserved ports in the old code. Since old binaries
will still expect this, always try to bind to a reserved port in
clnt_cli_create and svc_tli_create, unless we're already bound.
 1.1 02-Jun-2000  fvdl Add new RPC code, based on Sun's TI-RPC code. Adapted to not use XTI,
but sockets instead, internally. Old, backward compatible interfaces
maintained.
 1.2.4.2 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.2.4.1 07-Jun-2000  minoura file svc_generic.c was added on branch minoura-xpg4dl on 2000-06-23 16:17:51 +0000
 1.3.4.1 06-Jan-2003  jmc Pull up revisions 1.3-1.4 (requested by fvdl in ticket #1037)
* Adapt include files for rpc_com.h/rpc_internal.h split.
* Implement non-blocking connections.
* Add rpc_control to svc.c
 1.3.2.2 11-Nov-2002  nathanw Catch up to -current
 1.3.2.1 08-Aug-2001  nathanw Convert to our threading style.
__REENT -> _REENTRANT
Statically initialize mutexes.
Use pthread thread-specific data semantics and once_t instead of Sun thread
semantics.
Use __isthreaded to detect presence of thread universe instead of _thr_main().
 1.9.18.1 18-May-2008  yamt sync with head.
 1.10.8.2 25-Apr-2008  christos - always check malloc results
- don't leak fds on error
- don't cast malloc
- don't cast NULL
 1.10.8.1 25-Apr-2008  christos file svc_generic.c was added on branch christos-time_t on 2008-04-25 17:44:45 +0000
 1.10.4.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.10.4.1 17-Apr-2012  yamt sync with head
 1.11.2.1 14-Mar-2013  riz Pull up following revision(s) (requested by tron in ticket #843):
lib/libc/rpc/clnt_dg.c: revision 1.28
lib/libc/rpc/xdr_sizeof.c: revision 1.5
lib/libc/rpc/pmap_getport.c: revision 1.19
lib/libc/rpc/xdr_mem.c: revision 1.19
lib/libc/rpc/svc_run.c: revision 1.22
lib/libc/rpc/bindresvport.c: revision 1.25
lib/libc/rpc/svc_raw.c: revision 1.24
lib/libc/rpc/svc_dg.c: revision 1.17
lib/libc/rpc/getnetconfig.c: revision 1.21
lib/libc/rpc/auth_unix.c: revision 1.25
lib/libc/rpc/svc_auth.c: revision 1.17
lib/libc/rpc/clnt_vc.c: revision 1.21
lib/libc/rpc/svc_auth_unix.c: revision 1.21
lib/libc/rpc/rpcb_st_xdr.c: revision 1.10
lib/libc/rpc/pmap_getmaps.c: revision 1.18
lib/libc/rpc/getnetpath.c: revision 1.17
lib/libc/rpc/clnt_simple.c: revision 1.32
lib/libc/rpc/authunix_prot.c: revision 1.16
lib/libc/rpc/svc_dg.h: revision 1.2
lib/libc/rpc/svc_generic.c: revision 1.15
lib/libc/rpc/clnt_raw.c: revision 1.32
lib/libc/rpc/xdr_array.c: revision 1.19
lib/libc/rpc/pmap_prot.c: revision 1.12
lib/libc/rpc/clnt_bcast.c: revision 1.26
lib/libc/rpc/xdr_rec.c: revision 1.35
lib/libc/rpc/svc.c: revision 1.34
lib/libc/rpc/DISCLAIMER: revision 1.3
lib/libc/rpc/clnt_generic.c: revision 1.30
lib/libc/rpc/xdr.c: revision 1.33
lib/libc/rpc/auth_none.c: revision 1.16
lib/libc/rpc/pmap_rmt.c: revision 1.34
lib/libc/rpc/rpc_callmsg.c: revision 1.20
lib/libc/rpc/clnt_perror.c: revision 1.30
lib/libc/rpc/xdr_stdio.c: revision 1.19
lib/libc/rpc/rpc_commondata.c: revision 1.9
lib/libc/rpc/pmap_prot2.c: revision 1.17
lib/libc/rpc/pmap_clnt.c: revision 1.19
lib/libc/rpc/svc_simple.c: revision 1.33
lib/libc/rpc/rpcb_clnt.c: revision 1.29
lib/libc/rpc/rpc_prot.c: revision 1.21
lib/libc/rpc/rpc_dtablesize.c: revision 1.16
lib/libc/rpc/rpc_generic.c: revision 1.28
lib/libc/rpc/xdr_reference.c: revision 1.18
lib/libc/rpc/rpc_soc.c: revision 1.18
lib/libc/rpc/svc_vc.c: revision 1.30
lib/libc/rpc/getrpcent.c: revision 1.23
lib/libc/rpc/xdr_float.c: revision 1.38
lib/libc/rpc/rpcb_prot.c: revision 1.11
lib/libc/rpc/getrpcport.c: revision 1.18
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.
This fixes PR lib/45293 by Pedro Giffuni.
 1.12.2.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.12.2.1 23-Jun-2013  tls resync from head
 1.15.6.1 10-Aug-2014  tls Rebase.
 1.26 23-Jan-2024  christos fix nested extern warnings
 1.25 06-Nov-2015  christos - Use -1 for the fake raw fd since we will be able to go beyond FD_SETSIZE.
- Poster boy for why it is bad to initialize in declarations :-)
 1.24 11-Mar-2013  tron Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.

This fixes PR lib/45293 by Pedro Giffuni.
 1.23 04-Mar-2013  christos PR/47617: Thorsten Brehm: Memory and socket leak in librpc
 1.22 20-Mar-2012  matt branches: 1.22.2;
Use C89 definitions
Remove use of __P
 1.21 24-May-2008  christos branches: 1.21.2; 1.21.6; 1.21.22;
Coverity CID 5029: Fix memory leak.
 1.20 25-Apr-2008  christos branches: 1.20.2;
- always check malloc results
- don't leak fds on error
- don't cast malloc
- don't cast NULL
 1.19 30-Jul-2005  wiz branches: 1.19.18;
Fix typo reported in PR 30872.
 1.18 09-Jun-2005  yamt use malloc rather than mem_alloc (which is implemented using calloc)
for receive/send buffers to avoid unnecessarily anonymous memory bloat.
 1.17 09-Sep-2003  itojun branches: 1.17.6;
__RCSID police
 1.16 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.15 04-Jan-2001  lukem branches: 1.15.2;
sprinkle _DIAGASSERT() appropriately. minor other cleanups
 1.14 06-Jul-2000  christos add __RPC_GETXID macro
don't const castway __rpc_getconf and __rpc_getconfig. It might try to
write const strings
fix non-portable casts
remove duplicated prototypes
cast things to proper types
remove extraneous casts to NULL
fix variable cast mismatches
remove register var declarations
 1.13 02-Jun-2000  fvdl Add new RPC code, based on Sun's TI-RPC code. Adapted to not use XTI,
but sockets instead, internally. Old, backward compatible interfaces
maintained.
 1.12 22-Jan-2000  mycroft branches: 1.12.2;
Delint.
Remove trailing ; from uses of __weak_alias(). The macro inserts this if
needed.
 1.11 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.10 15-Nov-1998  christos delint
 1.9 26-Jul-1998  mycroft constify some tables.
 1.8 13-Feb-1998  lukem * in get_myaddress(); always return sockaddr_in containing localhost:PMAP_PORT.
(as recommended in Weiste Venema's portmap5_beta distribution)
* deprecate register
* use memmove instead of bcopy
* KNF includes
* use err/warn() instead of perror/fprintf(stderr,)
* fix some typos
 1.7 12-Feb-1998  lukem revert; we can't break the existing ABI and API
 1.6 10-Feb-1998  lukem major cleanup (to sync with changes made in include/rpc/*.h):
* use int32_t, size_t, in_port_t instead of long, u_int, u_short as appropriate
* use uid_t and gid_t instead of int
* KNF, fix typos and spellos
* use const as appropriate
* deprecate register
* use memmove instead of bcopy
* use err/warn()
 1.5 21-Jul-1997  jtc If port provides __weak_alias(), provide an Standard C and POSIX pure
identifier namespace by renaming non standard functions and variables
such that they have a leading underscore. The library will use those
names internally. Weak aliases are used to provide the original names
to the API.

This is only the first part of this change. It is most of the functions
which are implemented in C for all NetBSD ports. Subsequent changes are
to add the same support to the remaining C files, to assembly files, and
to the automagically generated assembly source used for system calls.
When all of the above is done, ports with weak alias support should add
a definition for __weak_alias to <sys/cdefs.h>.
 1.4 13-Jul-1997  christos Fix RCSID's
Fix gcc warnings.
Add missing prototypes
 1.3 25-Feb-1995  cgd branches: 1.3.4;
save my sanity; stop using Id.
 1.2 04-Dec-1994  cgd be much more careful with types, and add prototype everything.
 1.1 07-Oct-1993  cgd move the rpc code into libc
 1.3.4.1 16-Sep-1996  jtc snapshot namespace cleanup: rpc & xdr
 1.12.2.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.15.2.1 08-Aug-2001  nathanw Convert to our threading style.
__REENT -> _REENTRANT
Statically initialize mutexes.
Use pthread thread-specific data semantics and once_t instead of Sun thread
semantics.
Use __isthreaded to detect presence of thread universe instead of _thr_main().
 1.17.6.1 21-Nov-2005  tron Pull up following revision(s) (requested by chs in ticket #964):
lib/libc/rpc/svc_dg.c: revision 1.11
lib/libc/rpc/clnt_dg.c: revision 1.15
lib/libc/rpc/svc_raw.c: revision 1.18
lib/libc/rpc/xdr_rec.c: revision 1.25
lib/libc/rpc/clnt_raw.c: revision 1.26
use malloc rather than mem_alloc (which is implemented using calloc)
for receive/send buffers to avoid unnecessarily anonymous memory bloat.
 1.19.18.2 04-Jun-2008  yamt sync with head
 1.19.18.1 18-May-2008  yamt sync with head.
 1.20.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.21.22.1 14-Mar-2013  riz Pull up following revision(s) (requested by tron in ticket #843):
lib/libc/rpc/clnt_dg.c: revision 1.28
lib/libc/rpc/xdr_sizeof.c: revision 1.5
lib/libc/rpc/pmap_getport.c: revision 1.19
lib/libc/rpc/xdr_mem.c: revision 1.19
lib/libc/rpc/svc_run.c: revision 1.22
lib/libc/rpc/bindresvport.c: revision 1.25
lib/libc/rpc/svc_raw.c: revision 1.24
lib/libc/rpc/svc_dg.c: revision 1.17
lib/libc/rpc/getnetconfig.c: revision 1.21
lib/libc/rpc/auth_unix.c: revision 1.25
lib/libc/rpc/svc_auth.c: revision 1.17
lib/libc/rpc/clnt_vc.c: revision 1.21
lib/libc/rpc/svc_auth_unix.c: revision 1.21
lib/libc/rpc/rpcb_st_xdr.c: revision 1.10
lib/libc/rpc/pmap_getmaps.c: revision 1.18
lib/libc/rpc/getnetpath.c: revision 1.17
lib/libc/rpc/clnt_simple.c: revision 1.32
lib/libc/rpc/authunix_prot.c: revision 1.16
lib/libc/rpc/svc_dg.h: revision 1.2
lib/libc/rpc/svc_generic.c: revision 1.15
lib/libc/rpc/clnt_raw.c: revision 1.32
lib/libc/rpc/xdr_array.c: revision 1.19
lib/libc/rpc/pmap_prot.c: revision 1.12
lib/libc/rpc/clnt_bcast.c: revision 1.26
lib/libc/rpc/xdr_rec.c: revision 1.35
lib/libc/rpc/svc.c: revision 1.34
lib/libc/rpc/DISCLAIMER: revision 1.3
lib/libc/rpc/clnt_generic.c: revision 1.30
lib/libc/rpc/xdr.c: revision 1.33
lib/libc/rpc/auth_none.c: revision 1.16
lib/libc/rpc/pmap_rmt.c: revision 1.34
lib/libc/rpc/rpc_callmsg.c: revision 1.20
lib/libc/rpc/clnt_perror.c: revision 1.30
lib/libc/rpc/xdr_stdio.c: revision 1.19
lib/libc/rpc/rpc_commondata.c: revision 1.9
lib/libc/rpc/pmap_prot2.c: revision 1.17
lib/libc/rpc/pmap_clnt.c: revision 1.19
lib/libc/rpc/svc_simple.c: revision 1.33
lib/libc/rpc/rpcb_clnt.c: revision 1.29
lib/libc/rpc/rpc_prot.c: revision 1.21
lib/libc/rpc/rpc_dtablesize.c: revision 1.16
lib/libc/rpc/rpc_generic.c: revision 1.28
lib/libc/rpc/xdr_reference.c: revision 1.18
lib/libc/rpc/rpc_soc.c: revision 1.18
lib/libc/rpc/svc_vc.c: revision 1.30
lib/libc/rpc/getrpcent.c: revision 1.23
lib/libc/rpc/xdr_float.c: revision 1.38
lib/libc/rpc/rpcb_prot.c: revision 1.11
lib/libc/rpc/getrpcport.c: revision 1.18
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.
This fixes PR lib/45293 by Pedro Giffuni.
 1.21.6.2 24-May-2008  christos Coverity CID 5029: Fix memory leak.
 1.21.6.1 24-May-2008  christos file svc_raw.c was added on branch christos-time_t on 2008-05-24 16:00:00 +0000
 1.21.2.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.21.2.1 17-Apr-2012  yamt sync with head
 1.22.2.1 23-Jun-2013  tls resync from head
 1.30 31-Jul-2025  joe release read locks on fdset read failures to avoid blocking threads waiting on write locks

also, clear trailing whitespace
 1.29 23-Jan-2024  christos branches: 1.29.2;
fix nested extern warnings
 1.28 10-Jan-2017  christos use correct type for poll
 1.27 10-Nov-2015  christos branches: 1.27.2;
fix compilation/lint
 1.26 10-Nov-2015  christos CID 1338515: Make it clear that the pfd variable can't be NULL
 1.25 07-Nov-2015  christos PR/50408: Pedro Giffuni: Provide a way for rpc to use poll(2) instead of
select(2), and the linux svc_pollfd and svc_maxpollfd members. Our select(2)
implementation does not suffer from the FD_SETSIZE limitation so this is
not turned on by default.
 1.24 07-Nov-2015  christos check for errors and recover instead of core-dumping.
 1.23 06-Nov-2015  christos - Provide multi-threaded fdset's for everyone not just rump if requested.
- Abstract fd_set access, and don't limit the fd_set size.
- Maintain binary compatibility by keeping the old global variables around.
 1.22 11-Mar-2013  tron Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.

This fixes PR lib/45293 by Pedro Giffuni.
 1.21 05-Mar-2013  christos make this usable from RUMP
 1.20 24-Jun-2012  christos branches: 1.20.2;
fix old style definitions; XXX: gcc should have picked them up but it did not.
 1.19 18-Jan-2003  thorpej branches: 1.19.56; 1.19.58;
Merge the nathanw_sa branch.
 1.18 08-Nov-2002  fvdl * Adapt include files for rpc_com.h/rpc_internal.h split.
* Add rpc_control to svc.c
* Implement non-blocking connections.
 1.17 06-Jul-2000  christos branches: 1.17.2; 1.17.4;
add __RPC_GETXID macro
don't const castway __rpc_getconf and __rpc_getconfig. It might try to
write const strings
fix non-portable casts
remove duplicated prototypes
cast things to proper types
remove extraneous casts to NULL
fix variable cast mismatches
remove register var declarations
 1.16 04-Jun-2000  thorpej Need <string.h> for LP64 systems.
 1.15 02-Jun-2000  fvdl Add new RPC code, based on Sun's TI-RPC code. Adapted to not use XTI,
but sockets instead, internally. Old, backward compatible interfaces
maintained.
 1.14 22-Jan-2000  mycroft branches: 1.14.2;
Delint.
Remove trailing ; from uses of __weak_alias(). The macro inserts this if
needed.
 1.13 20-Jan-1999  lukem * ensure memory is released if operations fail (in authunix_create(),
xdr_callmsg(), xprt_register(), svc_tcp(), svc_udp(), etc)
* don't attempt to close a socket filedescriptor if it's -1 (some from
freebsd, some i found)
* make the initial xid a little more random (from freebsd)
* fix some spelos and tyops in comments (some from freebsd)
* use warn() instead of warnx() for many errors; the user probably
wants to know what the error code was.
* knf & whitespace nitpicks
 1.12 13-Feb-1998  lukem * in get_myaddress(); always return sockaddr_in containing localhost:PMAP_PORT.
(as recommended in Weiste Venema's portmap5_beta distribution)
* deprecate register
* use memmove instead of bcopy
* KNF includes
* use err/warn() instead of perror/fprintf(stderr,)
* fix some typos
 1.11 12-Feb-1998  lukem revert; we can't break the existing ABI and API
 1.10 10-Feb-1998  lukem major cleanup (to sync with changes made in include/rpc/*.h):
* use int32_t, size_t, in_port_t instead of long, u_int, u_short as appropriate
* use uid_t and gid_t instead of int
* KNF, fix typos and spellos
* use const as appropriate
* deprecate register
* use memmove instead of bcopy
* use err/warn()
 1.9 21-Jul-1997  jtc If port provides __weak_alias(), provide an Standard C and POSIX pure
identifier namespace by renaming non standard functions and variables
such that they have a leading underscore. The library will use those
names internally. Weak aliases are used to provide the original names
to the API.

This is only the first part of this change. It is most of the functions
which are implemented in C for all NetBSD ports. Subsequent changes are
to add the same support to the remaining C files, to assembly files, and
to the automagically generated assembly source used for system calls.
When all of the above is done, ports with weak alias support should add
a definition for __weak_alias to <sys/cdefs.h>.
 1.8 13-Jul-1997  christos Fix RCSID's
Fix gcc warnings.
Add missing prototypes
 1.7 20-Dec-1996  cgd unistd.h for prototypes, fix a couple of bogus casts to select()'s args
 1.6 25-Feb-1995  cgd branches: 1.6.4;
save my sanity; stop using Id.
 1.5 04-Jan-1995  mycroft branches: 1.5.2;
Remove local definitions of svc_maxfd.
 1.4 04-Dec-1994  cgd be much more careful with types, and add prototype everything.
 1.3 23-Aug-1994  deraadt branches: 1.3.2;
fix my dumb bug
 1.2 20-Aug-1994  deraadt rpc library no longer uses _rpc_dtablesize() internally -- keeps track
of highest active file descriptor. limit fd usage to FD_SETSIZE, until
a better solution is found. remove non-FD_SETSIZE code.
 1.1 07-Oct-1993  cgd move the rpc code into libc
 1.3.2.2 23-Aug-1994  deraadt fix my dumb bug
 1.3.2.1 23-Aug-1994  deraadt file svc_run.c was added on branch netbsd-1-0 on 1994-08-23 18:42:13 +0000
 1.5.2.1 02-May-1995  jtc #include "namespace.h"
 1.6.4.1 16-Sep-1996  jtc snapshot namespace cleanup: rpc & xdr
 1.14.2.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.17.4.1 06-Jan-2003  jmc Pull up revisions 1.17-1.18 (requested by fvdl in ticket #1037)
* Adapt include files for rpc_com.h/rpc_internal.h split.
* Implement non-blocking connections.
* Add rpc_control to svc.c
 1.17.2.2 11-Nov-2002  nathanw Catch up to -current
 1.17.2.1 08-Aug-2001  nathanw Convert to our threading style.
__REENT -> _REENTRANT
Statically initialize mutexes.
Use pthread thread-specific data semantics and once_t instead of Sun thread
semantics.
Use __isthreaded to detect presence of thread universe instead of _thr_main().
 1.19.58.1 14-Mar-2013  riz Pull up following revision(s) (requested by tron in ticket #843):
lib/libc/rpc/clnt_dg.c: revision 1.28
lib/libc/rpc/xdr_sizeof.c: revision 1.5
lib/libc/rpc/pmap_getport.c: revision 1.19
lib/libc/rpc/xdr_mem.c: revision 1.19
lib/libc/rpc/svc_run.c: revision 1.22
lib/libc/rpc/bindresvport.c: revision 1.25
lib/libc/rpc/svc_raw.c: revision 1.24
lib/libc/rpc/svc_dg.c: revision 1.17
lib/libc/rpc/getnetconfig.c: revision 1.21
lib/libc/rpc/auth_unix.c: revision 1.25
lib/libc/rpc/svc_auth.c: revision 1.17
lib/libc/rpc/clnt_vc.c: revision 1.21
lib/libc/rpc/svc_auth_unix.c: revision 1.21
lib/libc/rpc/rpcb_st_xdr.c: revision 1.10
lib/libc/rpc/pmap_getmaps.c: revision 1.18
lib/libc/rpc/getnetpath.c: revision 1.17
lib/libc/rpc/clnt_simple.c: revision 1.32
lib/libc/rpc/authunix_prot.c: revision 1.16
lib/libc/rpc/svc_dg.h: revision 1.2
lib/libc/rpc/svc_generic.c: revision 1.15
lib/libc/rpc/clnt_raw.c: revision 1.32
lib/libc/rpc/xdr_array.c: revision 1.19
lib/libc/rpc/pmap_prot.c: revision 1.12
lib/libc/rpc/clnt_bcast.c: revision 1.26
lib/libc/rpc/xdr_rec.c: revision 1.35
lib/libc/rpc/svc.c: revision 1.34
lib/libc/rpc/DISCLAIMER: revision 1.3
lib/libc/rpc/clnt_generic.c: revision 1.30
lib/libc/rpc/xdr.c: revision 1.33
lib/libc/rpc/auth_none.c: revision 1.16
lib/libc/rpc/pmap_rmt.c: revision 1.34
lib/libc/rpc/rpc_callmsg.c: revision 1.20
lib/libc/rpc/clnt_perror.c: revision 1.30
lib/libc/rpc/xdr_stdio.c: revision 1.19
lib/libc/rpc/rpc_commondata.c: revision 1.9
lib/libc/rpc/pmap_prot2.c: revision 1.17
lib/libc/rpc/pmap_clnt.c: revision 1.19
lib/libc/rpc/svc_simple.c: revision 1.33
lib/libc/rpc/rpcb_clnt.c: revision 1.29
lib/libc/rpc/rpc_prot.c: revision 1.21
lib/libc/rpc/rpc_dtablesize.c: revision 1.16
lib/libc/rpc/rpc_generic.c: revision 1.28
lib/libc/rpc/xdr_reference.c: revision 1.18
lib/libc/rpc/rpc_soc.c: revision 1.18
lib/libc/rpc/svc_vc.c: revision 1.30
lib/libc/rpc/getrpcent.c: revision 1.23
lib/libc/rpc/xdr_float.c: revision 1.38
lib/libc/rpc/rpcb_prot.c: revision 1.11
lib/libc/rpc/getrpcport.c: revision 1.18
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.
This fixes PR lib/45293 by Pedro Giffuni.
 1.19.56.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.19.56.1 30-Oct-2012  yamt sync with head
 1.20.2.1 23-Jun-2013  tls resync from head
 1.27.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.29.2.1 02-Aug-2025  perseant Sync with HEAD
 1.34 23-Jan-2024  christos fix nested extern warnings
 1.33 11-Mar-2013  tron Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.

This fixes PR lib/45293 by Pedro Giffuni.
 1.32 04-Mar-2013  christos fix error messages and warnings.
 1.31 20-Mar-2012  matt branches: 1.31.2;
Use C89 definitions
Remove use of __P
 1.30 25-Apr-2008  christos branches: 1.30.4; 1.30.8; 1.30.24;
- always check malloc results
- don't leak fds on error
- don't cast malloc
- don't cast NULL
 1.29 21-Mar-2006  christos branches: 1.29.18;
Coverity CID 2293: Fix memory leak.
 1.28 29-Nov-2005  christos WARNS=4
 1.27 01-Jun-2005  lukem appease gcc -Wuninitialized
 1.26 09-Sep-2003  itojun __RCSID police
 1.25 05-Apr-2003  christos cast int to size_t to appease lint (Geoff Wing)
 1.24 05-Apr-2003  christos PR/21014: Tom Lyon: Failure to clear string by passing the wrong size to memset
 1.23 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.22 08-Nov-2002  fvdl * Adapt include files for rpc_com.h/rpc_internal.h split.
* Add rpc_control to svc.c
* Implement non-blocking connections.
 1.21 04-Jan-2001  lukem branches: 1.21.2; 1.21.4;
sprinkle _DIAGASSERT() appropriately. minor other cleanups
 1.20 06-Jul-2000  christos add __RPC_GETXID macro
don't const castway __rpc_getconf and __rpc_getconfig. It might try to
write const strings
fix non-portable casts
remove duplicated prototypes
cast things to proper types
remove extraneous casts to NULL
fix variable cast mismatches
remove register var declarations
 1.19 02-Jun-2000  fvdl Add new RPC code, based on Sun's TI-RPC code. Adapted to not use XTI,
but sockets instead, internally. Old, backward compatible interfaces
maintained.
 1.18 22-Jan-2000  mycroft branches: 1.18.2;
Delint.
Remove trailing ; from uses of __weak_alias(). The macro inserts this if
needed.
 1.17 28-Nov-1999  lukem remove unnecessary exit() after err()
 1.16 16-Sep-1999  lukem branches: 1.16.4;
* use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.15 19-Apr-1999  kleink Declare more local items static.
 1.14 31-Jan-1999  christos xdrproc_t casts.
 1.13 20-Jan-1999  lukem * ensure memory is released if operations fail (in authunix_create(),
xdr_callmsg(), xprt_register(), svc_tcp(), svc_udp(), etc)
* don't attempt to close a socket filedescriptor if it's -1 (some from
freebsd, some i found)
* make the initial xid a little more random (from freebsd)
* fix some spelos and tyops in comments (some from freebsd)
* use warn() instead of warnx() for many errors; the user probably
wants to know what the error code was.
* knf & whitespace nitpicks
 1.12 15-Nov-1998  christos delint
 1.11 09-Jul-1998  msaitoh KNF.
 1.10 13-Feb-1998  lukem * in get_myaddress(); always return sockaddr_in containing localhost:PMAP_PORT.
(as recommended in Weiste Venema's portmap5_beta distribution)
* deprecate register
* use memmove instead of bcopy
* KNF includes
* use err/warn() instead of perror/fprintf(stderr,)
* fix some typos
 1.9 12-Feb-1998  lukem revert; we can't break the existing ABI and API
 1.8 10-Feb-1998  lukem major cleanup (to sync with changes made in include/rpc/*.h):
* use int32_t, size_t, in_port_t instead of long, u_int, u_short as appropriate
* use uid_t and gid_t instead of int
* KNF, fix typos and spellos
* use const as appropriate
* deprecate register
* use memmove instead of bcopy
* use err/warn()
 1.7 21-Jul-1997  jtc If port provides __weak_alias(), provide an Standard C and POSIX pure
identifier namespace by renaming non standard functions and variables
such that they have a leading underscore. The library will use those
names internally. Weak aliases are used to provide the original names
to the API.

This is only the first part of this change. It is most of the functions
which are implemented in C for all NetBSD ports. Subsequent changes are
to add the same support to the remaining C files, to assembly files, and
to the automagically generated assembly source used for system calls.
When all of the above is done, ports with weak alias support should add
a definition for __weak_alias to <sys/cdefs.h>.
 1.6 13-Jul-1997  christos Fix RCSID's
Fix gcc warnings.
Add missing prototypes
 1.5 29-Mar-1996  jtc branches: 1.5.2;
Add explict function return types
 1.4 14-Apr-1995  jtc Changed bzero to memset.
Changed bcmp to memcmp.
Added #include <string.h> to bring prototypes into scope.
 1.3 25-Feb-1995  cgd save my sanity; stop using Id.
 1.2 04-Dec-1994  cgd be much more careful with types, and add prototype everything.
 1.1 07-Oct-1993  cgd move the rpc code into libc
 1.5.2.1 16-Sep-1996  jtc snapshot namespace cleanup: rpc & xdr
 1.16.4.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.18.2.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.21.4.1 06-Jan-2003  jmc Pull up revisions 1.21-1.22 (requested by fvdl in ticket #1037)
* Adapt include files for rpc_com.h/rpc_internal.h split.
* Implement non-blocking connections.
* Add rpc_control to svc.c
 1.21.2.2 11-Nov-2002  nathanw Catch up to -current
 1.21.2.1 08-Aug-2001  nathanw Convert to our threading style.
__REENT -> _REENTRANT
Statically initialize mutexes.
Use pthread thread-specific data semantics and once_t instead of Sun thread
semantics.
Use __isthreaded to detect presence of thread universe instead of _thr_main().
 1.29.18.1 18-May-2008  yamt sync with head.
 1.30.24.1 14-Mar-2013  riz Pull up following revision(s) (requested by tron in ticket #843):
lib/libc/rpc/clnt_dg.c: revision 1.28
lib/libc/rpc/xdr_sizeof.c: revision 1.5
lib/libc/rpc/pmap_getport.c: revision 1.19
lib/libc/rpc/xdr_mem.c: revision 1.19
lib/libc/rpc/svc_run.c: revision 1.22
lib/libc/rpc/bindresvport.c: revision 1.25
lib/libc/rpc/svc_raw.c: revision 1.24
lib/libc/rpc/svc_dg.c: revision 1.17
lib/libc/rpc/getnetconfig.c: revision 1.21
lib/libc/rpc/auth_unix.c: revision 1.25
lib/libc/rpc/svc_auth.c: revision 1.17
lib/libc/rpc/clnt_vc.c: revision 1.21
lib/libc/rpc/svc_auth_unix.c: revision 1.21
lib/libc/rpc/rpcb_st_xdr.c: revision 1.10
lib/libc/rpc/pmap_getmaps.c: revision 1.18
lib/libc/rpc/getnetpath.c: revision 1.17
lib/libc/rpc/clnt_simple.c: revision 1.32
lib/libc/rpc/authunix_prot.c: revision 1.16
lib/libc/rpc/svc_dg.h: revision 1.2
lib/libc/rpc/svc_generic.c: revision 1.15
lib/libc/rpc/clnt_raw.c: revision 1.32
lib/libc/rpc/xdr_array.c: revision 1.19
lib/libc/rpc/pmap_prot.c: revision 1.12
lib/libc/rpc/clnt_bcast.c: revision 1.26
lib/libc/rpc/xdr_rec.c: revision 1.35
lib/libc/rpc/svc.c: revision 1.34
lib/libc/rpc/DISCLAIMER: revision 1.3
lib/libc/rpc/clnt_generic.c: revision 1.30
lib/libc/rpc/xdr.c: revision 1.33
lib/libc/rpc/auth_none.c: revision 1.16
lib/libc/rpc/pmap_rmt.c: revision 1.34
lib/libc/rpc/rpc_callmsg.c: revision 1.20
lib/libc/rpc/clnt_perror.c: revision 1.30
lib/libc/rpc/xdr_stdio.c: revision 1.19
lib/libc/rpc/rpc_commondata.c: revision 1.9
lib/libc/rpc/pmap_prot2.c: revision 1.17
lib/libc/rpc/pmap_clnt.c: revision 1.19
lib/libc/rpc/svc_simple.c: revision 1.33
lib/libc/rpc/rpcb_clnt.c: revision 1.29
lib/libc/rpc/rpc_prot.c: revision 1.21
lib/libc/rpc/rpc_dtablesize.c: revision 1.16
lib/libc/rpc/rpc_generic.c: revision 1.28
lib/libc/rpc/xdr_reference.c: revision 1.18
lib/libc/rpc/rpc_soc.c: revision 1.18
lib/libc/rpc/svc_vc.c: revision 1.30
lib/libc/rpc/getrpcent.c: revision 1.23
lib/libc/rpc/xdr_float.c: revision 1.38
lib/libc/rpc/rpcb_prot.c: revision 1.11
lib/libc/rpc/getrpcport.c: revision 1.18
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.
This fixes PR lib/45293 by Pedro Giffuni.
 1.30.8.2 25-Apr-2008  christos - always check malloc results
- don't leak fds on error
- don't cast malloc
- don't cast NULL
 1.30.8.1 25-Apr-2008  christos file svc_simple.c was added on branch christos-time_t on 2008-04-25 17:44:45 +0000
 1.30.4.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.30.4.1 17-Apr-2012  yamt sync with head
 1.31.2.1 23-Jun-2013  tls resync from head
 1.28 02-Jun-2000  fvdl Add new RPC code, based on Sun's TI-RPC code. Adapted to not use XTI,
but sockets instead, internally. Old, backward compatible interfaces
maintained.
 1.27 22-Jan-2000  mycroft branches: 1.27.2;
Delint.
Remove trailing ; from uses of __weak_alias(). The macro inserts this if
needed.
 1.26 20-Sep-1999  lukem back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.25 16-Sep-1999  sommerfeld Let this build without _DIAGNOSTIC
 1.24 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.23 03-May-1999  christos int -> socklen_t
 1.22 25-Mar-1999  lukem * don't close the socket unless it was opened by the function
* note (in the comments) that the client is responsible for closing
the socket if they opened it, or they didn't use CLNT_DESTROY()

fixes a couple of unnecessary closing of already-closed sockets.
noted by: Matthias Drochner <M.Drochner@fz-juelich.de>
 1.21 20-Jan-1999  lukem * ensure memory is released if operations fail (in authunix_create(),
xdr_callmsg(), xprt_register(), svc_tcp(), svc_udp(), etc)
* don't attempt to close a socket filedescriptor if it's -1 (some from
freebsd, some i found)
* make the initial xid a little more random (from freebsd)
* fix some spelos and tyops in comments (some from freebsd)
* use warn() instead of warnx() for many errors; the user probably
wants to know what the error code was.
* knf & whitespace nitpicks
 1.20 20-Jan-1999  lukem * svctcp_create():
- bump listen backlog to a modern value (should fix [lib/6379])
- always check if sock should be closed
- provide more informative error messages
* svctcp_rev(); set strm_stat = XPRT_DIED if error (from freebsd)
 1.19 15-Nov-1998  christos delint
 1.18 26-Jul-1998  mycroft constify some tables.
 1.17 24-Apr-1998  pk If poll(2) times out, report failure.
 1.16 13-Feb-1998  lukem * in get_myaddress(); always return sockaddr_in containing localhost:PMAP_PORT.
(as recommended in Weiste Venema's portmap5_beta distribution)
* deprecate register
* use memmove instead of bcopy
* KNF includes
* use err/warn() instead of perror/fprintf(stderr,)
* fix some typos
 1.15 12-Feb-1998  lukem revert; we can't break the existing ABI and API
 1.14 11-Feb-1998  lukem use u_int32_t instead of size_t...
 1.13 10-Feb-1998  lukem major cleanup (to sync with changes made in include/rpc/*.h):
* use int32_t, size_t, in_port_t instead of long, u_int, u_short as appropriate
* use uid_t and gid_t instead of int
* KNF, fix typos and spellos
* use const as appropriate
* deprecate register
* use memmove instead of bcopy
* use err/warn()
 1.12 21-Jul-1997  jtc If port provides __weak_alias(), provide an Standard C and POSIX pure
identifier namespace by renaming non standard functions and variables
such that they have a leading underscore. The library will use those
names internally. Weak aliases are used to provide the original names
to the API.

This is only the first part of this change. It is most of the functions
which are implemented in C for all NetBSD ports. Subsequent changes are
to add the same support to the remaining C files, to assembly files, and
to the automagically generated assembly source used for system calls.
When all of the above is done, ports with weak alias support should add
a definition for __weak_alias to <sys/cdefs.h>.
 1.11 13-Jul-1997  christos Fix RCSID's
Fix gcc warnings.
Add missing prototypes
 1.10 08-Feb-1997  mycroft It's not necessary to initialize the `revents' field of struct pollfd.
 1.9 24-Dec-1996  christos fix previous booboo that broke all rpc services...
 1.8 20-Dec-1996  cgd unistd.h for prototypes
 1.7 17-Dec-1996  mrg use poll() instead of select()
 1.6 03-Jun-1995  mycroft branches: 1.6.4;
Fill in sin_len.
 1.5 14-Apr-1995  jtc Changed bzero to memset.
Changed bcmp to memcmp.
Added #include <string.h> to bring prototypes into scope.
 1.4 25-Feb-1995  cgd save my sanity; stop using Id.
 1.3 04-Dec-1994  cgd branches: 1.3.2;
be much more careful with types, and add prototype everything.
 1.2 20-Aug-1994  deraadt branches: 1.2.2;
rpc library no longer uses _rpc_dtablesize() internally -- keeps track
of highest active file descriptor. limit fd usage to FD_SETSIZE, until
a better solution is found. remove non-FD_SETSIZE code.
 1.1 07-Oct-1993  cgd move the rpc code into libc
 1.2.2.2 20-Aug-1994  deraadt rpc library no longer uses _rpc_dtablesize() internally -- keeps track
of highest active file descriptor. limit fd usage to FD_SETSIZE, until
a better solution is found. remove non-FD_SETSIZE code.
 1.2.2.1 20-Aug-1994  deraadt file svc_tcp.c was added on branch netbsd-1-0 on 1994-08-20 00:55:35 +0000
 1.3.2.1 02-May-1995  jtc #include "namespace.h"
 1.6.4.1 16-Sep-1996  jtc snapshot namespace cleanup: rpc & xdr
 1.27.2.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.21 02-Jun-2000  fvdl Add new RPC code, based on Sun's TI-RPC code. Adapted to not use XTI,
but sockets instead, internally. Old, backward compatible interfaces
maintained.
 1.20 22-Jan-2000  mycroft branches: 1.20.2;
Delint.
Remove trailing ; from uses of __weak_alias(). The macro inserts this if
needed.
 1.19 09-May-1999  christos Fix bug I introduced on 19990503 by renaming a variable.
 1.18 03-May-1999  christos int -> socklen_t
 1.17 25-Mar-1999  lukem * don't close the socket unless it was opened by the function
* note (in the comments) that the client is responsible for closing
the socket if they opened it, or they didn't use CLNT_DESTROY()

fixes a couple of unnecessary closing of already-closed sockets.
noted by: Matthias Drochner <M.Drochner@fz-juelich.de>
 1.16 20-Jan-1999  lukem * ensure memory is released if operations fail (in authunix_create(),
xdr_callmsg(), xprt_register(), svc_tcp(), svc_udp(), etc)
* don't attempt to close a socket filedescriptor if it's -1 (some from
freebsd, some i found)
* make the initial xid a little more random (from freebsd)
* fix some spelos and tyops in comments (some from freebsd)
* use warn() instead of warnx() for many errors; the user probably
wants to know what the error code was.
* knf & whitespace nitpicks
 1.15 15-Nov-1998  christos delint
 1.14 26-Jul-1998  mycroft constify some tables.
 1.13 13-Feb-1998  lukem * in get_myaddress(); always return sockaddr_in containing localhost:PMAP_PORT.
(as recommended in Weiste Venema's portmap5_beta distribution)
* deprecate register
* use memmove instead of bcopy
* KNF includes
* use err/warn() instead of perror/fprintf(stderr,)
* fix some typos
 1.12 12-Feb-1998  lukem revert; we can't break the existing ABI and API
 1.11 11-Feb-1998  lukem use u_int32_t instead of size_t...
 1.10 10-Feb-1998  lukem major cleanup (to sync with changes made in include/rpc/*.h):
* use int32_t, size_t, in_port_t instead of long, u_int, u_short as appropriate
* use uid_t and gid_t instead of int
* KNF, fix typos and spellos
* use const as appropriate
* deprecate register
* use memmove instead of bcopy
* use err/warn()
 1.9 21-Jul-1997  jtc If port provides __weak_alias(), provide an Standard C and POSIX pure
identifier namespace by renaming non standard functions and variables
such that they have a leading underscore. The library will use those
names internally. Weak aliases are used to provide the original names
to the API.

This is only the first part of this change. It is most of the functions
which are implemented in C for all NetBSD ports. Subsequent changes are
to add the same support to the remaining C files, to assembly files, and
to the automagically generated assembly source used for system calls.
When all of the above is done, ports with weak alias support should add
a definition for __weak_alias to <sys/cdefs.h>.
 1.8 13-Jul-1997  christos Fix RCSID's
Fix gcc warnings.
Add missing prototypes
 1.7 29-Mar-1996  jtc branches: 1.7.2;
Add explict function return types
 1.6 03-Jun-1995  mycroft Fill in sin_len.
 1.5 14-Apr-1995  jtc Changed bzero to memset.
Changed bcmp to memcmp.
Added #include <string.h> to bring prototypes into scope.
 1.4 25-Feb-1995  cgd save my sanity; stop using Id.
 1.3 04-Dec-1994  cgd branches: 1.3.2;
be much more careful with types, and add prototype everything.
 1.2 30-Aug-1994  deraadt improper handling of recvfrom error return value
 1.1 07-Oct-1993  cgd move the rpc code into libc
 1.3.2.1 02-May-1995  jtc #include "namespace.h"
 1.7.2.1 16-Sep-1996  jtc snapshot namespace cleanup: rpc & xdr
 1.20.2.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.37 23-Jan-2024  christos fix nested extern warnings
 1.36 07-Dec-2021  andvar s/listner/listener/
 1.35 08-Aug-2021  nia introduce a SOL_LOCAL for unix-domain socket level socket options
as an alias of the current 0 used for these options, as in FreeBSD.

reviewed by many.
 1.34 10-Nov-2015  christos fix compilation/lint
 1.33 07-Nov-2015  christos PR/50408: Pedro Giffuni: Provide a way for rpc to use poll(2) instead of
select(2), and the linux svc_pollfd and svc_maxpollfd members. Our select(2)
implementation does not suffer from the FD_SETSIZE limitation so this is
not turned on by default.
 1.32 07-Nov-2015  christos check for errors and recover instead of core-dumping.
 1.31 06-Nov-2015  christos - Provide multi-threaded fdset's for everyone not just rump if requested.
- Abstract fd_set access, and don't limit the fd_set size.
- Maintain binary compatibility by keeping the old global variables around.
 1.30 11-Mar-2013  tron Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.

This fixes PR lib/45293 by Pedro Giffuni.
 1.29 05-Mar-2013  christos make this usable from RUMP
 1.28 04-Mar-2013  christos PR/47617: Thorsten Brehm: Memory and socket leak in librpc
 1.27 04-Mar-2013  christos fix error messages and warnings.
 1.26 20-Mar-2012  matt branches: 1.26.2;
Use C89 definitions
Remove use of __P
 1.25 13-Mar-2012  christos PR/45989: Martin Husemann: lint invocation does include -w only on i386

- turn lint -w for all the platforms after fixing the lint warnings.
- add _DIAGASSERTS() for casts that would assign values to types that
would not fit.
- change types, add casts
- change into ansii prototypes
- turn on _DIAGNOSTIC for libc (during current, to be eliminated for release
builds)

approved by core@
 1.24 04-Feb-2011  christos branches: 1.24.4; 1.24.6;
PR/44514: Andrey Simonenko: Buffer underflow in RPC library for non-blocking
TCP sockets
 1.23 04-Feb-2011  christos knf - no functional changes
 1.22 12-Feb-2009  lukem branches: 1.22.2;
sign-compare fix
 1.21 25-Apr-2008  christos branches: 1.21.8; 1.21.10;
- always check malloc results
- don't leak fds on error
- don't cast malloc
- don't cast NULL
 1.20 17-Oct-2006  christos branches: 1.20.16;
Only retry if we were able to clean up some descriptors, otherwise we get
into an infinite loop.
 1.19 22-Jun-2006  christos Centralize the TCP_NODELAY handling as discussed in tech-net.
 1.18 22-Mar-2006  drochner -fix uninitialized variable introduced in previous
(found by gcc:-)
-minor prototype cleanup
 1.17 22-Mar-2006  christos Coverity CID 2291: Move function call before allocating storage to prevent
memory leak on error.
 1.16 22-Mar-2006  christos Coverity CID 2292: Plug memory leak.
 1.15 13-Dec-2005  jmc XXXGCC: Make a local extern for abort and the vax compiler is happy again.
 1.14 10-Dec-2005  christos fix a typo , instead of ; From Johnny Billquist
 1.13 09-Sep-2005  christos Convert the rest of the code to use pollts for consistency. XXX: We should
really use kqueue.
 1.12 18-Jan-2003  thorpej branches: 1.12.6; 1.12.10;
Merge the nathanw_sa branch.
 1.11 12-Nov-2002  skrll Add extern svc_fd_lock if __REENT and include rpc_internal.h only once.
 1.10 08-Nov-2002  fvdl * Adapt include files for rpc_com.h/rpc_internal.h split.
* Add rpc_control to svc.c
* Implement non-blocking connections.
 1.9 03-Mar-2002  cjep branches: 1.9.2;
Fix spelling mistake (from Onno van der Linden; PR#15793).
 1.8 04-Jan-2001  lukem branches: 1.8.2;
whitespace consistency fixups
 1.7 03-Aug-2000  fvdl For an accepted connection (tcp), set xp_netid, as it might be examined
by some applications, most notably rpcbind.
 1.6 08-Jul-2000  kleink De-delint previous: svc_vc_rendezvous_ops() isn't unused unless the single
reference to it is accidently deleted; from Shuuichirou Murata in PR lib/10537.
 1.5 06-Jul-2000  christos add __RPC_GETXID macro
don't const castway __rpc_getconf and __rpc_getconfig. It might try to
write const strings
fix non-portable casts
remove duplicated prototypes
cast things to proper types
remove extraneous casts to NULL
fix variable cast mismatches
remove register var declarations
 1.4 06-Jun-2000  fvdl branches: 1.4.2; 1.4.4;
Correct misleading error messages.
 1.3 05-Jun-2000  thorpej - An initialized variable kept LOCAL_CREDS from being set on
the listen socket properly. This caused spurious rpcbind(8)
failures.
- Don't define a "credmsg" structure. Instead, dynamically
allocate a buffer of the correct size of the message with
CMSG_SPACE() and free it when we're done. This gets the
size of the buffer right on LP64 platforms, which has padding
for alignment thrown in.
- Check for non-present or truncated cred messages when recvmsg(2)
returns.
 1.2 03-Jun-2000  fvdl Zero out the xprt in makefd_xprt to avoid bad free() calls in some cases.
 1.1 02-Jun-2000  fvdl Add new RPC code, based on Sun's TI-RPC code. Adapted to not use XTI,
but sockets instead, internally. Old, backward compatible interfaces
maintained.
 1.4.4.2 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.4.4.1 06-Jun-2000  minoura file svc_vc.c was added on branch minoura-xpg4dl on 2000-06-23 16:17:52 +0000
 1.4.2.1 05-Aug-2000  fvdl Pull up version 1.7:
For an accepted connection (tcp), set xp_netid, as it might be examined
by some applications, most notably rpcbind.
 1.8.2.5 12-Nov-2002  skrll Catch up to -current.
 1.8.2.4 11-Nov-2002  nathanw Catch up to -current
 1.8.2.3 22-Mar-2002  nathanw Catch up to -current.
 1.8.2.2 08-Mar-2002  nathanw Catch up to -current.
 1.8.2.1 08-Aug-2001  nathanw Convert to our threading style.
__REENT -> _REENTRANT
Statically initialize mutexes.
Use pthread thread-specific data semantics and once_t instead of Sun thread
semantics.
Use __isthreaded to detect presence of thread universe instead of _thr_main().
 1.9.2.1 06-Jan-2003  jmc Pull up revisions 1.9-1.10 (requested by fvdl in ticket #1037)
* Adapt include files for rpc_com.h/rpc_internal.h split.
* Implement non-blocking connections.
* Add rpc_control to svc.c
 1.12.10.1 24-Oct-2006  ghen Pull up following revision(s) (requested by tron in ticket #1558):
lib/libc/rpc/svc_vc.c: revision 1.20
Only retry if we were able to clean up some descriptors, otherwise we get
into an infinite loop.
 1.12.6.1 24-Oct-2006  ghen Pull up following revision(s) (requested by tron in ticket #1558):
lib/libc/rpc/svc_vc.c: revision 1.20
Only retry if we were able to clean up some descriptors, otherwise we get
into an infinite loop.
 1.20.16.1 18-May-2008  yamt sync with head.
 1.21.10.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.21.8.2 25-Apr-2008  christos - always check malloc results
- don't leak fds on error
- don't cast malloc
- don't cast NULL
 1.21.8.1 25-Apr-2008  christos file svc_vc.c was added on branch christos-time_t on 2008-04-25 17:44:45 +0000
 1.22.2.1 08-Feb-2011  bouyer Sync with HEAD
 1.24.6.1 14-Mar-2013  riz Pull up following revision(s) (requested by tron in ticket #843):
lib/libc/rpc/clnt_dg.c: revision 1.28
lib/libc/rpc/xdr_sizeof.c: revision 1.5
lib/libc/rpc/pmap_getport.c: revision 1.19
lib/libc/rpc/xdr_mem.c: revision 1.19
lib/libc/rpc/svc_run.c: revision 1.22
lib/libc/rpc/bindresvport.c: revision 1.25
lib/libc/rpc/svc_raw.c: revision 1.24
lib/libc/rpc/svc_dg.c: revision 1.17
lib/libc/rpc/getnetconfig.c: revision 1.21
lib/libc/rpc/auth_unix.c: revision 1.25
lib/libc/rpc/svc_auth.c: revision 1.17
lib/libc/rpc/clnt_vc.c: revision 1.21
lib/libc/rpc/svc_auth_unix.c: revision 1.21
lib/libc/rpc/rpcb_st_xdr.c: revision 1.10
lib/libc/rpc/pmap_getmaps.c: revision 1.18
lib/libc/rpc/getnetpath.c: revision 1.17
lib/libc/rpc/clnt_simple.c: revision 1.32
lib/libc/rpc/authunix_prot.c: revision 1.16
lib/libc/rpc/svc_dg.h: revision 1.2
lib/libc/rpc/svc_generic.c: revision 1.15
lib/libc/rpc/clnt_raw.c: revision 1.32
lib/libc/rpc/xdr_array.c: revision 1.19
lib/libc/rpc/pmap_prot.c: revision 1.12
lib/libc/rpc/clnt_bcast.c: revision 1.26
lib/libc/rpc/xdr_rec.c: revision 1.35
lib/libc/rpc/svc.c: revision 1.34
lib/libc/rpc/DISCLAIMER: revision 1.3
lib/libc/rpc/clnt_generic.c: revision 1.30
lib/libc/rpc/xdr.c: revision 1.33
lib/libc/rpc/auth_none.c: revision 1.16
lib/libc/rpc/pmap_rmt.c: revision 1.34
lib/libc/rpc/rpc_callmsg.c: revision 1.20
lib/libc/rpc/clnt_perror.c: revision 1.30
lib/libc/rpc/xdr_stdio.c: revision 1.19
lib/libc/rpc/rpc_commondata.c: revision 1.9
lib/libc/rpc/pmap_prot2.c: revision 1.17
lib/libc/rpc/pmap_clnt.c: revision 1.19
lib/libc/rpc/svc_simple.c: revision 1.33
lib/libc/rpc/rpcb_clnt.c: revision 1.29
lib/libc/rpc/rpc_prot.c: revision 1.21
lib/libc/rpc/rpc_dtablesize.c: revision 1.16
lib/libc/rpc/rpc_generic.c: revision 1.28
lib/libc/rpc/xdr_reference.c: revision 1.18
lib/libc/rpc/rpc_soc.c: revision 1.18
lib/libc/rpc/svc_vc.c: revision 1.30
lib/libc/rpc/getrpcent.c: revision 1.23
lib/libc/rpc/xdr_float.c: revision 1.38
lib/libc/rpc/rpcb_prot.c: revision 1.11
lib/libc/rpc/getrpcport.c: revision 1.18
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.
This fixes PR lib/45293 by Pedro Giffuni.
 1.24.4.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.24.4.1 17-Apr-2012  yamt sync with head
 1.26.2.1 23-Jun-2013  tls resync from head
 1.14 08-Jul-2011  wiz Bump date for xdr_sizeof. Remove trailing whitespace.
 1.13 04-Jul-2011  manu Document newly imported xdr_sizeof()
 1.12 13-Oct-2009  joerg No .Pp inside .Rs/.Re.
 1.11 11-Apr-2009  joerg Add missing .Re.
 1.10 07-Sep-2003  wiz branches: 1.10.42;
Consistently use 'RFC 1234' instead of 'RFC1234' or 'RFC-1234'.
From jmc@openbsd.
 1.9 17-Apr-2003  wiz Convert to mdoc. Fix an error (two many arguments to a function).
 1.8 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.7 01-Oct-2002  wiz New sentence, new line. From Robert Elz.
 1.6 16-Sep-2001  wiz Boring whitespace fixes.
 1.5 01-Dec-1999  thorpej branches: 1.5.6;
Document the 64-bit XDR routines that Sun also documents. This manual
page needs a lot of help:
- restructure it into xdr_admin(3), xdr_complex(3), xdr_create(3), and
xdr_simple(3), as is done in Solaris.
- rewrite in mandoc, and document all of the XDR primitives that NetBSD
actually supplies.
 1.4 04-Mar-1999  lukem branches: 1.4.6;
* don't reference rpc_secure(3N) (yet)
* use section (3) not (3N) (from freebsd)
 1.3 14-Nov-1997  mrg add missing .Nm entries. from spz@serpens.swb.de.
 1.2 25-Feb-1995  cgd branches: 1.2.10;
save my sanity; stop using Id.
 1.1 07-Oct-1993  cgd move the rpc code into libc
 1.2.10.1 14-Nov-1997  mrg pull up from trunk: add missing .Nm entries. from spz@serpens.swb.de.
 1.4.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.5.6.2 18-Oct-2002  nathanw Catch up to -current.
 1.5.6.1 08-Oct-2001  nathanw Catch up to -current.
 1.10.42.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.35 04-Jun-2019  hannken Move the basic part of XDR to common/include/rpc and common/lib/libc/rpc.

No functional change intended.
 1.34 03-May-2017  christos branches: 1.34.10;
- limit size of buffers to RPC_MAXDATASIZE
- don't leak memory
- be more picky about bad parameters
https://raw.githubusercontent.com/guidovranken/rpcbomb/master/libtirpc_patch.txt

XXX: pullup-7
 1.33 11-Mar-2013  tron branches: 1.33.20;
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.

This fixes PR lib/45293 by Pedro Giffuni.
 1.32 04-Mar-2013  christos fix error messages and warnings.
 1.31 25-Jun-2012  abs branches: 1.31.2;
Update old-style definitions to ANSI, remove a couple of register
definitions along the way. Fixed gcc 4.1 build (thank you vax)
 1.30 18-Mar-2012  christos parenthesize.
 1.29 13-Mar-2012  christos PR/45989: Martin Husemann: lint invocation does include -w only on i386

- turn lint -w for all the platforms after fixing the lint warnings.
- add _DIAGASSERTS() for casts that would assign values to types that
would not fit.
- change types, add casts
- change into ansii prototypes
- turn on _DIAGNOSTIC for libc (during current, to be eliminated for release
builds)

approved by core@
 1.28 14-May-2006  christos branches: 1.28.44; 1.28.46;
XXX: GCC uninitialized variable.
 1.27 26-Jul-2003  salo netbsd.org->NetBSD.org
 1.26 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.25 10-Feb-2002  bjh21 xdr_enum() now gets passed a real enum_t *, rather than an enum foo *
in disguise. This means it can just be yet another copy of
xdr_int32_t(), rather than messing around trying to work out the size
of an enum.

This change should make no difference on existing ports, where enum_t
is the same size as all enums, but will make a difference on ARM ELF.
 1.24 17-Jan-2001  lukem branches: 1.24.2;
don't _DIAGASSERT(cp != NULL) until after cnt is checked for != 0.
other stuff in the rpc systems (e.g, authnone_create() with _null_auth)
trigger this assertion otherwise
 1.23 04-Jan-2001  lukem sprinkle _DIAGASSERT() around
 1.22 06-Jul-2000  christos add __RPC_GETXID macro
don't const castway __rpc_getconf and __rpc_getconfig. It might try to
write const strings
fix non-portable casts
remove duplicated prototypes
cast things to proper types
remove extraneous casts to NULL
fix variable cast mismatches
remove register var declarations
 1.21 22-Jan-2000  mycroft Delint.
 1.20 22-Jan-2000  mycroft Delint.
Remove trailing ; from uses of __weak_alias(). The macro inserts this if
needed.
 1.19 01-Dec-1999  thorpej Implement XDR routines for 64-bit integer data types:
- xdr_int64_t(), xdr_u_int64_t(), per NetBSD convention.
- xdr_hyper(), xdr_u_hyper(), xdr_longlong_t(), xdr_u_longlong_t(), a'la
Solaris, implemented in terms of the above.
 1.18 15-Nov-1998  christos branches: 1.18.6;
delint
 1.17 26-Jul-1998  mycroft const poisoning.
 1.16 26-Jul-1998  mycroft const poisoning.
 1.15 30-Mar-1998  mrg add "int" to bare static
 1.14 13-Feb-1998  lukem * in get_myaddress(); always return sockaddr_in containing localhost:PMAP_PORT.
(as recommended in Weiste Venema's portmap5_beta distribution)
* deprecate register
* use memmove instead of bcopy
* KNF includes
* use err/warn() instead of perror/fprintf(stderr,)
* fix some typos
 1.13 12-Feb-1998  lukem revert; we can't break the existing ABI and API
 1.12 11-Feb-1998  lukem use u_int32_t instead of size_t...
 1.11 10-Feb-1998  lukem major cleanup (to sync with changes made in include/rpc/*.h):
* use int32_t, size_t, in_port_t instead of long, u_int, u_short as appropriate
* use uid_t and gid_t instead of int
* KNF, fix typos and spellos
* use const as appropriate
* deprecate register
* use memmove instead of bcopy
* use err/warn()
 1.10 21-Jul-1997  jtc If port provides __weak_alias(), provide an Standard C and POSIX pure
identifier namespace by renaming non standard functions and variables
such that they have a leading underscore. The library will use those
names internally. Weak aliases are used to provide the original names
to the API.

This is only the first part of this change. It is most of the functions
which are implemented in C for all NetBSD ports. Subsequent changes are
to add the same support to the remaining C files, to assembly files, and
to the automagically generated assembly source used for system calls.
When all of the above is done, ports with weak alias support should add
a definition for __weak_alias to <sys/cdefs.h>.
 1.9 13-Jul-1997  christos Fix RCSID's
Fix gcc warnings.
Add missing prototypes
 1.8 29-Apr-1995  cgd branches: 1.8.4;
change some of the rpc "on-the-wire" structures' fields to be explicitly-sized
types. add xdr_{,u_}int{16,32}_t() functions to convert them.
This is necessary, because things like BPF use the RPC headers to look
at the on-the-wire data, so the headers must accurately represent
what's on the wire, too.
 1.7 25-Apr-1995  christos The typo police "dase" != "case"
 1.6 24-Apr-1995  jtc Use a switch instead of three if statements in xdr_long() and xdr_u_long(),
gcc generates slightly better code on all of the architectures I checked.
Also changed xdr_wrapstring to return the return value of xdr_string
directly.
 1.5 21-Apr-1995  jtc Don't pass a third argument (LASTUNSIGNED) to xdrproc_t functions ---
they only take two arguments. Presumably this was done to prevent
problems when users passed xdr_string instead of xdr_wrapstring.
Function prototypes are a better way to fix this "problem".
 1.4 25-Feb-1995  cgd save my sanity; stop using Id.
 1.3 04-Dec-1994  cgd be much more careful with types, and add prototype everything.
 1.2 09-Aug-1994  jtc branches: 1.2.2;
Fix definition of xdr_u_char() (PR #364)
 1.1 07-Oct-1993  cgd branches: 1.1.2;
move the rpc code into libc
 1.1.2.1 13-Aug-1994  mycroft update from trunk
 1.2.2.2 09-Aug-1994  jtc Fix definition of xdr_u_char() (PR #364)
 1.2.2.1 09-Aug-1994  jtc file xdr.c was added on branch netbsd-1-0 on 1994-08-09 00:50:31 +0000
 1.8.4.1 16-Sep-1996  jtc snapshot namespace cleanup: rpc & xdr
 1.18.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.24.2.2 22-Mar-2002  nathanw Catch up to -current.
 1.24.2.1 08-Mar-2002  nathanw Catch up to -current.
 1.28.46.1 14-Mar-2013  riz Pull up following revision(s) (requested by tron in ticket #843):
lib/libc/rpc/clnt_dg.c: revision 1.28
lib/libc/rpc/xdr_sizeof.c: revision 1.5
lib/libc/rpc/pmap_getport.c: revision 1.19
lib/libc/rpc/xdr_mem.c: revision 1.19
lib/libc/rpc/svc_run.c: revision 1.22
lib/libc/rpc/bindresvport.c: revision 1.25
lib/libc/rpc/svc_raw.c: revision 1.24
lib/libc/rpc/svc_dg.c: revision 1.17
lib/libc/rpc/getnetconfig.c: revision 1.21
lib/libc/rpc/auth_unix.c: revision 1.25
lib/libc/rpc/svc_auth.c: revision 1.17
lib/libc/rpc/clnt_vc.c: revision 1.21
lib/libc/rpc/svc_auth_unix.c: revision 1.21
lib/libc/rpc/rpcb_st_xdr.c: revision 1.10
lib/libc/rpc/pmap_getmaps.c: revision 1.18
lib/libc/rpc/getnetpath.c: revision 1.17
lib/libc/rpc/clnt_simple.c: revision 1.32
lib/libc/rpc/authunix_prot.c: revision 1.16
lib/libc/rpc/svc_dg.h: revision 1.2
lib/libc/rpc/svc_generic.c: revision 1.15
lib/libc/rpc/clnt_raw.c: revision 1.32
lib/libc/rpc/xdr_array.c: revision 1.19
lib/libc/rpc/pmap_prot.c: revision 1.12
lib/libc/rpc/clnt_bcast.c: revision 1.26
lib/libc/rpc/xdr_rec.c: revision 1.35
lib/libc/rpc/svc.c: revision 1.34
lib/libc/rpc/DISCLAIMER: revision 1.3
lib/libc/rpc/clnt_generic.c: revision 1.30
lib/libc/rpc/xdr.c: revision 1.33
lib/libc/rpc/auth_none.c: revision 1.16
lib/libc/rpc/pmap_rmt.c: revision 1.34
lib/libc/rpc/rpc_callmsg.c: revision 1.20
lib/libc/rpc/clnt_perror.c: revision 1.30
lib/libc/rpc/xdr_stdio.c: revision 1.19
lib/libc/rpc/rpc_commondata.c: revision 1.9
lib/libc/rpc/pmap_prot2.c: revision 1.17
lib/libc/rpc/pmap_clnt.c: revision 1.19
lib/libc/rpc/svc_simple.c: revision 1.33
lib/libc/rpc/rpcb_clnt.c: revision 1.29
lib/libc/rpc/rpc_prot.c: revision 1.21
lib/libc/rpc/rpc_dtablesize.c: revision 1.16
lib/libc/rpc/rpc_generic.c: revision 1.28
lib/libc/rpc/xdr_reference.c: revision 1.18
lib/libc/rpc/rpc_soc.c: revision 1.18
lib/libc/rpc/svc_vc.c: revision 1.30
lib/libc/rpc/getrpcent.c: revision 1.23
lib/libc/rpc/xdr_float.c: revision 1.38
lib/libc/rpc/rpcb_prot.c: revision 1.11
lib/libc/rpc/getrpcport.c: revision 1.18
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.
This fixes PR lib/45293 by Pedro Giffuni.
 1.28.44.3 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.28.44.2 30-Oct-2012  yamt sync with head
 1.28.44.1 17-Apr-2012  yamt sync with head
 1.31.2.1 23-Jun-2013  tls resync from head
 1.33.20.1 11-May-2017  pgoyette Sync with HEAD
 1.34.10.1 10-Jun-2019  christos Sync with HEAD
 1.20 04-Jun-2019  hannken Move the basic part of XDR to common/include/rpc and common/lib/libc/rpc.

No functional change intended.
 1.19 11-Mar-2013  tron branches: 1.19.30;
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.

This fixes PR lib/45293 by Pedro Giffuni.
 1.18 04-Mar-2013  christos fix error messages and warnings.
 1.17 25-Jun-2012  abs branches: 1.17.2;
Update old-style definitions to ANSI, remove a couple of register
definitions along the way. Fixed gcc 4.1 build (thank you vax)
 1.16 05-Aug-2005  wiz branches: 1.16.44; 1.16.46;
espie@openbsd:
impelmentation -> implementation

yes, new typo for an old friend.
 1.15 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.14 01-Aug-2002  itojun correct range check. from openbsd
 1.13 30-Jul-2002  darrenr patch from openbsd to fix bounds checking, eliminating an overflow condition.
 1.12 22-Jan-2000  mycroft branches: 1.12.4; 1.12.6; 1.12.8;
Delint.
Remove trailing ; from uses of __weak_alias(). The macro inserts this if
needed.
 1.11 20-Jan-1999  lukem * ensure memory is released if operations fail (in authunix_create(),
xdr_callmsg(), xprt_register(), svc_tcp(), svc_udp(), etc)
* don't attempt to close a socket filedescriptor if it's -1 (some from
freebsd, some i found)
* make the initial xid a little more random (from freebsd)
* fix some spelos and tyops in comments (some from freebsd)
* use warn() instead of warnx() for many errors; the user probably
wants to know what the error code was.
* knf & whitespace nitpicks
 1.10 13-Feb-1998  lukem * in get_myaddress(); always return sockaddr_in containing localhost:PMAP_PORT.
(as recommended in Weiste Venema's portmap5_beta distribution)
* deprecate register
* use memmove instead of bcopy
* KNF includes
* use err/warn() instead of perror/fprintf(stderr,)
* fix some typos
 1.9 12-Feb-1998  lukem revert; we can't break the existing ABI and API
 1.8 11-Feb-1998  lukem use u_int32_t instead of size_t...
 1.7 10-Feb-1998  lukem major cleanup (to sync with changes made in include/rpc/*.h):
* use int32_t, size_t, in_port_t instead of long, u_int, u_short as appropriate
* use uid_t and gid_t instead of int
* KNF, fix typos and spellos
* use const as appropriate
* deprecate register
* use memmove instead of bcopy
* use err/warn()
 1.6 21-Jul-1997  jtc If port provides __weak_alias(), provide an Standard C and POSIX pure
identifier namespace by renaming non standard functions and variables
such that they have a leading underscore. The library will use those
names internally. Weak aliases are used to provide the original names
to the API.

This is only the first part of this change. It is most of the functions
which are implemented in C for all NetBSD ports. Subsequent changes are
to add the same support to the remaining C files, to assembly files, and
to the automagically generated assembly source used for system calls.
When all of the above is done, ports with weak alias support should add
a definition for __weak_alias to <sys/cdefs.h>.
 1.5 13-Jul-1997  christos Fix RCSID's
Fix gcc warnings.
Add missing prototypes
 1.4 14-Apr-1995  jtc branches: 1.4.4;
Don't pass a third argument (LASTUNSIGNED) to xdrproc_t functions ---
they only take two arguments. Presumably this was done to prevent
problems when users passed xdr_string instead of xdr_wrapstring.
Function prototypes are a better way to fix this "problem".
 1.3 14-Apr-1995  jtc Changed bzero to memset.
Changed bcmp to memcmp.
Added #include <string.h> to bring prototypes into scope.
 1.2 25-Feb-1995  cgd save my sanity; stop using Id.
 1.1 07-Oct-1993  cgd move the rpc code into libc
 1.4.4.1 16-Sep-1996  jtc snapshot namespace cleanup: rpc & xdr
 1.12.8.2 02-Aug-2002  lukem Pull up revision 1.14 (requested by itojun in ticket #600):
correct range check. from openbsd
 1.12.8.1 31-Jul-2002  lukem Pull up revision 1.13 (requested by darrenr in ticket #592):
patch from openbsd to fix bounds checking, eliminating an overflow condition.
 1.12.6.2 13-Aug-2002  nathanw Catch up to -current.
 1.12.6.1 01-Aug-2002  nathanw Catch up to -current.
 1.12.4.1 01-Aug-2002  he Pull up revisions 1.13-1.14 (requested by darrenr and itojun):
Fix bounds checking, eliminating an overflow condition.
 1.16.46.1 14-Mar-2013  riz Pull up following revision(s) (requested by tron in ticket #843):
lib/libc/rpc/clnt_dg.c: revision 1.28
lib/libc/rpc/xdr_sizeof.c: revision 1.5
lib/libc/rpc/pmap_getport.c: revision 1.19
lib/libc/rpc/xdr_mem.c: revision 1.19
lib/libc/rpc/svc_run.c: revision 1.22
lib/libc/rpc/bindresvport.c: revision 1.25
lib/libc/rpc/svc_raw.c: revision 1.24
lib/libc/rpc/svc_dg.c: revision 1.17
lib/libc/rpc/getnetconfig.c: revision 1.21
lib/libc/rpc/auth_unix.c: revision 1.25
lib/libc/rpc/svc_auth.c: revision 1.17
lib/libc/rpc/clnt_vc.c: revision 1.21
lib/libc/rpc/svc_auth_unix.c: revision 1.21
lib/libc/rpc/rpcb_st_xdr.c: revision 1.10
lib/libc/rpc/pmap_getmaps.c: revision 1.18
lib/libc/rpc/getnetpath.c: revision 1.17
lib/libc/rpc/clnt_simple.c: revision 1.32
lib/libc/rpc/authunix_prot.c: revision 1.16
lib/libc/rpc/svc_dg.h: revision 1.2
lib/libc/rpc/svc_generic.c: revision 1.15
lib/libc/rpc/clnt_raw.c: revision 1.32
lib/libc/rpc/xdr_array.c: revision 1.19
lib/libc/rpc/pmap_prot.c: revision 1.12
lib/libc/rpc/clnt_bcast.c: revision 1.26
lib/libc/rpc/xdr_rec.c: revision 1.35
lib/libc/rpc/svc.c: revision 1.34
lib/libc/rpc/DISCLAIMER: revision 1.3
lib/libc/rpc/clnt_generic.c: revision 1.30
lib/libc/rpc/xdr.c: revision 1.33
lib/libc/rpc/auth_none.c: revision 1.16
lib/libc/rpc/pmap_rmt.c: revision 1.34
lib/libc/rpc/rpc_callmsg.c: revision 1.20
lib/libc/rpc/clnt_perror.c: revision 1.30
lib/libc/rpc/xdr_stdio.c: revision 1.19
lib/libc/rpc/rpc_commondata.c: revision 1.9
lib/libc/rpc/pmap_prot2.c: revision 1.17
lib/libc/rpc/pmap_clnt.c: revision 1.19
lib/libc/rpc/svc_simple.c: revision 1.33
lib/libc/rpc/rpcb_clnt.c: revision 1.29
lib/libc/rpc/rpc_prot.c: revision 1.21
lib/libc/rpc/rpc_dtablesize.c: revision 1.16
lib/libc/rpc/rpc_generic.c: revision 1.28
lib/libc/rpc/xdr_reference.c: revision 1.18
lib/libc/rpc/rpc_soc.c: revision 1.18
lib/libc/rpc/svc_vc.c: revision 1.30
lib/libc/rpc/getrpcent.c: revision 1.23
lib/libc/rpc/xdr_float.c: revision 1.38
lib/libc/rpc/rpcb_prot.c: revision 1.11
lib/libc/rpc/getrpcport.c: revision 1.18
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.
This fixes PR lib/45293 by Pedro Giffuni.
 1.16.44.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.16.44.1 30-Oct-2012  yamt sync with head
 1.17.2.1 23-Jun-2013  tls resync from head
 1.19.30.1 10-Jun-2019  christos Sync with HEAD
 1.42 11-Apr-2024  christos avoid lint warning on the vax
 1.41 15-Feb-2016  martin Avoid strict alias violation for VAX
 1.40 24-Aug-2014  matt Assume anything not vax has IEEEFP.
 1.39 10-Aug-2014  matt Changes to existing files to enable building AARCH64 userland.
evbarm64-el
This is clang only. While gcc4.8 supports aarch64, no netbsd support has
been written for aarch64 with gcc4.8.
 1.38 11-Mar-2013  tron Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.

This fixes PR lib/45293 by Pedro Giffuni.
 1.37 25-Jun-2012  abs branches: 1.37.2;
Update old-style definitions to ANSI, remove a couple of register
definitions along the way. Fixed gcc 4.1 build (thank you vax)
 1.36 22-Mar-2012  christos vax-specific lint fixes.
 1.35 14-Feb-2009  lukem branches: 1.35.6; 1.35.8;
fix -Wsign-compare issues (untested)
 1.34 15-Sep-2006  cherry branches: 1.34.28;
add ia64 to the ugly IEEEFP hackaround
 1.33 05-Aug-2005  wiz espie@openbsd:
impelmentation -> implementation

yes, new typo for an old friend.
 1.32 08-Dec-2003  matt Make this compile on non-IEEE GCC3 targets (aka VAX).
 1.31 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.30 06-Jun-2002  fredette Added hppa support (some of it incomplete) to lib/csu, lib/libc,
and lib/libkvm.
 1.29 15-Dec-2001  thorpej Use __sh__ instead of __sh3__.
 1.28 19-Jun-2001  fvdl Another one of those if defined(arch) lists I forgot to commit earlier.
 1.27 21-Feb-2001  bjh21 branches: 1.27.2;
Add support for ARM VFP-format doubles, conditional on __VFP_FP__.
 1.26 18-Feb-2001  bjh21 The ARM FPA is big-endian as far as the word order in doubles is concerned.
 1.25 09-Feb-2001  bjh21 __arm26__ || __arm32__ -> __arm__
Not least because the unified NetBSD/arm compiler probably won't predefine
__arm26__ or __arm32__.
 1.24 20-Dec-2000  christos appease lint casts
 1.23 17-Jul-2000  matt fix a bug in the NOIEEE (aka VAX) case.
 1.22 14-Jul-2000  fvdl Use explicit int32 get/put macros. Needed for 64bit big-endian systems.
 1.21 09-May-2000  bjh21 branches: 1.21.4;
Initial commit of arm26 port
 1.20 22-Jan-2000  mycroft Delint.
Remove trailing ; from uses of __weak_alias(). The macro inserts this if
needed.
 1.19 26-Nov-1999  msaitoh check __sh3__
 1.18 15-Nov-1998  christos branches: 1.18.6;
delint
 1.17 19-Oct-1998  matt Change #ifdef vax to __vax__.
 1.16 13-Feb-1998  lukem * in get_myaddress(); always return sockaddr_in containing localhost:PMAP_PORT.
(as recommended in Weiste Venema's portmap5_beta distribution)
* deprecate register
* use memmove instead of bcopy
* KNF includes
* use err/warn() instead of perror/fprintf(stderr,)
* fix some typos
 1.15 12-Feb-1998  lukem revert; we can't break the existing ABI and API
 1.14 10-Feb-1998  lukem major cleanup (to sync with changes made in include/rpc/*.h):
* use int32_t, size_t, in_port_t instead of long, u_int, u_short as appropriate
* use uid_t and gid_t instead of int
* KNF, fix typos and spellos
* use const as appropriate
* deprecate register
* use memmove instead of bcopy
* use err/warn()
 1.13 21-Jul-1997  jtc If port provides __weak_alias(), provide an Standard C and POSIX pure
identifier namespace by renaming non standard functions and variables
such that they have a leading underscore. The library will use those
names internally. Weak aliases are used to provide the original names
to the API.

This is only the first part of this change. It is most of the functions
which are implemented in C for all NetBSD ports. Subsequent changes are
to add the same support to the remaining C files, to assembly files, and
to the automagically generated assembly source used for system calls.
When all of the above is done, ports with weak alias support should add
a definition for __weak_alias to <sys/cdefs.h>.
 1.12 13-Jul-1997  christos Fix RCSID's
Fix gcc warnings.
Add missing prototypes
 1.11 29-Mar-1997  thorpej PowerPC is an IEEE floating point system.
 1.10 16-Feb-1996  mark branches: 1.10.2;
Define IEEEFP if we are compiling for the arm32.
 1.9 05-Jun-1995  pk Fix typo (Der mouse, PR #1115).
 1.8 14-Apr-1995  jtc Removed comment that explained that this code is not portable. A better
comment is already present near the top of the file.
 1.7 21-Mar-1995  jtc #include <machine/endian.h>.
 1.6 25-Feb-1995  cgd save my sanity; stop using Id.
 1.5 22-Dec-1994  cgd fix up for new compiler predefines
 1.4 20-Dec-1994  cgd type-size sanity
 1.3 04-Dec-1994  cgd be much more careful with types, and add prototype everything.
 1.2 02-Mar-1994  phil Changing the ns32000 to ns32k as used in other places.
 1.1 07-Oct-1993  cgd move the rpc code into libc
 1.10.2.1 16-Sep-1996  jtc snapshot namespace cleanup: rpc & xdr
 1.18.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.21.4.3 11-Mar-2001  he Pull up revision 1.26 (requested by bjh21):
Correct handling of XDR doubles on ARM platforms to cope with
their odd byte ordering.
 1.21.4.2 18-Jul-2000  matt Fix non-IEEEFP (int32 -> int32_t)
 1.21.4.1 14-Jul-2000  fvdl Pullup from trunk: use explicit 32 bit operations and types where
appropriate, to make things work on 64bit BE systems.
 1.27.2.3 21-Jun-2002  nathanw Catch up to -current.
 1.27.2.2 28-Jan-2002  nathanw Catch up to -current.
 1.27.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.34.28.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.35.8.1 14-Mar-2013  riz Pull up following revision(s) (requested by tron in ticket #843):
lib/libc/rpc/clnt_dg.c: revision 1.28
lib/libc/rpc/xdr_sizeof.c: revision 1.5
lib/libc/rpc/pmap_getport.c: revision 1.19
lib/libc/rpc/xdr_mem.c: revision 1.19
lib/libc/rpc/svc_run.c: revision 1.22
lib/libc/rpc/bindresvport.c: revision 1.25
lib/libc/rpc/svc_raw.c: revision 1.24
lib/libc/rpc/svc_dg.c: revision 1.17
lib/libc/rpc/getnetconfig.c: revision 1.21
lib/libc/rpc/auth_unix.c: revision 1.25
lib/libc/rpc/svc_auth.c: revision 1.17
lib/libc/rpc/clnt_vc.c: revision 1.21
lib/libc/rpc/svc_auth_unix.c: revision 1.21
lib/libc/rpc/rpcb_st_xdr.c: revision 1.10
lib/libc/rpc/pmap_getmaps.c: revision 1.18
lib/libc/rpc/getnetpath.c: revision 1.17
lib/libc/rpc/clnt_simple.c: revision 1.32
lib/libc/rpc/authunix_prot.c: revision 1.16
lib/libc/rpc/svc_dg.h: revision 1.2
lib/libc/rpc/svc_generic.c: revision 1.15
lib/libc/rpc/clnt_raw.c: revision 1.32
lib/libc/rpc/xdr_array.c: revision 1.19
lib/libc/rpc/pmap_prot.c: revision 1.12
lib/libc/rpc/clnt_bcast.c: revision 1.26
lib/libc/rpc/xdr_rec.c: revision 1.35
lib/libc/rpc/svc.c: revision 1.34
lib/libc/rpc/DISCLAIMER: revision 1.3
lib/libc/rpc/clnt_generic.c: revision 1.30
lib/libc/rpc/xdr.c: revision 1.33
lib/libc/rpc/auth_none.c: revision 1.16
lib/libc/rpc/pmap_rmt.c: revision 1.34
lib/libc/rpc/rpc_callmsg.c: revision 1.20
lib/libc/rpc/clnt_perror.c: revision 1.30
lib/libc/rpc/xdr_stdio.c: revision 1.19
lib/libc/rpc/rpc_commondata.c: revision 1.9
lib/libc/rpc/pmap_prot2.c: revision 1.17
lib/libc/rpc/pmap_clnt.c: revision 1.19
lib/libc/rpc/svc_simple.c: revision 1.33
lib/libc/rpc/rpcb_clnt.c: revision 1.29
lib/libc/rpc/rpc_prot.c: revision 1.21
lib/libc/rpc/rpc_dtablesize.c: revision 1.16
lib/libc/rpc/rpc_generic.c: revision 1.28
lib/libc/rpc/xdr_reference.c: revision 1.18
lib/libc/rpc/rpc_soc.c: revision 1.18
lib/libc/rpc/svc_vc.c: revision 1.30
lib/libc/rpc/getrpcent.c: revision 1.23
lib/libc/rpc/xdr_float.c: revision 1.38
lib/libc/rpc/rpcb_prot.c: revision 1.11
lib/libc/rpc/getrpcport.c: revision 1.18
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.
This fixes PR lib/45293 by Pedro Giffuni.
 1.35.6.3 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.35.6.2 30-Oct-2012  yamt sync with head
 1.35.6.1 17-Apr-2012  yamt sync with head
 1.37.2.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.37.2.1 23-Jun-2013  tls resync from head
 1.21 04-Jun-2019  hannken Move the basic part of XDR to common/include/rpc and common/lib/libc/rpc.

No functional change intended.
 1.20 04-Jun-2019  hannken 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.
 1.19 11-Mar-2013  tron branches: 1.19.30;
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.

This fixes PR lib/45293 by Pedro Giffuni.
 1.18 20-Mar-2012  matt branches: 1.18.2;
Use C89 definitions
Remove use of __P
 1.17 15-Oct-2006  christos branches: 1.17.42; 1.17.44;
fix incomplete initializers
 1.16 16-Mar-2003  christos Don't do:

if ((xdrp->x_handy -= need) < 0)
return FALSE;

because by repeatedly calling this we can cause overflow, and then overwrite
valid memory. Instead do:

if (xdrp->x_handy < need)
return FALSE;
xdrp->x_handy -= need;
 1.15 22-Jan-2000  mycroft branches: 1.15.4; 1.15.8;
Delint.
Remove trailing ; from uses of __weak_alias(). The macro inserts this if
needed.
 1.14 15-Nov-1998  christos delint
 1.13 26-Jul-1998  mycroft const poisoning.
 1.12 26-Jul-1998  mycroft constify some tables.
 1.11 13-Feb-1998  lukem * in get_myaddress(); always return sockaddr_in containing localhost:PMAP_PORT.
(as recommended in Weiste Venema's portmap5_beta distribution)
* deprecate register
* use memmove instead of bcopy
* KNF includes
* use err/warn() instead of perror/fprintf(stderr,)
* fix some typos
 1.10 12-Feb-1998  lukem revert; we can't break the existing ABI and API
 1.9 11-Feb-1998  lukem use u_int32_t instead of size_t...
 1.8 10-Feb-1998  lukem major cleanup (to sync with changes made in include/rpc/*.h):
* use int32_t, size_t, in_port_t instead of long, u_int, u_short as appropriate
* use uid_t and gid_t instead of int
* KNF, fix typos and spellos
* use const as appropriate
* deprecate register
* use memmove instead of bcopy
* use err/warn()
 1.7 21-Jul-1997  jtc If port provides __weak_alias(), provide an Standard C and POSIX pure
identifier namespace by renaming non standard functions and variables
such that they have a leading underscore. The library will use those
names internally. Weak aliases are used to provide the original names
to the API.

This is only the first part of this change. It is most of the functions
which are implemented in C for all NetBSD ports. Subsequent changes are
to add the same support to the remaining C files, to assembly files, and
to the automagically generated assembly source used for system calls.
When all of the above is done, ports with weak alias support should add
a definition for __weak_alias to <sys/cdefs.h>.
 1.6 13-Jul-1997  christos Fix RCSID's
Fix gcc warnings.
Add missing prototypes
 1.5 20-Dec-1996  cgd string.h for prototypes
 1.4 08-Feb-1996  mycroft branches: 1.4.2;
Make this work on machines that do not support unaligned memory access.
From der Mouse, PR 1116.
 1.3 25-Feb-1995  cgd save my sanity; stop using Id.
 1.2 04-Dec-1994  cgd be much more careful with types, and add prototype everything.
 1.1 07-Oct-1993  cgd move the rpc code into libc
 1.4.2.1 16-Sep-1996  jtc snapshot namespace cleanup: rpc & xdr
 1.15.8.1 21-Mar-2003  tron Pull up revision 1.16 (requested by david in ticket #1224):
Don't do:
if ((xdrp->x_handy -= need) < 0)
return FALSE;
because by repeatedly calling this we can cause overflow, and then
overwrite
valid memory. Instead do:
if (xdrp->x_handy < need)
return FALSE;
xdrp->x_handy -= need;
 1.15.4.1 27-Mar-2003  msaitoh Pull up revisions 1.16 (requested by David Maxwell in ticket #36):

Don't do:
if ((xdrp->x_handy -= need) < 0)
return FALSE;
because by repeatedly calling this we can cause overflow, and then
overwrite
valid memory. Instead do:
if (xdrp->x_handy < need)
return FALSE;
xdrp->x_handy -= need;
 1.17.44.1 14-Mar-2013  riz Pull up following revision(s) (requested by tron in ticket #843):
lib/libc/rpc/clnt_dg.c: revision 1.28
lib/libc/rpc/xdr_sizeof.c: revision 1.5
lib/libc/rpc/pmap_getport.c: revision 1.19
lib/libc/rpc/xdr_mem.c: revision 1.19
lib/libc/rpc/svc_run.c: revision 1.22
lib/libc/rpc/bindresvport.c: revision 1.25
lib/libc/rpc/svc_raw.c: revision 1.24
lib/libc/rpc/svc_dg.c: revision 1.17
lib/libc/rpc/getnetconfig.c: revision 1.21
lib/libc/rpc/auth_unix.c: revision 1.25
lib/libc/rpc/svc_auth.c: revision 1.17
lib/libc/rpc/clnt_vc.c: revision 1.21
lib/libc/rpc/svc_auth_unix.c: revision 1.21
lib/libc/rpc/rpcb_st_xdr.c: revision 1.10
lib/libc/rpc/pmap_getmaps.c: revision 1.18
lib/libc/rpc/getnetpath.c: revision 1.17
lib/libc/rpc/clnt_simple.c: revision 1.32
lib/libc/rpc/authunix_prot.c: revision 1.16
lib/libc/rpc/svc_dg.h: revision 1.2
lib/libc/rpc/svc_generic.c: revision 1.15
lib/libc/rpc/clnt_raw.c: revision 1.32
lib/libc/rpc/xdr_array.c: revision 1.19
lib/libc/rpc/pmap_prot.c: revision 1.12
lib/libc/rpc/clnt_bcast.c: revision 1.26
lib/libc/rpc/xdr_rec.c: revision 1.35
lib/libc/rpc/svc.c: revision 1.34
lib/libc/rpc/DISCLAIMER: revision 1.3
lib/libc/rpc/clnt_generic.c: revision 1.30
lib/libc/rpc/xdr.c: revision 1.33
lib/libc/rpc/auth_none.c: revision 1.16
lib/libc/rpc/pmap_rmt.c: revision 1.34
lib/libc/rpc/rpc_callmsg.c: revision 1.20
lib/libc/rpc/clnt_perror.c: revision 1.30
lib/libc/rpc/xdr_stdio.c: revision 1.19
lib/libc/rpc/rpc_commondata.c: revision 1.9
lib/libc/rpc/pmap_prot2.c: revision 1.17
lib/libc/rpc/pmap_clnt.c: revision 1.19
lib/libc/rpc/svc_simple.c: revision 1.33
lib/libc/rpc/rpcb_clnt.c: revision 1.29
lib/libc/rpc/rpc_prot.c: revision 1.21
lib/libc/rpc/rpc_dtablesize.c: revision 1.16
lib/libc/rpc/rpc_generic.c: revision 1.28
lib/libc/rpc/xdr_reference.c: revision 1.18
lib/libc/rpc/rpc_soc.c: revision 1.18
lib/libc/rpc/svc_vc.c: revision 1.30
lib/libc/rpc/getrpcent.c: revision 1.23
lib/libc/rpc/xdr_float.c: revision 1.38
lib/libc/rpc/rpcb_prot.c: revision 1.11
lib/libc/rpc/getrpcport.c: revision 1.18
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.
This fixes PR lib/45293 by Pedro Giffuni.
 1.17.42.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.17.42.1 17-Apr-2012  yamt sync with head
 1.18.2.1 23-Jun-2013  tls resync from head
 1.19.30.1 10-Jun-2019  christos Sync with HEAD
 1.41 22-Mar-2024  andvar Fix few typos in comments.
 1.40 23-Jan-2024  christos fix nested extern warnings
 1.39 16-Jun-2023  andvar fix typos in comments.
 1.38 21-Aug-2021  andvar fix mainly same typos as in my previous commit but outside sys/dev/dm.
 1.37 25-Jul-2018  kamil Avoid undefined behavior in the definition of LAST_FRAG in xdr_rec.c

Do not change the signedness bit with a left shift operation.
Switch to unsigned integer to prevent this in the LAST_FRAG symbol.

xdr_rec.c:559:39, left shift of 1 by 31 places cannot be represented in type 'int'
xdr_rec.c:572:26, left shift of 1 by 31 places cannot be represented in type 'int'
xdr_rec.c:573:25, left shift of 1 by 31 places cannot be represented in type 'int'
xdr_rec.c:632:37, left shift of 1 by 31 places cannot be represented in type 'int'
xdr_rec.c:711:32, left shift of 1 by 31 places cannot be represented in type 'int'
xdr_rec.c:722:28, left shift of 1 by 31 places cannot be represented in type 'int'

Detected with micro-UBSan in the user mode.
 1.36 26-Mar-2015  justin branches: 1.36.14; 1.36.16;
Fix definitions to match headers
 1.35 11-Mar-2013  tron Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.

This fixes PR lib/45293 by Pedro Giffuni.
 1.34 04-Mar-2013  christos fix error messages and warnings.
 1.33 20-Mar-2012  matt branches: 1.33.2;
Use C89 definitions
Remove use of __P
 1.32 13-Mar-2012  christos PR/45989: Martin Husemann: lint invocation does include -w only on i386

- turn lint -w for all the platforms after fixing the lint warnings.
- add _DIAGASSERTS() for casts that would assign values to types that
would not fit.
- change types, add casts
- change into ansii prototypes
- turn on _DIAGNOSTIC for libc (during current, to be eliminated for release
builds)

approved by core@
 1.31 23-Nov-2010  christos branches: 1.31.6; 1.31.8;
PR/44132: Wolfgang Stukenbrock: libc/rpc may overwrite not-allocated memory
Return XPRT_DIED when realloc fails for lack of a better error.
 1.30 12-Feb-2009  lukem sign-compare fixes
 1.29 17-Aug-2008  rtr branches: 1.29.4; 1.29.6; 1.29.8;
revert previous
 1.28 17-Aug-2008  rtr fix comment iff -> if
 1.27 15-Oct-2006  christos fix incomplete initializers
 1.26 19-Jan-2006  christos PR/32572: John Kohl: xdr_rec.c missing a bugfix for an improper security check
The correct way to check for a zero record length is to check for it
without the LAST_FRAG marker in it, since it's legal to send a LAST_FRAG
marker with 0 bytes of data.
[This should be pulled up to 3.0]
 1.25 09-Jun-2005  yamt use malloc rather than mem_alloc (which is implemented using calloc)
for receive/send buffers to avoid unnecessarily anonymous memory bloat.
 1.24 03-Oct-2003  christos branches: 1.24.6;
PR/20768: Martin Blapp: Remove special handling for non-blocking connections
that breaks amd clients.
 1.23 19-May-2003  fvdl Back out previous for now. I already suspected part of it was wrong,
and there has been one report of problems in the mean time.
 1.22 18-May-2003  christos From Martin Blapp mb at imp dot ch, should fix PR/20768

Remove the special treatment off non-blocking mode in
xdrrec_eof(). This change broke seriously reading serialized
xdr-records. A end of a request could sometimes not
be recognized and the socket got closed too early.

Initialize in_reclen and in_received in a second case
if we get more outstanding records.
 1.21 27-Jan-2003  fvdl Reset in_reclen and in_received after having received a full record in
the nonblocking case.
 1.20 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.19 08-Nov-2002  fvdl * Adapt include files for rpc_com.h/rpc_internal.h split.
* Add rpc_control to svc.c
* Implement non-blocking connections.
 1.18 06-Jul-2000  christos branches: 1.18.2; 1.18.4;
add __RPC_GETXID macro
don't const castway __rpc_getconf and __rpc_getconfig. It might try to
write const strings
fix non-portable casts
remove duplicated prototypes
cast things to proper types
remove extraneous casts to NULL
fix variable cast mismatches
remove register var declarations
 1.17 22-Jan-2000  mycroft Delint.
Remove trailing ; from uses of __weak_alias(). The macro inserts this if
needed.
 1.16 04-Mar-1999  lukem avoid possible denial of service attack. from freebsd
 1.15 15-Nov-1998  christos delint
 1.14 26-Jul-1998  mycroft const poisoning.
 1.13 26-Jul-1998  mycroft constify some tables.
 1.12 13-Feb-1998  lukem * in get_myaddress(); always return sockaddr_in containing localhost:PMAP_PORT.
(as recommended in Weiste Venema's portmap5_beta distribution)
* deprecate register
* use memmove instead of bcopy
* KNF includes
* use err/warn() instead of perror/fprintf(stderr,)
* fix some typos
 1.11 12-Feb-1998  lukem revert; we can't break the existing ABI and API
 1.10 11-Feb-1998  lukem use u_int32_t instead of size_t...
 1.9 10-Feb-1998  lukem major cleanup (to sync with changes made in include/rpc/*.h):
* use int32_t, size_t, in_port_t instead of long, u_int, u_short as appropriate
* use uid_t and gid_t instead of int
* KNF, fix typos and spellos
* use const as appropriate
* deprecate register
* use memmove instead of bcopy
* use err/warn()
 1.8 21-Jul-1997  jtc If port provides __weak_alias(), provide an Standard C and POSIX pure
identifier namespace by renaming non standard functions and variables
such that they have a leading underscore. The library will use those
names internally. Weak aliases are used to provide the original names
to the API.

This is only the first part of this change. It is most of the functions
which are implemented in C for all NetBSD ports. Subsequent changes are
to add the same support to the remaining C files, to assembly files, and
to the automagically generated assembly source used for system calls.
When all of the above is done, ports with weak alias support should add
a definition for __weak_alias to <sys/cdefs.h>.
 1.7 13-Jul-1997  christos Fix RCSID's
Fix gcc warnings.
Add missing prototypes
 1.6 20-Dec-1996  cgd string.h for prototypes, replace K&R declarations with __P protos
 1.5 25-Feb-1995  cgd branches: 1.5.4;
save my sanity; stop using Id.
 1.4 04-Dec-1994  cgd branches: 1.4.2;
be much more careful with types, and add prototype everything.
 1.3 01-Apr-1994  cgd bad cast
 1.2 28-Mar-1994  cgd don't redefine lseek. just ... DON'T DO IT!
 1.1 07-Oct-1993  cgd move the rpc code into libc
 1.4.2.1 02-May-1995  jtc #include "namespace.h"
 1.5.4.1 16-Sep-1996  jtc snapshot namespace cleanup: rpc & xdr
 1.18.4.2 28-Jan-2003  jmc Pullup revisions 1.20-1.21 (requested by fvdl in ticket #1127)
Reset in_reclen and in_received after having received a full record
in the nonblocking case.
 1.18.4.1 06-Jan-2003  jmc Pull up revisions 1.18-1.19 (requested by fvdl in ticket #1037)
* Adapt include files for rpc_com.h/rpc_internal.h split.
* Implement non-blocking connections.
* Add rpc_control to svc.c
 1.18.2.1 11-Nov-2002  nathanw Catch up to -current
 1.24.6.2 26-Jan-2006  jdc Pull up revision 1.26 (requested by christos in ticket #1128).

PR/32572: John Kohl: xdr_rec.c missing a bugfix for an improper security check
The correct way to check for a zero record length is to check for it
without the LAST_FRAG marker in it, since it's legal to send a LAST_FRAG
marker with 0 bytes of data.
 1.24.6.1 21-Nov-2005  tron branches: 1.24.6.1.2;
Pull up following revision(s) (requested by chs in ticket #964):
lib/libc/rpc/svc_dg.c: revision 1.11
lib/libc/rpc/clnt_dg.c: revision 1.15
lib/libc/rpc/svc_raw.c: revision 1.18
lib/libc/rpc/xdr_rec.c: revision 1.25
lib/libc/rpc/clnt_raw.c: revision 1.26
use malloc rather than mem_alloc (which is implemented using calloc)
for receive/send buffers to avoid unnecessarily anonymous memory bloat.
 1.24.6.1.2.1 26-Jan-2006  jdc Pull up revision 1.26 (requested by christos in ticket #1128).

PR/32572: John Kohl: xdr_rec.c missing a bugfix for an improper security check
The correct way to check for a zero record length is to check for it
without the LAST_FRAG marker in it, since it's legal to send a LAST_FRAG
marker with 0 bytes of data.
 1.29.8.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.29.6.2 17-Aug-2008  rtr revert previous
 1.29.6.1 17-Aug-2008  rtr file xdr_rec.c was added on branch christos-time_t on 2008-08-17 10:50:51 +0000
 1.29.4.1 09-Dec-2010  riz Pull up following revision(s) (requested by dholland in ticket #1493):
lib/libc/rpc/xdr_rec.c: revision 1.31
PR/44132: Wolfgang Stukenbrock: libc/rpc may overwrite not-allocated memory
Return XPRT_DIED when realloc fails for lack of a better error.
 1.31.8.1 14-Mar-2013  riz Pull up following revision(s) (requested by tron in ticket #843):
lib/libc/rpc/clnt_dg.c: revision 1.28
lib/libc/rpc/xdr_sizeof.c: revision 1.5
lib/libc/rpc/pmap_getport.c: revision 1.19
lib/libc/rpc/xdr_mem.c: revision 1.19
lib/libc/rpc/svc_run.c: revision 1.22
lib/libc/rpc/bindresvport.c: revision 1.25
lib/libc/rpc/svc_raw.c: revision 1.24
lib/libc/rpc/svc_dg.c: revision 1.17
lib/libc/rpc/getnetconfig.c: revision 1.21
lib/libc/rpc/auth_unix.c: revision 1.25
lib/libc/rpc/svc_auth.c: revision 1.17
lib/libc/rpc/clnt_vc.c: revision 1.21
lib/libc/rpc/svc_auth_unix.c: revision 1.21
lib/libc/rpc/rpcb_st_xdr.c: revision 1.10
lib/libc/rpc/pmap_getmaps.c: revision 1.18
lib/libc/rpc/getnetpath.c: revision 1.17
lib/libc/rpc/clnt_simple.c: revision 1.32
lib/libc/rpc/authunix_prot.c: revision 1.16
lib/libc/rpc/svc_dg.h: revision 1.2
lib/libc/rpc/svc_generic.c: revision 1.15
lib/libc/rpc/clnt_raw.c: revision 1.32
lib/libc/rpc/xdr_array.c: revision 1.19
lib/libc/rpc/pmap_prot.c: revision 1.12
lib/libc/rpc/clnt_bcast.c: revision 1.26
lib/libc/rpc/xdr_rec.c: revision 1.35
lib/libc/rpc/svc.c: revision 1.34
lib/libc/rpc/DISCLAIMER: revision 1.3
lib/libc/rpc/clnt_generic.c: revision 1.30
lib/libc/rpc/xdr.c: revision 1.33
lib/libc/rpc/auth_none.c: revision 1.16
lib/libc/rpc/pmap_rmt.c: revision 1.34
lib/libc/rpc/rpc_callmsg.c: revision 1.20
lib/libc/rpc/clnt_perror.c: revision 1.30
lib/libc/rpc/xdr_stdio.c: revision 1.19
lib/libc/rpc/rpc_commondata.c: revision 1.9
lib/libc/rpc/pmap_prot2.c: revision 1.17
lib/libc/rpc/pmap_clnt.c: revision 1.19
lib/libc/rpc/svc_simple.c: revision 1.33
lib/libc/rpc/rpcb_clnt.c: revision 1.29
lib/libc/rpc/rpc_prot.c: revision 1.21
lib/libc/rpc/rpc_dtablesize.c: revision 1.16
lib/libc/rpc/rpc_generic.c: revision 1.28
lib/libc/rpc/xdr_reference.c: revision 1.18
lib/libc/rpc/rpc_soc.c: revision 1.18
lib/libc/rpc/svc_vc.c: revision 1.30
lib/libc/rpc/getrpcent.c: revision 1.23
lib/libc/rpc/xdr_float.c: revision 1.38
lib/libc/rpc/rpcb_prot.c: revision 1.11
lib/libc/rpc/getrpcport.c: revision 1.18
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.
This fixes PR lib/45293 by Pedro Giffuni.
 1.31.6.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.31.6.1 17-Apr-2012  yamt sync with head
 1.33.2.1 23-Jun-2013  tls resync from head
 1.36.16.1 10-Jun-2019  christos Sync with HEAD
 1.36.14.1 28-Jul-2018  pgoyette Sync with HEAD
 1.19 13-Feb-2022  andvar fix few typos in comments and log message.
 1.18 11-Mar-2013  tron Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.

This fixes PR lib/45293 by Pedro Giffuni.
 1.17 04-Mar-2013  christos fix error messages and warnings.
 1.16 25-Jun-2012  abs branches: 1.16.2;
Update old-style definitions to ANSI, remove a couple of register
definitions along the way. Fixed gcc 4.1 build (thank you vax)
 1.15 25-Apr-2008  christos branches: 1.15.4; 1.15.8; 1.15.24;
- always check malloc results
- don't leak fds on error
- don't cast malloc
- don't cast NULL
 1.14 05-Aug-2005  wiz branches: 1.14.18;
espie@openbsd:
impelmentation -> implementation

yes, new typo for an old friend.
 1.13 22-Jan-2000  mycroft Delint.
Remove trailing ; from uses of __weak_alias(). The macro inserts this if
needed.
 1.12 15-Nov-1998  christos delint
 1.11 13-Feb-1998  lukem * in get_myaddress(); always return sockaddr_in containing localhost:PMAP_PORT.
(as recommended in Weiste Venema's portmap5_beta distribution)
* deprecate register
* use memmove instead of bcopy
* KNF includes
* use err/warn() instead of perror/fprintf(stderr,)
* fix some typos
 1.10 12-Feb-1998  lukem revert; we can't break the existing ABI and API
 1.9 11-Feb-1998  lukem use u_int32_t instead of size_t...
 1.8 10-Feb-1998  lukem major cleanup (to sync with changes made in include/rpc/*.h):
* use int32_t, size_t, in_port_t instead of long, u_int, u_short as appropriate
* use uid_t and gid_t instead of int
* KNF, fix typos and spellos
* use const as appropriate
* deprecate register
* use memmove instead of bcopy
* use err/warn()
 1.7 21-Jul-1997  jtc If port provides __weak_alias(), provide an Standard C and POSIX pure
identifier namespace by renaming non standard functions and variables
such that they have a leading underscore. The library will use those
names internally. Weak aliases are used to provide the original names
to the API.

This is only the first part of this change. It is most of the functions
which are implemented in C for all NetBSD ports. Subsequent changes are
to add the same support to the remaining C files, to assembly files, and
to the automagically generated assembly source used for system calls.
When all of the above is done, ports with weak alias support should add
a definition for __weak_alias to <sys/cdefs.h>.
 1.6 13-Jul-1997  christos Fix RCSID's
Fix gcc warnings.
Add missing prototypes
 1.5 14-Apr-1995  jtc branches: 1.5.4;
Don't pass a third argument (LASTUNSIGNED) to xdrproc_t functions ---
they only take two arguments. Presumably this was done to prevent
problems when users passed xdr_string instead of xdr_wrapstring.
Function prototypes are a better way to fix this "problem".
 1.4 14-Apr-1995  jtc Changed bzero to memset.
Changed bcmp to memcmp.
Added #include <string.h> to bring prototypes into scope.
 1.3 25-Feb-1995  cgd save my sanity; stop using Id.
 1.2 04-Dec-1994  cgd be much more careful with types, and add prototype everything.
 1.1 07-Oct-1993  cgd move the rpc code into libc
 1.5.4.1 16-Sep-1996  jtc snapshot namespace cleanup: rpc & xdr
 1.14.18.1 18-May-2008  yamt sync with head.
 1.15.24.1 14-Mar-2013  riz Pull up following revision(s) (requested by tron in ticket #843):
lib/libc/rpc/clnt_dg.c: revision 1.28
lib/libc/rpc/xdr_sizeof.c: revision 1.5
lib/libc/rpc/pmap_getport.c: revision 1.19
lib/libc/rpc/xdr_mem.c: revision 1.19
lib/libc/rpc/svc_run.c: revision 1.22
lib/libc/rpc/bindresvport.c: revision 1.25
lib/libc/rpc/svc_raw.c: revision 1.24
lib/libc/rpc/svc_dg.c: revision 1.17
lib/libc/rpc/getnetconfig.c: revision 1.21
lib/libc/rpc/auth_unix.c: revision 1.25
lib/libc/rpc/svc_auth.c: revision 1.17
lib/libc/rpc/clnt_vc.c: revision 1.21
lib/libc/rpc/svc_auth_unix.c: revision 1.21
lib/libc/rpc/rpcb_st_xdr.c: revision 1.10
lib/libc/rpc/pmap_getmaps.c: revision 1.18
lib/libc/rpc/getnetpath.c: revision 1.17
lib/libc/rpc/clnt_simple.c: revision 1.32
lib/libc/rpc/authunix_prot.c: revision 1.16
lib/libc/rpc/svc_dg.h: revision 1.2
lib/libc/rpc/svc_generic.c: revision 1.15
lib/libc/rpc/clnt_raw.c: revision 1.32
lib/libc/rpc/xdr_array.c: revision 1.19
lib/libc/rpc/pmap_prot.c: revision 1.12
lib/libc/rpc/clnt_bcast.c: revision 1.26
lib/libc/rpc/xdr_rec.c: revision 1.35
lib/libc/rpc/svc.c: revision 1.34
lib/libc/rpc/DISCLAIMER: revision 1.3
lib/libc/rpc/clnt_generic.c: revision 1.30
lib/libc/rpc/xdr.c: revision 1.33
lib/libc/rpc/auth_none.c: revision 1.16
lib/libc/rpc/pmap_rmt.c: revision 1.34
lib/libc/rpc/rpc_callmsg.c: revision 1.20
lib/libc/rpc/clnt_perror.c: revision 1.30
lib/libc/rpc/xdr_stdio.c: revision 1.19
lib/libc/rpc/rpc_commondata.c: revision 1.9
lib/libc/rpc/pmap_prot2.c: revision 1.17
lib/libc/rpc/pmap_clnt.c: revision 1.19
lib/libc/rpc/svc_simple.c: revision 1.33
lib/libc/rpc/rpcb_clnt.c: revision 1.29
lib/libc/rpc/rpc_prot.c: revision 1.21
lib/libc/rpc/rpc_dtablesize.c: revision 1.16
lib/libc/rpc/rpc_generic.c: revision 1.28
lib/libc/rpc/xdr_reference.c: revision 1.18
lib/libc/rpc/rpc_soc.c: revision 1.18
lib/libc/rpc/svc_vc.c: revision 1.30
lib/libc/rpc/getrpcent.c: revision 1.23
lib/libc/rpc/xdr_float.c: revision 1.38
lib/libc/rpc/rpcb_prot.c: revision 1.11
lib/libc/rpc/getrpcport.c: revision 1.18
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.
This fixes PR lib/45293 by Pedro Giffuni.
 1.15.8.2 25-Apr-2008  christos - always check malloc results
- don't leak fds on error
- don't cast malloc
- don't cast NULL
 1.15.8.1 25-Apr-2008  christos file xdr_reference.c was added on branch christos-time_t on 2008-04-25 17:44:45 +0000
 1.15.4.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.15.4.1 30-Oct-2012  yamt sync with head
 1.16.2.1 23-Jun-2013  tls resync from head
 1.5 11-Mar-2013  tron Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.

This fixes PR lib/45293 by Pedro Giffuni.
 1.4 20-Mar-2012  matt branches: 1.4.2;
Use C89 definitions
Remove use of __P
 1.3 02-Jan-2012  dholland branches: 1.3.2;
Remove unnecessary cast to caddr_t.
 1.2 04-Jul-2011  mrg branches: 1.2.2;
insert some (uintptr_t) between int and pointer casts.
 1.1 04-Jul-2011  manu Import xdr_sizeof() from FreeBSD
 1.2.2.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.2.2.1 17-Apr-2012  yamt sync with head
 1.3.2.1 14-Mar-2013  riz Pull up following revision(s) (requested by tron in ticket #843):
lib/libc/rpc/clnt_dg.c: revision 1.28
lib/libc/rpc/xdr_sizeof.c: revision 1.5
lib/libc/rpc/pmap_getport.c: revision 1.19
lib/libc/rpc/xdr_mem.c: revision 1.19
lib/libc/rpc/svc_run.c: revision 1.22
lib/libc/rpc/bindresvport.c: revision 1.25
lib/libc/rpc/svc_raw.c: revision 1.24
lib/libc/rpc/svc_dg.c: revision 1.17
lib/libc/rpc/getnetconfig.c: revision 1.21
lib/libc/rpc/auth_unix.c: revision 1.25
lib/libc/rpc/svc_auth.c: revision 1.17
lib/libc/rpc/clnt_vc.c: revision 1.21
lib/libc/rpc/svc_auth_unix.c: revision 1.21
lib/libc/rpc/rpcb_st_xdr.c: revision 1.10
lib/libc/rpc/pmap_getmaps.c: revision 1.18
lib/libc/rpc/getnetpath.c: revision 1.17
lib/libc/rpc/clnt_simple.c: revision 1.32
lib/libc/rpc/authunix_prot.c: revision 1.16
lib/libc/rpc/svc_dg.h: revision 1.2
lib/libc/rpc/svc_generic.c: revision 1.15
lib/libc/rpc/clnt_raw.c: revision 1.32
lib/libc/rpc/xdr_array.c: revision 1.19
lib/libc/rpc/pmap_prot.c: revision 1.12
lib/libc/rpc/clnt_bcast.c: revision 1.26
lib/libc/rpc/xdr_rec.c: revision 1.35
lib/libc/rpc/svc.c: revision 1.34
lib/libc/rpc/DISCLAIMER: revision 1.3
lib/libc/rpc/clnt_generic.c: revision 1.30
lib/libc/rpc/xdr.c: revision 1.33
lib/libc/rpc/auth_none.c: revision 1.16
lib/libc/rpc/pmap_rmt.c: revision 1.34
lib/libc/rpc/rpc_callmsg.c: revision 1.20
lib/libc/rpc/clnt_perror.c: revision 1.30
lib/libc/rpc/xdr_stdio.c: revision 1.19
lib/libc/rpc/rpc_commondata.c: revision 1.9
lib/libc/rpc/pmap_prot2.c: revision 1.17
lib/libc/rpc/pmap_clnt.c: revision 1.19
lib/libc/rpc/svc_simple.c: revision 1.33
lib/libc/rpc/rpcb_clnt.c: revision 1.29
lib/libc/rpc/rpc_prot.c: revision 1.21
lib/libc/rpc/rpc_dtablesize.c: revision 1.16
lib/libc/rpc/rpc_generic.c: revision 1.28
lib/libc/rpc/xdr_reference.c: revision 1.18
lib/libc/rpc/rpc_soc.c: revision 1.18
lib/libc/rpc/svc_vc.c: revision 1.30
lib/libc/rpc/getrpcent.c: revision 1.23
lib/libc/rpc/xdr_float.c: revision 1.38
lib/libc/rpc/rpcb_prot.c: revision 1.11
lib/libc/rpc/getrpcport.c: revision 1.18
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.
This fixes PR lib/45293 by Pedro Giffuni.
 1.4.2.1 23-Jun-2013  tls resync from head
 1.19 11-Mar-2013  tron Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.

This fixes PR lib/45293 by Pedro Giffuni.
 1.18 20-Mar-2012  matt branches: 1.18.2;
Use C89 definitions
Remove use of __P
 1.17 15-Oct-2006  christos branches: 1.17.42; 1.17.44;
fix incomplete initializers
 1.16 03-Jan-2004  martin Fix a cast for little endian archs
 1.15 03-Jan-2004  martin When writing/reading longs use explicit 32bit temporary values (this is
what "long" means in xdr context).
Fixes PR lib/23960.
 1.14 22-Jan-2000  mycroft Delint.
Remove trailing ; from uses of __weak_alias(). The macro inserts this if
needed.
 1.13 25-Mar-1999  lukem * don't close the socket unless it was opened by the function
* note (in the comments) that the client is responsible for closing
the socket if they opened it, or they didn't use CLNT_DESTROY()

fixes a couple of unnecessary closing of already-closed sockets.
noted by: Matthias Drochner <M.Drochner@fz-juelich.de>
 1.12 15-Nov-1998  christos delint
 1.11 26-Jul-1998  mycroft const poisoning.
 1.10 26-Jul-1998  mycroft constify some tables.
 1.9 13-Feb-1998  lukem * in get_myaddress(); always return sockaddr_in containing localhost:PMAP_PORT.
(as recommended in Weiste Venema's portmap5_beta distribution)
* deprecate register
* use memmove instead of bcopy
* KNF includes
* use err/warn() instead of perror/fprintf(stderr,)
* fix some typos
 1.8 12-Feb-1998  lukem revert; we can't break the existing ABI and API
 1.7 11-Feb-1998  lukem use u_int32_t instead of size_t...
 1.6 10-Feb-1998  lukem major cleanup (to sync with changes made in include/rpc/*.h):
* use int32_t, size_t, in_port_t instead of long, u_int, u_short as appropriate
* use uid_t and gid_t instead of int
* KNF, fix typos and spellos
* use const as appropriate
* deprecate register
* use memmove instead of bcopy
* use err/warn()
 1.5 21-Jul-1997  jtc If port provides __weak_alias(), provide an Standard C and POSIX pure
identifier namespace by renaming non standard functions and variables
such that they have a leading underscore. The library will use those
names internally. Weak aliases are used to provide the original names
to the API.

This is only the first part of this change. It is most of the functions
which are implemented in C for all NetBSD ports. Subsequent changes are
to add the same support to the remaining C files, to assembly files, and
to the automagically generated assembly source used for system calls.
When all of the above is done, ports with weak alias support should add
a definition for __weak_alias to <sys/cdefs.h>.
 1.4 13-Jul-1997  christos Fix RCSID's
Fix gcc warnings.
Add missing prototypes
 1.3 25-Feb-1995  cgd branches: 1.3.4;
save my sanity; stop using Id.
 1.2 04-Dec-1994  cgd be much more careful with types, and add prototype everything.
 1.1 07-Oct-1993  cgd move the rpc code into libc
 1.3.4.1 16-Sep-1996  jtc snapshot namespace cleanup: rpc & xdr
 1.17.44.1 14-Mar-2013  riz Pull up following revision(s) (requested by tron in ticket #843):
lib/libc/rpc/clnt_dg.c: revision 1.28
lib/libc/rpc/xdr_sizeof.c: revision 1.5
lib/libc/rpc/pmap_getport.c: revision 1.19
lib/libc/rpc/xdr_mem.c: revision 1.19
lib/libc/rpc/svc_run.c: revision 1.22
lib/libc/rpc/bindresvport.c: revision 1.25
lib/libc/rpc/svc_raw.c: revision 1.24
lib/libc/rpc/svc_dg.c: revision 1.17
lib/libc/rpc/getnetconfig.c: revision 1.21
lib/libc/rpc/auth_unix.c: revision 1.25
lib/libc/rpc/svc_auth.c: revision 1.17
lib/libc/rpc/clnt_vc.c: revision 1.21
lib/libc/rpc/svc_auth_unix.c: revision 1.21
lib/libc/rpc/rpcb_st_xdr.c: revision 1.10
lib/libc/rpc/pmap_getmaps.c: revision 1.18
lib/libc/rpc/getnetpath.c: revision 1.17
lib/libc/rpc/clnt_simple.c: revision 1.32
lib/libc/rpc/authunix_prot.c: revision 1.16
lib/libc/rpc/svc_dg.h: revision 1.2
lib/libc/rpc/svc_generic.c: revision 1.15
lib/libc/rpc/clnt_raw.c: revision 1.32
lib/libc/rpc/xdr_array.c: revision 1.19
lib/libc/rpc/pmap_prot.c: revision 1.12
lib/libc/rpc/clnt_bcast.c: revision 1.26
lib/libc/rpc/xdr_rec.c: revision 1.35
lib/libc/rpc/svc.c: revision 1.34
lib/libc/rpc/DISCLAIMER: revision 1.3
lib/libc/rpc/clnt_generic.c: revision 1.30
lib/libc/rpc/xdr.c: revision 1.33
lib/libc/rpc/auth_none.c: revision 1.16
lib/libc/rpc/pmap_rmt.c: revision 1.34
lib/libc/rpc/rpc_callmsg.c: revision 1.20
lib/libc/rpc/clnt_perror.c: revision 1.30
lib/libc/rpc/xdr_stdio.c: revision 1.19
lib/libc/rpc/rpc_commondata.c: revision 1.9
lib/libc/rpc/pmap_prot2.c: revision 1.17
lib/libc/rpc/pmap_clnt.c: revision 1.19
lib/libc/rpc/svc_simple.c: revision 1.33
lib/libc/rpc/rpcb_clnt.c: revision 1.29
lib/libc/rpc/rpc_prot.c: revision 1.21
lib/libc/rpc/rpc_dtablesize.c: revision 1.16
lib/libc/rpc/rpc_generic.c: revision 1.28
lib/libc/rpc/xdr_reference.c: revision 1.18
lib/libc/rpc/rpc_soc.c: revision 1.18
lib/libc/rpc/svc_vc.c: revision 1.30
lib/libc/rpc/getrpcent.c: revision 1.23
lib/libc/rpc/xdr_float.c: revision 1.38
lib/libc/rpc/rpcb_prot.c: revision 1.11
lib/libc/rpc/getrpcport.c: revision 1.18
Replace previous Sun Microsystems, Inc. license with a standard
BSD 3-clause license granted by Oracle America, Inc..
This license change was approved by Wim Coekaerts, Senior Vice President,
Linux and Virtualization at Oracle Corporation.
This fixes PR lib/45293 by Pedro Giffuni.
 1.17.42.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.17.42.1 17-Apr-2012  yamt sync with head
 1.18.2.1 23-Jun-2013  tls resync from head

RSS XML Feed