---
name: "qb_rb_chunk_peek"
section: "3"
platform: "linux"
package: "libqb"
version: "2.0.10-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/qb_rb_chunk_peek"
---

# qb\_rb\_chunk\_peek(3)

Read (without reclaiming) the last chunk.

## NAME

qb\_rb\_chunk\_peek - Read (without reclaiming) the last chunk.

## SYNOPSIS

```
#include <qb/qbrb.h>

ssize_t qb_rb_chunk_peek(
    qb_ringbuffer_t   *rb,          /* ringbuffer instance */
    /*
     * (out) a pointer to the next chunk to read (not copied).
     */
    void             **data_out,
    int32_t            ms_timeout   /* (in) time to wait for new data.*/
);
```

## PARAMS

**rb**         *ringbuffer instance*

**data\_out**   *(out) a pointer to the next chunk to read (not copied).*

**ms\_timeout** *(in) time to wait for new data.*

## DESCRIPTION

This function is a way of accessing the next chunk without a memcpy(). You can read the chunk data in place.

## RETURN VALUE

the size of the chunk (0 if buffer empty).

## NOTE

This function will not "pop" the chunk, you will need to call *qb\_rb\_chunk\_reclaim()*.

## SEE ALSO

[*qb\_rb\_close*(3)](/qb_rb_close/3.md), [*qb\_rb\_refcount\_get*(3)](/qb_rb_refcount_get/3.md), [*qb\_rb\_chmod*(3)](/qb_rb_chmod/3.md), [*qb\_rb\_chown*(3)](/qb_rb_chown/3.md), [*qb\_rb\_open*(3)](/qb_rb_open/3.md), [*qb\_rb\_write\_to\_file*(3)](/qb_rb_write_to_file/3.md), [*qb\_rb\_create\_from\_file*(3)](/qb_rb_create_from_file/3.md), [*qb\_rb\_chunks\_used*(3)](/qb_rb_chunks_used/3.md), [*qb\_rb\_chunk\_reclaim*(3)](/qb_rb_chunk_reclaim/3.md), [*qb\_rb\_space\_used*(3)](/qb_rb_space_used/3.md), [*qb\_rb\_chunk\_write*(3)](/qb_rb_chunk_write/3.md), [*qb\_rb\_shared\_user\_data\_get*(3)](/qb_rb_shared_user_data_get/3.md), [*qb\_rb\_chunk\_commit*(3)](/qb_rb_chunk_commit/3.md), [*qb\_rb\_space\_free*(3)](/qb_rb_space_free/3.md), [*qb\_rb\_name\_get*(3)](/qb_rb_name_get/3.md), [*qb\_rb\_chunk\_alloc*(3)](/qb_rb_chunk_alloc/3.md), [*qb\_rb\_chunk\_read*(3)](/qb_rb_chunk_read/3.md)

## COPYRIGHT

Copyright (C) 2010-2020 Red Hat, Inc.
