_llseek(2)
β¨ NAME β¨
this is page _llseek(2) btw, in the System Calls Manual neighborhood π«Ά
_llseek β reposition read/write file offset
π LIBRARY
Standard C library (libc, -lc)
π SYNOPSIS
#include <sys/syscall.h> /* Definition of SYS_* constants */
#include <unistd.h>
int syscall(SYS__llseek, unsigned int fd, unsigned long offset_high,
unsigned long offset_low, loff_t *result,
unsigned int whence);
π DESCRIPTION
okay so bestie, the _llseek() system call repositions the offset of the open file description associated with the file descriptor fd, and it sets it to this value right here:
(offset_high << 32) | offset_low
That new offset? It's a byte offset, and it's relative to one of three places β the beginning of the file, the current file offset, or the end of the file β depending on whether whence is SEEK_SET, SEEK_CUR, or SEEK_END, respectively. Like, pick your vibe, that's where the cursor lands β¨
The new file offset gets returned in the argument result. And the type loff_t? It's a 64-bit signed type, no cap.
This system call exists on various 32-bit platforms to support seeking to large file offsets. iconic behavior for the 32-bit girlies, honestly π
π₯ RETURN VALUE
Upon successful completion, _llseek() returns 0. Otherwise, a value of -1 is returned and errno is set to indicate the error. so like, 0 = slay, -1 = check errno, fr fr π
π ERRORS
EBADFβfdis not an open file descriptor. it's giving "who is she" πEFAULTβ Problem with copying results to user space. the copy just did NOT make it πEINVALβwhenceis invalid. wrongwhence, bestie, that's not a thing π«
π¦ VERSIONS
You probably want to use the lseek(2) wrapper function instead. periodt π
π STANDARDS
Linux.
π SEE ALSO
okay that's the whole page, mwah π this was pulled straight from Linux man-pages 6.20, dated 2026-06-13, and it's the _llseek(2) page specifically β go forth and seek responsibly, bestie πβ¨
π¦ where this page comes from
- arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages 6.20
- π the page's license: Linux-man-pages-copyleft
- Copyright 1995, Andries E. Brouwer <aeb@cwi.nl>
- Copyright 2007-2020, Michael Kerrisk <mtk.manpages@gmail.com>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms