STRUCT LIVEUPDATE_IOCTL_RETRIEVE_SESSION(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ‘‘ STRUCT LIVEUPDATE_IOCTL_RETRIEVE_SESSION(9) πŸ‘‘

okay bestie, buckle up β€” this is a Kernel API Manual page, and it's literally about the ioctl(LIVEUPDATE_IOCTL_RETRIEVE_SESSION) call. it's giving "your session survived a kernel transplant and now you want it back" energy πŸ’«


✨ NAME ✨

struct liveupdate_ioctl_retrieve_session β€” ioctl(LIVEUPDATE_IOCTL_RETRIEVE_SESSION) 🫢


🌸 SYNOPSIS 🌸

struct liveupdate_ioctl_retrieve_session {
    __u32 size;
    __s32 fd;
    __u8 name[LIVEUPDATE_SESSION_NAME_LENGTH];
 };

πŸŽ€ Members πŸŽ€

  • size β€” Input; literally just sizeof(struct liveupdate_ioctl_retrieve_session). you tell the kernel how big your struct is, it's polite like that πŸ’…
  • fd β€” Output; the brand new file descriptor for the session you retrieved. the main character of the whole operation tbh πŸ‘‘
  • name β€” Input; a null-terminated string that identifies the session you're trying to retrieve. and bestie, it has to exactly match the name that was used when that session was created in the previous kernel. no vibes-based matching, no "close enough" β€” exact or nothing 🧚

πŸ”₯ DESCRIPTION πŸ”₯

So what does this do? it retrieves a handle β€” a new file descriptor β€” for a preserved session, found by its name. that's the whole thing. and ngl, this is the primary mechanism for a userspace agent to regain control of its preserved resources after a live update. the comeback era fr fr 🌈

Here's how it goes down: your userspace application hands over the null-terminated name of a session it created before the live update. if a preserved session with a matching name is found, the kernel instantiates it and returns a new file descriptor in the fd field. this new session FD can then be used for all the file-specific operations β€” like restoring individual file descriptors with LIVEUPDATE_SESSION_RETRIEVE_FD. iconic. no cap πŸ’–

And like... it is the responsibility of the userspace application to know the names of the sessions it needs to retrieve. the kernel is not your notes app, it's not reminding you. so write them down, bestie πŸ“

If no session with the given name is found, the ioctl will fail with -ENOENT. that's the "nothing here, girl" error 😭

okay important vibe check: this ioctl can only be called on the main /dev/liveupdate device, and only when the system is in the LIVEUPDATE_STATE_UPDATED state. wrong device or wrong state and it's not happening, periodt πŸ’€

πŸ¦‹ SEE ALSO πŸ¦‹

  • Kernel file ./include/uapi/linux/liveupdate.h
  • General ioctl format(9)
  • struct liveupdate_ioctl_create_session(9)
  • struct liveupdate_session_preserve_fd(9)
  • struct liveupdate_session_retrieve_fd(9)
  • struct liveupdate_session_finish(9)
  • struct liveupdate_session_get_name(9)

these are your girls, go read them too, iykyk ✨


🌸 okay that's the whole page, mwah! this one lives at ./include/uapi/linux, it's dated October 2026, and it's filed under struct liveu...ieve_session(9). go forth and retrieve your sessions, you absolute legend πŸ’œπŸŽ€

πŸ“¦ where this page comes from