---
name: "cdb_seek"
section: "3"
platform: "linux"
package: "freecdb"
version: "0.62"
release: "Debian 3.1 (Sarge)"
platforms: ["linux"]
url: "https://new.carta.tech/cdb_seek"
---

# cdb\_seek(3)

## NAME

cdb\_seek -- search for a key in a constant database

## SYNOPSIS

**#include \<freecdb.h\>**

int **cdb\_seek**(int fd, char \**key*, unsigned int *len*, uint32 \*dlen);

## DESCRIPTION

**cdb\_seek** looks up the key *key* of length *len* from the constant database open on file descriptor *fd*.

On success, it seeks *fd* to the start of key value, and sets *dlen* to the value size.

## RETURN VALUE

1 on a match, 0 on a miss, -1 on error.

## RESTRICTIONS

There is no way to read multiple records with the same key.

Seeking modifes the location of the file descriptor. Don't try to do simultaneous searches.

Updates to the constant database will only be seen after a [close(2)](/close/2.md) and [open(2)](/open/2.md).

## SEE ALSO

[cdb\_hash(3)](/cdb_hash/3.md)
