---
name: "cdb_read"
section: "3"
platform: "linux"
package: "libowfat-dev"
version: "0.32-5"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/cdb_read"
---

# cdb\_read(3)

read bytes from a constant database

## NAME

cdb\_read - read bytes from a constant database

## SYNTAX

**#include \<libowfat/cdb.h\>**\
 **#include \<libowfat/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)
