_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 β€” fd is 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 β€” whence is invalid. wrong whence, bestie, that's not a thing 🚫

πŸ¦‹ VERSIONS

You probably want to use the lseek(2) wrapper function instead. periodt πŸ’…


πŸ‘‘ STANDARDS

Linux.


🌈 SEE ALSO

llseek(3), lseek(2), open(2)


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
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms