{
    "produces": [
        "application/json"
    ],
    "swagger": "2.0",
    "info": {
        "description": "Linux system calls of 38 architectures and ABIs, extracted from the kernel sources of every release since 3.3.\nWithout kernel, an architecture's newest available table is served. Other queries use the newest scanned release.\n/v2 is the current API. /v1 keeps the pre-2.0 format for existing clients and is deprecated.\nErrors from /v2 are RFC 9457 problem details (application/problem+json).\nFor terminal use, try the [syscall CLI](https://github.com/guitmz/syscall): look up syscalls, compare architectures and explore kernel history offline.",
        "title": "Linux Syscall API",
        "contact": {
            "name": "guitmz",
            "url": "https://www.guitmz.com/about/",
            "email": "thomazi@linux.com"
        },
        "version": "2.0"
    },
    "basePath": "/",
    "paths": {
        "/v1/conventions": {
            "get": {
                "description": "The pre-2.0 format of /v2/conventions: x64, x86, arm and arm64, without the instruction.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "v1 (deprecated)"
                ],
                "summary": "List call conventions (deprecated)",
                "deprecated": true,
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/legacy.Convention"
                            }
                        }
                    }
                }
            }
        },
        "/v1/conventions/{arch}": {
            "get": {
                "description": "The pre-2.0 format of /v2/conventions/{arch}.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "v1 (deprecated)"
                ],
                "summary": "Get call conventions for an architecture (deprecated)",
                "deprecated": true,
                "parameters": [
                    {
                        "type": "string",
                        "description": "Architecture",
                        "name": "arch",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/legacy.Convention"
                        }
                    },
                    "404": {
                        "description": "Not found",
                        "schema": {
                            "type": "string"
                        }
                    }
                }
            }
        },
        "/v1/syscalls/{archNameNumber}": {
            "get": {
                "description": "The pre-2.0 format of /v2/syscalls/{archNameNumber}: x64, x86, arm and arm64 only, every syscall ever seen\n(no kernel filter), signatures as empty strings when absent, and an empty list instead of 404.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "v1 (deprecated)"
                ],
                "summary": "List system calls by architecture, number or name (deprecated)",
                "deprecated": true,
                "parameters": [
                    {
                        "type": "string",
                        "description": "Architecture, syscall number or syscall name",
                        "name": "archNameNumber",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/legacy.Syscall"
                            }
                        }
                    }
                }
            }
        },
        "/v1/syscalls/{arch}/{nameNumber}": {
            "get": {
                "description": "The pre-2.0 format of /v2/syscalls/{arch}/{nameNumber}, an empty list when nothing matches.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "v1 (deprecated)"
                ],
                "summary": "Get system call by architecture and number or name (deprecated)",
                "deprecated": true,
                "parameters": [
                    {
                        "type": "string",
                        "description": "Architecture",
                        "name": "arch",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Syscall number or name",
                        "name": "nameNumber",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/legacy.Syscall"
                            }
                        }
                    }
                }
            }
        },
        "/v2/arches": {
            "get": {
                "description": "First and last are inclusive scanned releases. Until, when present, is the first release without the architecture. Syscalls is the count at last.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "architectures"
                ],
                "summary": "List architectures and their scanned releases",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/dataset.Architecture"
                            }
                        }
                    }
                }
            }
        },
        "/v2/conventions": {
            "get": {
                "description": "get all call conventions, with notes on the ABI quirks the register table cannot express\nuntil, when present, is the first upstream Linux release without the architecture.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "conventions"
                ],
                "summary": "List call conventions for supported architectures",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/models.Conventions"
                            }
                        }
                    }
                }
            }
        },
        "/v2/conventions/{arch}": {
            "get": {
                "description": "get call convention for architecture",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "conventions"
                ],
                "summary": "Get call conventions for specified architecture",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Architecture",
                        "name": "arch",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.Conventions"
                        }
                    },
                    "404": {
                        "description": "Unknown architecture",
                        "schema": {
                            "$ref": "#/definitions/respond.Problem"
                        }
                    }
                }
            }
        },
        "/v2/dataset": {
            "get": {
                "description": "Returns download paths, byte sizes, and SHA-256 hashes for the files bundled with the current deployment.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "dataset"
                ],
                "summary": "Describe the deployed dataset downloads",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Previously received ETag",
                        "name": "If-None-Match",
                        "in": "header"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/downloads.Info"
                        }
                    },
                    "304": {
                        "description": "Not Modified"
                    }
                }
            }
        },
        "/v2/dataset/syscalls.db": {
            "get": {
                "description": "Returns the SQLite database generated from the JSON bundled with the current deployment.",
                "produces": [
                    "application/vnd.sqlite3"
                ],
                "tags": [
                    "dataset"
                ],
                "summary": "Download the deployed dataset as SQLite",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Previously received ETag",
                        "name": "If-None-Match",
                        "in": "header"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "SQLite database",
                        "schema": {
                            "type": "file"
                        },
                        "headers": {
                            "ETag": {
                                "type": "string",
                                "description": "SHA-256 of the file"
                            }
                        }
                    },
                    "304": {
                        "description": "Not Modified",
                        "headers": {
                            "ETag": {
                                "type": "string",
                                "description": "SHA-256 of the file"
                            }
                        }
                    }
                }
            }
        },
        "/v2/dataset/syscalls.json": {
            "get": {
                "description": "Returns the complete dataset bundled with the current deployment.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "dataset"
                ],
                "summary": "Download the deployed dataset as JSON",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Previously received ETag",
                        "name": "If-None-Match",
                        "in": "header"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Dataset JSON",
                        "schema": {
                            "type": "file"
                        },
                        "headers": {
                            "ETag": {
                                "type": "string",
                                "description": "SHA-256 of the file"
                            }
                        }
                    },
                    "304": {
                        "description": "Not Modified",
                        "headers": {
                            "ETag": {
                                "type": "string",
                                "description": "SHA-256 of the file"
                            }
                        }
                    }
                }
            }
        },
        "/v2/diff/{from}/{to}": {
            "get": {
                "description": "Syscalls added and removed between two scanned releases, per architecture. from may be newer than to,\nwhich swaps added and removed. Without arch, every architecture scanned in both releases is compared.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "diff"
                ],
                "summary": "Compare two kernel releases",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Kernel version, e.g. 6.1",
                        "name": "from",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Kernel version, e.g. 6.12",
                        "name": "to",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Architecture",
                        "name": "arch",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/diff.Diff"
                        }
                    },
                    "400": {
                        "description": "Invalid kernel version",
                        "schema": {
                            "$ref": "#/definitions/respond.Problem"
                        }
                    },
                    "404": {
                        "description": "Unknown kernel version or architecture, or architecture not scanned in both releases",
                        "schema": {
                            "$ref": "#/definitions/respond.Problem"
                        }
                    }
                }
            }
        },
        "/v2/kernels": {
            "get": {
                "description": "kernel versions the dataset was extracted from, oldest first, with the architectures covered by each",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "kernels"
                ],
                "summary": "List scanned kernel releases",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/dataset.Kernel"
                            }
                        }
                    }
                }
            }
        },
        "/v2/syscalls/{archNameNumber}": {
            "get": {
                "description": "If archNameNumber is a supported architecture (see /v2/conventions), all its syscalls are returned.\nIf it is a number, syscalls with that number across all architectures, otherwise syscalls with that name.\nWithout kernel, an architecture's newest available table is served. Other queries use the newest scanned release.\n`since`/`removed_in` are about the syscall table: the first and last scanned release carrying the number.\n`kconfig` names the kernel option the implementation is gated behind, when there is one, and `family` the\nfunctional group the call belongs to (sysvipc, epoll, io_uring, keys, ...), when there is one.\nThe filters below combine: a syscall is returned only when it matches all of them.\n`name` and `nr` take up to 256 comma-separated values, to look up several syscalls in one request.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "syscalls"
                ],
                "summary": "List system calls by architecture, number or name",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Architecture, syscall number or syscall name",
                        "name": "archNameNumber",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Kernel version (e.g. 6.1). Defaults to the newest table for an architecture, otherwise the newest release. 'all' includes removed syscalls",
                        "name": "kernel",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Comma-separated syscall names, any of which matches (e.g. read,write,openat)",
                        "name": "name",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Comma-separated syscall numbers, any of which matches (e.g. 0,1,257)",
                        "name": "nr",
                        "in": "query"
                    },
                    {
                        "enum": [
                            "sysvipc",
                            "mqueue",
                            "epoll",
                            "inotify",
                            "fanotify",
                            "landlock",
                            "aio",
                            "io_uring",
                            "keys",
                            "pkeys"
                        ],
                        "type": "string",
                        "description": "Functional family",
                        "name": "family",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Kernel option the implementation is gated behind (e.g. CONFIG_EPOLL)",
                        "name": "kconfig",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Case-insensitive text found in the name, description, an argument, the family or the kconfig option (e.g. sockaddr)",
                        "name": "q",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/models.Syscalls"
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid kernel version, number or filter",
                        "schema": {
                            "$ref": "#/definitions/respond.Problem"
                        }
                    },
                    "404": {
                        "description": "No matching syscall or unknown kernel version",
                        "schema": {
                            "$ref": "#/definitions/respond.Problem"
                        }
                    }
                }
            }
        },
        "/v2/syscalls/{arch}/{nameNumber}": {
            "get": {
                "description": "get syscall with given number or name for given architecture\nWithout kernel, the architecture's newest available table is served.\n`since`/`removed_in` are about the syscall table: the first and last scanned release carrying the number.\n`kconfig` names the kernel option the implementation is gated behind, when there is one, and `family` the\nfunctional group the call belongs to (sysvipc, epoll, io_uring, keys, ...), when there is one.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "syscalls"
                ],
                "summary": "Get system call by architecture and number or name",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Architecture",
                        "name": "arch",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Syscall number or name",
                        "name": "nameNumber",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Kernel version (e.g. 6.1). Defaults to the architecture's newest table. 'all' includes removed syscalls",
                        "name": "kernel",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/models.Syscalls"
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid kernel version",
                        "schema": {
                            "$ref": "#/definitions/respond.Problem"
                        }
                    },
                    "404": {
                        "description": "Unknown architecture, no matching syscall or unknown kernel version",
                        "schema": {
                            "$ref": "#/definitions/respond.Problem"
                        }
                    }
                }
            }
        },
        "/{arch}/{nameNumber}": {
            "get": {
                "description": "For terminals: `curl api.syscall.sh/x64/close` (or `/x64/3`) prints the syscall's number, signature,\nthe register of each argument and the calling convention's notes.",
                "produces": [
                    "text/plain"
                ],
                "tags": [
                    "text"
                ],
                "summary": "Plain-text syscall lookup on one architecture",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Architecture",
                        "name": "arch",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Syscall number or name",
                        "name": "nameNumber",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Kernel version (e.g. 6.1). Defaults to the architecture's newest table. 'all' includes removed syscalls",
                        "name": "kernel",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Syscall details",
                        "schema": {
                            "type": "string"
                        }
                    },
                    "400": {
                        "description": "Invalid kernel version",
                        "schema": {
                            "type": "string"
                        }
                    },
                    "404": {
                        "description": "Unknown architecture, no matching syscall or unknown kernel version",
                        "schema": {
                            "type": "string"
                        }
                    }
                }
            }
        },
        "/{name}": {
            "get": {
                "description": "For terminals: `curl api.syscall.sh/close` prints the syscall's number, instruction and registers on\nx64, x86, arm64, arm and riscv64 (the architectures that have it), or on every architecture that has it\nwhen none of these do. An architecture name prints its whole table, which takes the filters of\n/v2/syscalls/{archNameNumber}.",
                "produces": [
                    "text/plain"
                ],
                "tags": [
                    "text"
                ],
                "summary": "Plain-text syscall lookup",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Syscall name, or an architecture for its whole table",
                        "name": "name",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Comma-separated architectures to show, or 'all'",
                        "name": "arch",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Kernel version (e.g. 6.1). Defaults to the newest table for one architecture, otherwise the newest release. 'all' includes removed syscalls",
                        "name": "kernel",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Syscall table",
                        "schema": {
                            "type": "string"
                        }
                    },
                    "400": {
                        "description": "Invalid kernel version, architecture or filter, or a number without an architecture",
                        "schema": {
                            "type": "string"
                        }
                    },
                    "404": {
                        "description": "No matching syscall, not on the requested architectures, or unknown kernel version",
                        "schema": {
                            "type": "string"
                        }
                    }
                }
            }
        }
    },
    "definitions": {
        "dataset.Architecture": {
            "type": "object",
            "properties": {
                "arch": {
                    "type": "string"
                },
                "first": {
                    "type": "string"
                },
                "last": {
                    "type": "string"
                },
                "syscalls": {
                    "type": "integer"
                },
                "until": {
                    "type": "string"
                }
            }
        },
        "dataset.Kernel": {
            "type": "object",
            "properties": {
                "arches": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "version": {
                    "type": "string"
                }
            }
        },
        "diff.ArchDiff": {
            "type": "object",
            "properties": {
                "added": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/models.Syscalls"
                    }
                },
                "arch": {
                    "type": "string",
                    "example": "x64"
                },
                "removed": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/models.Syscalls"
                    }
                }
            }
        },
        "diff.Diff": {
            "type": "object",
            "properties": {
                "arches": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/diff.ArchDiff"
                    }
                },
                "from": {
                    "type": "string",
                    "example": "6.1"
                },
                "to": {
                    "type": "string",
                    "example": "6.12"
                }
            }
        },
        "downloads.FileInfo": {
            "type": "object",
            "properties": {
                "sha256": {
                    "type": "string"
                },
                "size_bytes": {
                    "type": "integer"
                },
                "url": {
                    "type": "string"
                }
            }
        },
        "downloads.Info": {
            "type": "object",
            "properties": {
                "json": {
                    "$ref": "#/definitions/downloads.FileInfo"
                },
                "sqlite": {
                    "$ref": "#/definitions/downloads.FileInfo"
                }
            }
        },
        "legacy.Convention": {
            "type": "object",
            "properties": {
                "arch": {
                    "type": "string"
                },
                "arg0": {
                    "type": "string"
                },
                "arg1": {
                    "type": "string"
                },
                "arg2": {
                    "type": "string"
                },
                "arg3": {
                    "type": "string"
                },
                "arg4": {
                    "type": "string"
                },
                "arg5": {
                    "type": "string"
                },
                "nr": {
                    "type": "string"
                },
                "return": {
                    "type": "string"
                }
            }
        },
        "legacy.Syscall": {
            "type": "object",
            "properties": {
                "arch": {
                    "type": "string"
                },
                "arg0": {
                    "type": "string"
                },
                "arg1": {
                    "type": "string"
                },
                "arg2": {
                    "type": "string"
                },
                "arg3": {
                    "type": "string"
                },
                "arg4": {
                    "type": "string"
                },
                "arg5": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "nr": {
                    "type": "integer"
                },
                "refs": {
                    "description": "always empty, it held placeholder text",
                    "type": "string"
                },
                "return": {
                    "description": "the syscall number in hex, as /v1 always reported it",
                    "type": "string"
                }
            }
        },
        "models.Conventions": {
            "type": "object",
            "properties": {
                "arch": {
                    "type": "string"
                },
                "arg0": {
                    "type": "string"
                },
                "arg1": {
                    "type": "string"
                },
                "arg2": {
                    "type": "string"
                },
                "arg3": {
                    "type": "string"
                },
                "arg4": {
                    "type": "string"
                },
                "arg5": {
                    "type": "string"
                },
                "instruction": {
                    "type": "string"
                },
                "notes": {
                    "description": "Notes : ABI quirks the register table cannot express, empty when there is nothing to report",
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "nr": {
                    "type": "string"
                },
                "return": {
                    "type": "string"
                },
                "until": {
                    "description": "Until is the first upstream Linux release without this architecture.",
                    "type": "string"
                }
            }
        },
        "models.Syscalls": {
            "type": "object",
            "properties": {
                "abi": {
                    "type": "string"
                },
                "arch": {
                    "type": "string"
                },
                "arg0": {
                    "type": "string"
                },
                "arg1": {
                    "type": "string"
                },
                "arg2": {
                    "type": "string"
                },
                "arg3": {
                    "type": "string"
                },
                "arg4": {
                    "type": "string"
                },
                "arg5": {
                    "type": "string"
                },
                "description": {
                    "description": "Description : summary from the man page's NAME section, nil without a man page",
                    "type": "string"
                },
                "entry_point": {
                    "type": "string"
                },
                "family": {
                    "description": "Family : functional family the call belongs to (sysvipc, epoll, io_uring, keys, ...), nil\nwhen there is no established family, see Family in lib/kernel",
                    "type": "string",
                    "enum": [
                        "sysvipc",
                        "mqueue",
                        "epoll",
                        "inotify",
                        "fanotify",
                        "landlock",
                        "aio",
                        "io_uring",
                        "keys",
                        "pkeys"
                    ]
                },
                "kconfig": {
                    "description": "Kconfig : option the implementation is gated behind, nil when the call is always built.\nThe table keeps the number either way, see Kconfig in lib/kernel",
                    "type": "string"
                },
                "man_page": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "nargs": {
                    "description": "nil when the signature is unknown",
                    "type": "integer"
                },
                "nr": {
                    "type": "integer"
                },
                "removed_in": {
                    "description": "RemovedIn : first scanned release without the syscall, nil while its number is in the table",
                    "type": "string"
                },
                "since": {
                    "type": "string"
                },
                "source": {
                    "type": "string"
                }
            }
        },
        "respond.Problem": {
            "type": "object",
            "properties": {
                "detail": {
                    "type": "string",
                    "example": "Unknown kernel version"
                },
                "status": {
                    "type": "integer",
                    "example": 404
                },
                "title": {
                    "type": "string",
                    "example": "Not Found"
                },
                "type": {
                    "type": "string",
                    "example": "about:blank"
                }
            }
        }
    }
}