---
title: 消息接收接口
description: "| 函数原型 | int wd\_recv(struct wd\_queue \*q, void \*\*resp); |"
url: https://www.hikunpeng.com/document/detail/zh/kunpengboostkithistory/252RC1/accel/kunpengaccel_17_0034.html
sourcePath: /source/zh/kunpengboostkithistory/252RC1/accel/kunpengaccel_17_0034.html
indexId: b226652f623dc673cf828a6827a093f22071b0413ab0f13a1a60b24aa582927c72
---
# 消息接收接口

| 函数原型 | int wd\_recv(struct wd\_queue \*q, void \*\*resp); |
| --- | --- |
| 函数功能 | 从队列q接收加速器硬件回应消息 |
| 输入说明 | q：队列 resp:回应消息（单队列多用户情况下需要由resp带入发送时user\_data相关的struct wcrypto\_tag中的ctx\_id（非0）作为标识，保证收到的回应消息是属于自己的。） |
| 输出说明 | resp：硬件回应消息，与vendor相关。 |
| 返回值说明 | 1：收到一条回应消息 0：没有收到任何消息 其他负值：接收动作失败，且没有收到消息（错误码含义请参考WD消息错误码接口定义） |
| 使用说明 | 同一个算法句柄q的接收操作不支持多线程互斥操作 |
| 注意事项 | 用户如果使用算法层接口，则不需要使用此基础接口 |
