Signed-off-by: Aaron Merey <[email protected]>
---
doc/Makefile.am | 3 ++-
doc/elf_kind.3 | 71 +++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 73 insertions(+), 1 deletion(-)
create mode 100644 doc/elf_kind.3
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 260a3f09..8028acb0 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -62,7 +62,8 @@ notrans_dist_man3_MANS= elf_update.3 \
elf_end \
elf_fill \
elf_getbase \
- elf_hash
+ elf_hash \
+ elf_kind
# libdebuginfod man pages (also notrans)
# Note we include them even when not building them because we want
diff --git a/doc/elf_kind.3 b/doc/elf_kind.3
new file mode 100644
index 00000000..3caa2724
--- /dev/null
+++ b/doc/elf_kind.3
@@ -0,0 +1,71 @@
+.TH ELF_KIND 3 2025-03-31 "Libelf" "Libelf Programmer's Manual"
+
+.SH NAME
+elf_kind \- Determine the type of file represented by an ELF descriptor.
+
+.SH SYNOPSIS
+.nf
+#include <libelf.h>
+
+.BI "Elf_Kind elf_kind(Elf *" elf ");"
+
+.SH DESCRIPTION
+The
+.B elf_kind
+function determines the file type of the file represented by
+.IR elf .
+This type identifies whether the descriptor represents an
+ELF object, an archive member, or some other type of file.
+
+.SH PARAMETERS
+.TP
+.I elf
+The ELF descriptor.
+
+.SH RETURN VALUE
+The file type of the file represented by
+.IR elf .
+The possible return value are
+
+.RS
+.TP
+.PD 0
+.TP
+.TP
+.B ELF_K_NONE
+Unknown file type.
+
+.TP
+.B ELF_K_AR
+Archive member.
+
+.TP
+.B ELF_K_COFF
+COFF object file.
+
+.TP
+.B ELF_K_ELF
+ELF object file.
+
+
+.SH SEE ALSO
+.BR libelf (3),
+.BR elf (5)
+
+.SH ATTRIBUTES
+For an explanation of the terms used in this section, see
+.BR attributes (7).
+.TS
+allbox;
+lbx lb lb
+l l l.
+Interface Attribute Value
+T{
+.na
+.nh
+.BR elf_kind ()
+T} Thread safety MT-Safe
+.TE
+
+.SH REPORTING BUGS
+Report bugs to <[email protected]> or
https://sourceware.org/bugzilla/.
--
2.49.0