---
name: "sd_bus_message_set_expect_reply"
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_set_expect_reply"
---

# sd\_bus\_message\_set\_expect\_reply(3)

Set and query bus message metadata

## NAME

sd\_bus\_message\_set\_expect\_reply, sd\_bus\_message\_get\_expect\_reply, sd\_bus\_message\_set\_auto\_start, sd\_bus\_message\_get\_auto\_start, sd\_bus\_message\_set\_allow\_interactive\_authorization, sd\_bus\_message\_get\_allow\_interactive\_authorization - Set and query bus message metadata

## SYNOPSIS

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

**int sd\_bus\_message\_set\_expect\_reply(sd\_bus\_message \****message***, int** *b***);**

**int sd\_bus\_message\_get\_expect\_reply(sd\_bus\_message \****message***);**

**int sd\_bus\_message\_set\_auto\_start(sd\_bus\_message \****message***, int** *b***);**

**int sd\_bus\_message\_get\_auto\_start(sd\_bus\_message \****message***);**

**int sd\_bus\_message\_set\_allow\_interactive\_authorization(sd\_bus\_message \****message***, int** *b***);**

**int sd\_bus\_message\_get\_allow\_interactive\_authorization(sd\_bus\_message \****message***);**

## DESCRIPTION

**sd\_bus\_message\_set\_expect\_reply()** sets or clears the **NO\_REPLY\_EXPECTED** flag on the message *m*. This flag matters only for method call messages and is used to specify that no method return or error reply is expected. It is ignored for other types. Thus, for a method call message, calling

```
sd_bus_message_set_expect_reply(..., 0)
```

sets the flag and suppresses the reply.

**sd\_bus\_message\_get\_expect\_reply()** checks if the **NO\_REPLY\_EXPECTED** flag is set on the message *m*. It will return positive if it is not set, and zero if it is.

**sd\_bus\_message\_set\_auto\_start()** sets or clears the **NO\_AUTO\_START** flag on the message *m*. When the flag is set, the bus must not launch an owner for the destination name in response to this message. Calling

```
sd_bus_message_set_auto_start(..., 0)
```

sets the flag.

**sd\_bus\_message\_get\_auto\_start()** checks if the **NO\_AUTO\_START** flag is set on the message *m*. It will return positive if it is not set, and zero if it is.

**sd\_bus\_message\_set\_allow\_interactive\_authorization()** sets or clears the **ALLOW\_INTERACTIVE\_AUTHORIZATION** flag on the message *m*. Setting this flag informs the receiver that the caller is prepared to wait for interactive authorization via polkit or a similar framework. Note that setting this flag does not guarantee that the receiver will actually perform interactive authorization. Also, make sure to set a suitable message timeout when using this flag since interactive authorization could potentially take a long time as it depends on user input. If *b* is non-zero, the flag is set.

**sd\_bus\_message\_get\_allow\_interactive\_authorization()** checks if the **ALLOW\_INTERACTIVE\_AUTHORIZATION** flag is set on the message *m*. It will return a positive integer if the flag is set. Otherwise, it returns zero.

## RETURN VALUE

On success, these functions return a non-negative integer. On failure, they return a negative errno-style error code.

### Errors

Returned errors may indicate the following problems:

**-EINVAL**

The *message* parameter is **NULL**.

**-EPERM**

The message *message* is sealed when trying to set a flag.

The message *message* has wrong type.

## 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\_set\_expect\_reply()**, **sd\_bus\_message\_get\_expect\_reply()**, **sd\_bus\_message\_set\_auto\_start()**, and **sd\_bus\_message\_get\_auto\_start()** were added in version 240.

**sd\_bus\_message\_set\_allow\_interactive\_authorization()** and **sd\_bus\_message\_get\_allow\_interactive\_authorization()** were added in version 246.

## SEE ALSO

[**systemd**(1)](/systemd/1.md), [**sd-bus**(3)](/sd-bus/3.md), [**sd\_bus\_set\_description**(3)](/sd_bus_set_description/3.md)
