---
title: acltdtGetBufFromChain
description: 获取Mbuf链中第index个Mbuf。同步接口。
url: "https://www.hiascend.com/document/detail/zh/Atlas200IDKA2DeveloperKit/23.0.RC2/Application%20Development%20Guide/aadgc/aclcppdevg_03_1650.html"
---

# acltdtGetBufFromChain

获取Mbuf链中第index个Mbuf。同步接口。


#### 约束说明

仅支持在Control CPU开放形态或RC模式下使用该接口。


#### 函数原型

aclError acltdtGetBufFromChain (const acltdtBuf headBuf, uint32_t index, acltdtBuf* buf)


#### 参数说明

| 参数名 | 输入/输出 | 说明 |
| --- | --- | --- |
| headBuf | 输入 | 共享Buffer链头部的第一个共享Buffer的指针，须通过acltdtAllocBuf或acltdtCopyBufRef接口申请获得。 |
| index | 输入 | 共享Buffer链中的共享Buffer序号（从0开始计数）。 |
| buf | 输出 | 返回第index个共享Buffer指针。 |


#### 返回值说明

返回0表示成功，返回其它值表示失败。
