---
name: "sd_bus_message_seal"
section: "3"
platform: "linux"
package: "systemd-libs"
version: "262.1-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/sd_bus_message_seal"
---

# sd\_bus\_message\_seal(3)

Prepare a D-Bus message for transmission

## NAME

sd\_bus\_message\_seal - Prepare a D-Bus message for transmission

## SYNOPSIS

```
#include <systemd/sd-bus.h>
```

**int sd\_bus\_message\_seal(sd\_bus\_message \****m***, uint64\_t** *cookie***, uint64\_t** *timeout\_usec***);**

## DESCRIPTION

**sd\_bus\_message\_seal()** finishes the message *m* and prepares it for transmission using [**sd\_bus\_send**(3)](/sd_bus_send/3.md). *cookie* specifies the identifier used to match the message reply to its corresponding request. *timeout\_usec* specifies the maximum time in microseconds to wait for a reply to arrive.

Note that in most scenarios, it is not necessary to call this function directly. [**sd\_bus\_call**(3)](/sd_bus_call/3.md), [**sd\_bus\_call\_async**(3)](/sd_bus_call_async/3.md) and [**sd\_bus\_send**(3)](/sd_bus_send/3.md) will seal any given messages if they have not been sealed yet.

## RETURN VALUE

On success, this function returns a non-negative integer. On failure, it returns a negative errno-style error code.

### Errors

Returned errors may indicate the following problems:

**-EINVAL**

The *m* parameter is **NULL**.

Added in version 246.

**-EBADMSG**

The D-Bus message *m* has open containers.

Added in version 246.

**-ENOMSG**

The D-Bus message *m* is a reply but its type signature does not match the return type signature of its corresponding member in the object vtable.

Added in version 246.

## NOTES

Functions described here are available as a shared library, which can be compiled against and linked to with the **libsystemd** [**pkg-config**(1)](/pkg-config/1.md) file.

All functions listed here are thread-agnostic and only a single thread may operate on a given object at any given time. Different threads may access the same object at different times. Multiple independent objects may be used from different threads in parallel.

The code described here uses [**getenv**(3)](/getenv/3.md), which is declared to be not multi-thread-safe. This means that the code calling the functions described here must not call [**setenv**(3)](/setenv/3.md) from a parallel thread. It is recommended to only do calls to **setenv()** from an early phase of the program when no other threads have been started.

## HISTORY

**sd\_bus\_message\_seal()** was added in version 246.

## SEE ALSO

[**systemd**(1)](/systemd/1.md), [**sd-bus**(3)](/sd-bus/3.md), [**sd\_bus\_call**(3)](/sd_bus_call/3.md), [**sd\_bus\_call\_async**(3)](/sd_bus_call_async/3.md), [**sd\_bus\_send**(3)](/sd_bus_send/3.md)
