---
name: "cdb_read"
section: "3diet"
platform: "linux"
package: "libowfat-dev"
version: "0.28-2"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/cdb_read/3diet"
---

# cdb\_read(3diet)

read bytes from a constant database

## NAME

cdb\_read - read bytes from a constant database

## SYNTAX

**#include \<cdb.h\>**\
 **#include \<uint32.h\>**

int cdb\_read(struct cdb \**c*,char \**buf*,unsigned long int *len*,uint32 *position*);

## DESCRIPTION

**cdb\_read** reads *len* bytes starting at *position* from *c* to buf.  You can use cdb\_datapos or cdb\_keypos to get *position* and cdb\_datalen and cdb\_keylen to get *len*.

*buf* needs to point to a memory region large enough to hold *len* bytes.

## RETURN VALUE

**cdb\_read** returns 0 if everything went well, or -1 on error (setting *errno* appropriately.

## SEE ALSO

[cdb\_find(3)](/cdb_find/3.md), [cdb\_init(3)](/cdb_init/3.md), [cdb\_free(3)](/cdb_free/3.md), [cdbmake(1)](/cdbmake/1.md)
