Documentation/userspace-api/ioctl/hdio.rst
Source file repositories/reference/linux-study-clean/Documentation/userspace-api/ioctl/hdio.rst
File Facts
- System
- Linux kernel
- Corpus path
Documentation/userspace-api/ioctl/hdio.rst- Extension
.rst- Size
- 15817 bytes
- Lines
- 548
- Domain
- Support Tooling And Documentation
- Bucket
- Documentation
- Inferred role
- Support Tooling And Documentation: documentation
- Status
- atlas-only
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
==============================
Summary of `HDIO_` ioctl calls
==============================
- Edward A. Falk <efalk@google.com>
November, 2004
This document attempts to describe the ioctl(2) calls supported by
the HD/IDE layer. These are by-and-large implemented (as of Linux 5.11)
drivers/ata/libata-scsi.c.
ioctl values are listed in <linux/hdreg.h>. As of this writing, they
are as follows:
ioctls that pass argument pointers to user space:
======================= =======================================
HDIO_GETGEO get device geometry
HDIO_GET_32BIT get current io_32bit setting
HDIO_GET_IDENTITY get IDE identification info
HDIO_DRIVE_TASKFILE execute raw taskfile
HDIO_DRIVE_TASK execute task and special drive command
HDIO_DRIVE_CMD execute a special drive command
======================= =======================================
ioctls that pass non-pointer values:
======================= =======================================
HDIO_SET_32BIT change io_32bit flags
======================= =======================================
The information that follows was determined from reading kernel source
code. It is likely that some corrections will be made over time.
------------------------------------------------------------------------------
General:
Unless otherwise specified, all ioctl calls return 0 on success
and -1 with errno set to an appropriate value on error.
Unless otherwise specified, all ioctl calls return -1 and set
errno to EFAULT on a failed attempt to copy data to or from user
address space.
Unless otherwise specified, all data structures and constants
are defined in <linux/hdreg.h>
------------------------------------------------------------------------------
HDIO_GETGEO
get device geometry
usage::
struct hd_geometry geom;
ioctl(fd, HDIO_GETGEO, &geom);
inputs:
none
outputs:
hd_geometry structure containing:
Annotation
- Atlas domain: Support Tooling And Documentation / Documentation.
- Implementation status: atlas-only.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.