find_cpio_data(9)
π 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 ondatapointer. 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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms