---
name: "xdr_buf_subsegment"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/xdr_buf_subsegment"
---

# xdr\_buf\_subsegment(9)

set subbuf to a portion of buf

## NAME

xdr\_buf\_subsegment - set subbuf to a portion of buf

## SYNOPSIS

**int xdr\_buf\_subsegment(struct xdr\_buf \*** *buf***, struct xdr\_buf \*** *subbuf***, unsigned int** *base***, unsigned int** *len***);**

## ARGUMENTS

*buf*

an xdr buffer

*subbuf*

the result buffer

*base*

beginning of range in bytes

*len*

length of range in bytes

## DESCRIPTION

sets *subbuf* to an xdr buffer representing the portion of *buf* of length *len* starting at offset *base*.

*buf* and *subbuf* may be pointers to the same struct xdr\_buf.

Returns -1 if base of length are out of bounds.

## COPYRIGHT
