IOCTL-XFS-H...MONITORED-FS(2)
π ioctl_xfs_health_fd_on_monitored_fs β bestie check π
okay so real talk, this is a page from the System Calls Manual (section 2, the syscall girlies), and it's all about one specific XFS ioctl. come sit with me π«Ά
β¨ NAME β¨
ioctl_xfs_health_fd_on_monitored_fs β the lil function that checks whether the fd you're holding actually belongs to the same filesystem that's being monitored π
πΈ SYNOPSIS πΈ
#include <xfs/xfs_fs.h>
int ioctl(int healthmon_fd, XFS_IOC_HEALTH_FD_ON_MONITORED_FS, struct
xfs_health_file_on_monitored_fs *arg);
π¦ DESCRIPTION π¦
so this is an XFS healthmon fd ioctl, and what it does is literally just ask the kernel driver: "hey bestie, does the file descriptor we passed in through arg point to a file that lives on the same filesystem that healthmon_fd is monitoring?" π
and the fd gets conveyed in a struct that looks exactly like this, no notes:
struct xfs_health_file_on_monitored_fs {
__s32 fd;
__u32 flags;
};
- the
flagsfield must be zero. like, zero zero. not negotiable π« - the
fdfield is a descriptor of an open file π
and one more thing β healthmon_fd must be a file that was opened via the XFS_IOC_HEALTH_MONITOR ioctl. that's the vibe check it has to pass. no cap.
β RETURN VALUE β
if something goes wrong, -1 gets returned and errno is set to tell you what happened π
but if the file descriptor does point to a file on the same filesystem that's being monitored? you get 0 back. slay. β¨
π ERRORS π
error codes can be one of these, but lowkey not limited to just these:
ESTALEβ the open file is not on the same filesystem that's being monitored. different fs, different vibe, not it πEINVALβ one or more of the arguments you specified is invalid. check ur inputs bestie.EBADFβarg.fddoes not refer to an open file. it's giving closed, and not in the cute way πEFAULTβ theargstructure could not be copied into the kernel. the copy failed, periodt.ENOTTYβhealthmon_fdis not an XFS health monitoring file. wrong file, wrong energy π€
π CONFORMING TO π
this API is specific to the XFS filesystem on the Linux kernel. iykyk π§
π SEE ALSO π
and that's the whole page, bestie, you ate it π β¨ written by the XFS girlies, dated 2026-01-04, and yeah β that's the manual, section 2, no cap, we're done here. mwah ππ«Άπ
π¦ where this page comes from
- alpine 3.24: xfsprogs-doc 7.0.1-r0 Β· LGPL-2.1-or-later
- arch rolling: xfsprogs 7.2.0-1
- arch rolling: xfsprogs 7.2.1-1 Β· GPL-2.0-only AND LGPL-2.1-only
- fedora 44: xfsprogs-devel 7.1.1-1.fc44 Β· GPL-1.0-or-later AND LGPL-2.1-or-later
- fedora 44: xfsprogs-devel 7.1.1-1.fc44 Β· GPL-1.0-or-later AND LGPL-2.1-or-later
- nixpkgs unstable: xfsprogs 7.2.1
- π the page's license: GPL-2.0+
- Copyright (c) 2025-2026, Oracle. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms