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

# udev\_monitor\_receive\_device(3)

Query and modify device monitor

## NAME

udev\_monitor\_receive\_device, udev\_monitor\_enable\_receiving, udev\_monitor\_set\_receive\_buffer\_size, udev\_monitor\_get\_fd, udev\_monitor\_get\_udev - Query and modify device monitor

## SYNOPSIS

```
#include <libudev.h>
```

**struct udev\_device \*udev\_monitor\_receive\_device(struct udev\_monitor \****udev\_monitor***);**

**int udev\_monitor\_enable\_receiving(struct udev\_monitor \****udev\_monitor***);**

**int udev\_monitor\_set\_receive\_buffer\_size(struct udev\_monitor \****udev\_monitor***, int** *size***);**

**int udev\_monitor\_get\_fd(struct udev\_monitor \****udev\_monitor***);**

**struct udev \*udev\_monitor\_get\_udev(struct udev\_monitor \****udev\_monitor***);**

## RETURN VALUE

On success, **udev\_monitor\_receive\_device()** returns a pointer to a newly referenced device that was received via the monitor. The caller is responsible to drop this reference when done. On failure, **NULL** is returned.

On success, **udev\_monitor\_enable\_receiving()** and **udev\_monitor\_set\_receive\_buffer\_size()** return an integer greater than, or equal to, **0**. On failure, a negative error code is returned.

On success, **udev\_monitor\_get\_fd()** returns the file descriptor used by this monitor. On failure, a negative error code is returned.

**udev\_monitor\_get\_udev()** always returns a pointer to the udev context that this monitor is associated with.

## HISTORY

**udev\_monitor\_receive\_device()**, **udev\_monitor\_enable\_receiving()**, **udev\_monitor\_set\_receive\_buffer\_size()**, **udev\_monitor\_get\_fd()**, and **udev\_monitor\_get\_udev()** were added in version 221.

## SEE ALSO

[**udev\_new**(3)](/udev_new/3.md), [**udev\_device\_new\_from\_syspath**(3)](/udev_device_new_from_syspath/3.md), [**udev\_enumerate\_new**(3)](/udev_enumerate_new/3.md), [**udev\_monitor\_new\_from\_netlink**(3)](/udev_monitor_new_from_netlink/3.md), [**udev\_monitor\_filter\_update**(3)](/udev_monitor_filter_update/3.md), [**udev\_list\_entry**(3)](/udev_list_entry/3.md), [**systemd**(1)](/systemd/1.md)
