]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
doc: Add gelf_getehdr.3
authorAaron Merey <amerey@redhat.com>
Sun, 14 Sep 2025 23:21:02 +0000 (19:21 -0400)
committerAaron Merey <amerey@redhat.com>
Tue, 16 Sep 2025 20:56:07 +0000 (16:56 -0400)
Signed-off-by: Aaron Merey <amerey@redhat.com>
doc/Makefile.am
doc/gelf_getehdr.3 [new file with mode: 0644]

index 1230480e345524d7747c6c3c8ded3ddd2023bfd2..3c22f0aa00e268c46688eff92495c030dde94995 100644 (file)
@@ -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 (file)
index 0000000..0ff715e
--- /dev/null
@@ -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 <gelf.h>
+
+.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 <elfutils-devel@sourceware.org> or https://sourceware.org/bugzilla/.