find_cpio_data(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– find_cpio_data(9) πŸ’–

okay so this is the Kernel API Manual entry for find_cpio_data, and it is literally here to search for files in an uncompressed cpio. no cap, that is the whole vibe. ✨


🌸 NAME 🌸

find_cpio_data β€” search for files in an uncompressed cpio. periodt. πŸ’…

πŸ¦‹ SYNOPSIS πŸ¦‹

struct cpio_data find_cpio_data (const char *path , void *data , size_t
       len , long *nextoff );

πŸŽ€ ARGUMENTS πŸŽ€

  • path β€” the directory to search for, including a slash at the end. bestie, do not forget that trailing slash. πŸ™ˆ
  • data β€” pointer to the cpio archive or a header inside.
  • len β€” remaining length of the cpio based on data pointer. keep it accurate, okay? πŸ’…
  • nextoff β€” when a matching file is found, this is the offset from the beginning of the cpio to the beginning of the next file, not the matching file itself. It can be used to iterate through the cpio to find all files inside of a directory path. lowkey iconic for looping through a directory. πŸ”₯

🌈 RETURN 🌈

It returns a struct cpio_data containing the address, length and filename (with the directory path cut off) of the found file. yup, that is the little package you get back. 🎁

If you search for a filename and not for files in a directory, pass the absolute path of the filename in the cpio and make sure the match returned an empty filename string. that detail is highkey important, so do not skip it. πŸ’€

πŸ¦‹ SEE ALSO πŸ¦‹

  • Kernel file ./lib/earlycpio.c πŸ‘€

mwah πŸ’‹ this page is from source/version ./lib, dated October 2026, and it is literally find_cpio_data(9). byeee bestie 🫢

πŸ“¦ where this page comes from