From: Aaron Merey Date: Thu, 1 Jan 2026 02:50:26 +0000 (-0500) Subject: doc: Add gelf_getphdr.3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bb411225e511302272aedf8ad086a07319412506;p=thirdparty%2Felfutils.git doc: Add gelf_getphdr.3 Signed-off-by: Aaron Merey --- diff --git a/doc/Makefile.am b/doc/Makefile.am index db699a22..b0825ca6 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -94,6 +94,7 @@ notrans_dist_man3_MANS= elf32_checksum.3 \ gelf_fsize.3 \ gelf_getclass.3 \ gelf_getehdr.3 \ + gelf_getphdr.3 \ gelf_getrel.3 \ gelf_getrela.3 \ gelf_getversym.3 \ diff --git a/doc/gelf_getphdr.3 b/doc/gelf_getphdr.3 new file mode 100644 index 00000000..c28f15fc --- /dev/null +++ b/doc/gelf_getphdr.3 @@ -0,0 +1,73 @@ +.TH GELF_GETPHDR 3 2025-12-23 "Libelf" "Libelf Programmer's Manual" + +.SH NAME +gelf_getphdr \- Retrieve class-independent program header table entries for an ELF object file + +.SH SYNOPSIS +.nf +.B #include + +.BI "GElf_Phdr *gelf_getphdr (Elf *" elf ", int " ndx ", GElf_Phdr *" dst ");" + +.SH DESCRIPTION +Retrieve the class-independent program header table entry at index +.I ndx +for ELF descriptor +.I elf +and store it in +.IR dst . +See +.BR elf_getphdrnum (3) +for information on how to acquire the number of entries in the program header +table. + +.SH PARAMETERS +.TP +.I elf +ELF descriptor of kind +.B ELF_K_ELF +from which to retrieve the program header table entry. + +.TP +.I ndx +The index of the program header table entry to be retrieved. + +.TP +.I dst +Pointer to a caller\-provided +.B GElf_Phdr +that will receive the requested program header table entry. + +.SH RETURN VALUE +On success, the requested entry is copied into +.I dst +and +.I dst is returned. +On failure, NULL is returned and elf_errno is set. If +.I elf +is NULL, then NULL is returned and elf_errno is not set. + +.SH SEE ALSO +.BR elf32_getphdr (3), +.BR elf64_getphdr (3), +.BR elf_getphdrnum (3), +.BR gelf_newphdr (3), +.BR gelf_update_phdr (3), +.BR libelf (3), +.BR elf (5) + +.SH ATTRIBUTES +.TS +allbox; +lbx lb lb +l l l. +Interface Attribute Value +T{ +.na +.nh +.BR gelf_getphdr () +T} Thread safety MT-Safe +.TE + +.SH REPORTING BUGS +Report bugs to or https://sourceware.org/bugzilla/.