IOCTL-XFS-HEALTH-FD-ON-MONITORED-FS(2) System Calls Manual IOCTL-XFS-HEALTH-FD-ON-MONITORED-FS(2)

# [NAME](#NAME)

ioctl\_xfs\_health\_fd\_on\_monitored\_fs - check if the given fd belongs to the same fs being monitored

# [SYNOPSIS](#SYNOPSIS)

**#include &lt;xfs/xfs\_fs.h&gt;**

**int ioctl(int healthmon\_fd, XFS\_IOC\_HEALTH\_FD\_ON\_MONITORED\_FS, struct xfs\_health\_file\_on\_monitored\_fs \*arg);**

# [DESCRIPTION](#DESCRIPTION)

This XFS healthmon fd ioctl asks the kernel driver if the file descriptor passed in via *arg* points to a file on the same filesystem that is being monitored by *healthmon\_fd*. The file descriptor is conveyed in a structure of the following form:

```
struct xfs_health_file_on_monitored_fs {
	__s32 fd;
	__u32 flags;
};
```

The field *flags* must be zero.

The field *fd* is a descriptor of an open file.

The argument *healthmon\_fd* must be a file opened via the **XFS\_IOC\_HEALTH\_MONITOR** ioctl.

# [RETURN VALUE](#RETURN_VALUE)

On error, -1 is returned, and *errno* is set to indicate the error. If the file descriptor points to a file on the same filesystem that is being monitored, 0 is returned.

# [ERRORS](#ERRORS)

Error codes can be one of, but are not limited to, the following:

[**ESTALE**](#ESTALE)

The open file is not on the same filesystem that is being monitored.

[**EINVAL**](#EINVAL)

One or more of the arguments specified is invalid.

[**EBADF**](#EBADF)

*arg.fd* does not refer to an open file.

[**EFAULT**](#EFAULT)

The *arg* structure could not be copied into the kernel.

[**ENOTTY**](#ENOTTY)

*healthmon\_fd* is not a XFS health monitoring file.

# [CONFORMING TO](#CONFORMING_TO)

This API is specific to XFS filesystem on the Linux kernel.

# [SEE ALSO](#SEE_ALSO)

[**ioctl\_xfs\_health\_monitor**(2)](/man/os/xfsprogs/ioctl_xfs_health_monitor.2)

2026-01-04 XFS

---

Document: ioctl_xfs_health_fd_on_monitored_fs(2) from xfsprogs 7.2.0-r0 (Chainguard OS)
Source: https://kernel.googlesource.com/pub/scm/fs/xfs/xfsprogs-dev
