From: Aaron Merey Date: Sun, 14 Sep 2025 23:21:02 +0000 (-0400) Subject: doc: Add gelf_getehdr.3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dff5fdd2e66e33756e3479f300f57f0f2b595594;p=thirdparty%2Felfutils.git doc: Add gelf_getehdr.3 Signed-off-by: Aaron Merey --- diff --git a/doc/Makefile.am b/doc/Makefile.am index 1230480e..3c22f0aa 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -92,6 +92,7 @@ notrans_dist_man3_MANS= elf32_checksum.3 \ elf_update.3 \ elf_version.3 \ gelf_getclass.3 \ + gelf_getehdr.3 \ libelf.3 # libdebuginfod man pages (also notrans) diff --git a/doc/gelf_getehdr.3 b/doc/gelf_getehdr.3 new file mode 100644 index 00000000..0ff715eb --- /dev/null +++ b/doc/gelf_getehdr.3 @@ -0,0 +1,62 @@ +.TH GELF_GETEHDR 3 2025-09-14 "Libelf" "Libelf Programmer's Manual" + +.SH NAME +gelf_getehdr \- retrieve the header of an ELF binary as a class\-independent structure + +.SH SYNOPSIS +.nf +.B #include + +.BI "GElf_Ehdr *gelf_getehdr(Elf *" elf ", GElf_Ehdr *" dest " );" +.fi + +.SH DESCRIPTION +.B gelf_getehdr() +retrieve the ELF header of the binary referenced by +.I elf +as a class\-independent +.B GElf_Ehdr +representation. + +.SH PARAMETERS +.TP +.I elf +Pointer to an ELF descriptor. +.TP +.I dest +Pointer to a caller\-provided +.B GElf_Ehdr +structure that will receive the translated file header. Must not be +NULL. On success, the function stores the header in +.IR *dest . + +.SH RETURN VALUE +On success, returns +.IR dest . +On failure, returns +.B NULL +and sets elf_errno. If +.I elf +is NULL, NULL is returned and elf_errno is not set. + +.SH SEE ALSO +.BR gelf_newehdr (3), +.BR gelf_update_ehdr (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_getehdr () +T} Thread safety MT-Safe +.TE + +.SH REPORTING BUGS +Report bugs to or https://sourceware.org/bugzilla/.