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

# libressl-BIO\_s\_null(3)

null data sink

## NAME

**BIO\_s\_null** – null data sink

## SYNOPSIS

Crypto Library (libcrypto, -lcrypto)

**#include \<openssl/bio.h\>**

*const* *BIO\_METHOD* *\**\

**BIO\_s\_null**(*void*);

## DESCRIPTION

**BIO\_s\_null**() returns the null sink BIO method. Data written to the null sink is discarded, reads return EOF.

A null sink BIO behaves in a similar manner to the [null(4)](/null/4.md) device.

A null BIO can be placed on the end of a chain to discard any data passed through it.

A null sink is useful if, for example, an application wishes to digest some data by writing through a digest bio but not send the digested data anywhere. Since a BIO chain must normally include a source/sink BIO, this can be achieved by adding a null sink BIO to the end of the chain.

## RETURN VALUES

**BIO\_s\_null**() returns the null sink BIO method.

When called on a null sink BIO object, BIO\_method\_type(3) returns the constant BIO\_TYPE\_NULL and BIO\_method\_name(3) returns a pointer to the static string "NULL", not to be confused with a NUL string nor with a NULL pointer.

## SEE ALSO

BIO\_new(3)

## HISTORY

**BIO\_s\_null**() first appeared in SSLeay 0.6.0 and has been available since OpenBSD 2.4.
