{
  "id": "enwiki-001321200360",
  "slug": "write-system-call",
  "title": "Write (system call)",
  "qid": "",
  "lead": "The write is one of the most basic routines provided by a Unix-like operating system kernel. It writes data from a buffer declared by the user to a given device, such as a file. This is the primary way to output data from a program by directly using a system call. The destination is identified by a numeric code. The data to be written, for instance a piece of text, is defined by a pointer and a size, given in number of bytes. write thus takes three arguments: # The file code (file descriptor or fd). # The pointer to a buffer where the data is stored (buf). # The number of bytes to write from the buffer (nbytes).",
  "body": "The write is one of the most basic routines provided by a Unix-like operating system kernel. It writes data from a buffer declared by the user to a given device, such as a file. This is the primary way to output data from a program by directly using a system call. The destination is identified by a numeric code. The data to be written, for instance a piece of text, is defined by a pointer and a size, given in number of bytes. write thus takes three arguments: The file code (file descriptor or fd). The pointer to a buffer where the data is stored (buf). The number of bytes to write from the buffer (nbytes). ssize_t write(int fildes, const void* buf, size_t nbyte); In above syntax, ssize_t is a typedef . It is a signed data type defined in stddef.h . Note that write() does not return an unsigned value; it returns -1 if an error occurs so it must return a signed value. The write function returns the number of bytes successfully written into the file, which may at times be less than the specified nbytes. It returns -1 if an exceptional condition is encountered, see section on errors below.",
  "categories": [
    "22896980",
    "23118434",
    "23603337",
    "28957560",
    "29501647"
  ],
  "license": "CC BY-SA 4.0",
  "source_uri": "https://en.wikipedia.org/w/index.php?oldid=1321200360",
  "content_hash": "",
  "created_at": null,
  "updated_at": 1762669739.0,
  "claims": [],
  "contradictions": [],
  "confidence": 0.6,
  "csl": {
    "id": "enwiki-001321200360",
    "type": "webpage",
    "title": "Write (system call)",
    "author": [
      {
        "family": "Anticloud FZ LLE",
        "literal": "Anticloud FZ LLE"
      }
    ],
    "container-title": "encyclopegia.org",
    "publisher": "Anticloud FZ LLE",
    "publisher-place": "Dubai, United Arab Emirates",
    "URL": "https://encyclopegia.org/a/write-system-call",
    "issued": {
      "date-parts": [
        [
          2026,
          11,
          20
        ]
      ]
    },
    "accessed": {
      "date-parts": [
        [
          2026,
          11,
          20
        ]
      ]
    },
    "license": "CC BY-SA 4.0",
    "DOI": "eo1:enwiki-001321200360",
    "isBasedOn": "https://en.wikipedia.org/w/index.php?oldid=1321200360",
    "note": "Immutable snapshot enwiki-001321200360"
  }
}