---
title: acltdtGetBufDataLen
description: "获取共享Buffer中有效数据的长度。同步接口。"
url: https://www.hiascend.com/document/detail/zh/Atlas200IDKA2DeveloperKit/latest/Application%20Development%20Guide/aadgc/aclcppdevg_03_1646.html
sourcePath: /source/zh/Atlas200IDKA2DeveloperKit/23.0.RC2/Application Development Guide/aadgc/aclcppdevg_03_1646.html
indexId: d4ad4465593708436e1f259bea2d961013ffde0933b9c0661459596c702da9fa105
---
# acltdtGetBufDataLen

获取共享Buffer中有效数据的长度。同步接口。


#### 约束说明

通过acltdtSetBufDataLen接口设置共享Buffer中有效数据的长度后，可调用本接口获取有效数据的长度，否则，通过本接口获取到的长度为0。

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


#### 函数原型

aclError acltdtGetBufDataLen(const acltdtBuf buf, size_t *len)


#### 参数说明

| 参数名 | 输入/输出 | 说明 |
| --- | --- | --- |
| buf | 输入 | 共享Buffer指针，须通过acltdtAllocBuf或acltdtCopyBufRef接口申请获得。 |
| len | 输出 | 有效数据的长度，单位为Byte。 |


#### 返回值说明

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