{
  "slug": "posix-aio-cancellation",
  "term": "POSIX AIO cancellation",
  "aliases": [
    "aio_cancel"
  ],
  "definition": "POSIX AIO cancellation attempts to stop requests associated with a submission descriptor, with individual outcomes recorded separately.",
  "note": "Batch result: AIO_NOTCANCELED means at least one targeted operation could not be canceled, not that none were canceled. AIO_ALLDONE reports completion without classifying success or failure. Inspect each original request with aio_error, then retrieve its return once with aio_return after termination. [posix-cancel] [posix-return]\n\nDescriptor scope: glibc 2.39 groups requests by the submitted descriptor number. In the native control, canceling through a dup alias returned AIO_ALLDONE while the original descriptor's read remained pending. Shared open-file-description identity did not widen that lookup. [glibc-cancel] [posix-observations]\n\nLifetime: an expired aio_suspend wait does not cancel the request. A pending read still requires a valid control block and destination buffer; a shutdown path must account for the original operations and any notification activity. [posix-suspend] [posix-read]",
  "status": "shipping",
  "advantages": [],
  "limitations": [
    "Which operations can be canceled is implementation-defined.",
    "Logical file readback does not establish crash durability or rollback of earlier effects."
  ],
  "related": [
    "io-timeout",
    "io-uring-cancellation",
    "open-file-description"
  ],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-11-13",
  "citations": [
    {
      "id": "posix-cancel",
      "title": "POSIX.1-2024: aio_cancel, cancellation scope and batch return values.",
      "url": "https://pubs.opengroup.org/onlinepubs/9799919799/functions/aio_cancel.html",
      "accessed": "2026-11-13"
    },
    {
      "id": "posix-return",
      "title": "POSIX.1-2024: aio_return, terminal status and one-time retrieval.",
      "url": "https://pubs.opengroup.org/onlinepubs/9799919799/functions/aio_return.html",
      "accessed": "2026-11-13"
    },
    {
      "id": "posix-read",
      "title": "POSIX.1-2024: aio_read, control-block and buffer lifetime.",
      "url": "https://pubs.opengroup.org/onlinepubs/9799919799/functions/aio_read.html",
      "accessed": "2026-11-13"
    },
    {
      "id": "posix-suspend",
      "title": "POSIX.1-2024: aio_suspend, expired waits and EAGAIN.",
      "url": "https://pubs.opengroup.org/onlinepubs/9799919799/functions/aio_suspend.html",
      "accessed": "2026-11-13"
    },
    {
      "id": "glibc-cancel",
      "title": "glibc-2.39: rt/aio_cancel.c, __aio_cancel and descriptor-number lookup.",
      "url": "https://raw.githubusercontent.com/bminor/glibc/glibc-2.39/rt/aio_cancel.c",
      "accessed": "2026-11-13"
    },
    {
      "id": "glibc-misc",
      "title": "glibc-2.39: rt/aio_misc.c, helper allocation and request grouping.",
      "url": "https://raw.githubusercontent.com/bminor/glibc/glibc-2.39/rt/aio_misc.c",
      "accessed": "2026-11-13"
    },
    {
      "id": "posix-observations",
      "title": "Hesela: six native POSIX AIO cancellation cases, observed results and environment.",
      "url": "https://hesela.dev/research/posix-aio-cancel/summary.json",
      "accessed": "2026-11-13"
    },
    {
      "id": "posix-replay",
      "title": "Hesela: POSIX AIO cancellation, frozen source, observations, tests and offline replay.",
      "url": "https://hesela.dev/research/posix-aio-cancel/posix-aio-cancel.zip",
      "accessed": "2026-11-13"
    }
  ],
  "provenance": [
    "Six scenarios, three repetitions per GCC setting (O0/O2), 36 recorded executions on one Linux 6.8/glibc 2.39-0ubuntu8.9 host. Replays check those observations, not a larger device population. [posix-observations]",
    "The canceled file write was queued behind a pipe gate, not interrupted in hardware. The offline package includes raw observations, source hashes, verification code and a license. [posix-replay]"
  ]
}
