rpcgen tries to generate more efficient code by using xdr_inline() when possible (see xdr_admin(3) manpage). When a structure contains elements that xdr_inline() can be used on (for example integer
, long
, bool
), the relevant portion of the structure is packed with xdr_inline(). A default of five or more packed elements in sequence causes in-line code to be generated. This default can be changed with the -i flag. For example:
rpcgen -i 3 test.x
causes rpcgen to start generating in-line code after three qualifying elements are found in sequence. The example:
rpcgen -i 0 test.x
prevents any in-line code from being generated.
In most situations, there is no reason to use the -i flag. The _xdr.c stub is the only file affected by this feature.