'\" t .\" Title: xdr_truncate_encode .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: April 2019 .\" Manual: Linux Networking .\" Source: Kernel Hackers Manual 4.9.168 .\" Language: English .\" .TH "XDR_TRUNCATE_ENCODE" "9" "April 2019" "Kernel Hackers Manual 4\&.9\&." "Linux Networking" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" xdr_truncate_encode \- truncate an encode buffer .SH "SYNOPSIS" .HP \w'void\ xdr_truncate_encode('u .BI "void xdr_truncate_encode(struct\ xdr_stream\ *\ " "xdr" ", size_t\ " "len" ");" .SH "ARGUMENTS" .PP \fIxdr\fR .RS 4 pointer to xdr_stream .RE .PP \fIlen\fR .RS 4 new length of buffer .RE .SH "DESCRIPTION" .PP Truncates the xdr stream, so that xdr\->buf\->len == len, and xdr\->p points at offset len from the start of the buffer, and head, tail, and page lengths are adjusted to correspond\&. .PP If this means moving xdr\->p to a different buffer, we assume that that the end pointer should be set to the end of the current page, except in the case of the head buffer when we assume the head buffer\*(Aqs current length represents the end of the available buffer\&. .PP This is *not* safe to use on a buffer that already has inlined page cache pages (as in a zero\-copy server read reply), except for the simple case of truncating from one position in the tail to another\&. .SH "COPYRIGHT" .br