summaryrefslogtreecommitdiffstats
path: root/doc/elf_ndxscn.3
diff options
context:
space:
mode:
authorAaron Merey <[email protected]>2024-06-19 13:16:58 -0400
committerAaron Merey <[email protected]>2024-06-19 13:16:58 -0400
commit545515c536df5739314317e0b28472fb54461860 (patch)
tree315ded20c80d8921776bd2f256e9cefb1492da43 /doc/elf_ndxscn.3
parentfe5990c7a87ee0ac5b405e721f0f904a798d5feb (diff)
Add remaining libelf manpagesupstream/users/amerey/manpages
Chatgpt-generated. Human editing still required.
Diffstat (limited to 'doc/elf_ndxscn.3')
-rw-r--r--doc/elf_ndxscn.361
1 files changed, 61 insertions, 0 deletions
diff --git a/doc/elf_ndxscn.3 b/doc/elf_ndxscn.3
new file mode 100644
index 00000000..750b1619
--- /dev/null
+++ b/doc/elf_ndxscn.3
@@ -0,0 +1,61 @@
+.TH ELF_NDXSCN 3 "June 2024" "Elfutils" "Library Functions Manual"
+
+.SH NAME
+elf_ndxscn \- retrieve the index of a section descriptor for an ELF file
+
+.SH SYNOPSIS
+.B #include <libelf.h>
+
+.BI "size_t elf_ndxscn(Elf_Scn *" scn ");"
+
+.SH DESCRIPTION
+The .B elf_ndxscn function retrieves the index of the section descriptor referred to by .I scn within the ELF object. Section indices are used to identify sections in an ELF file.
+
+.SH PARAMETERS
+.TP
+.I scn
+An .I Elf_Scn pointer to the section descriptor whose index is to be retrieved. The section descriptor must be valid.
+
+.SH RETURN VALUE
+The .B elf_ndxscn function returns the index of the section descriptor. If an error occurs, it returns .B SHN_UNDEF.
+
+.SH ERRORS
+If .B elf_ndxscn fails, it sets the following error codes:
+
+.TP
+.B ELFARG
+The .I scn parameter is NULL or invalid.
+
+.TP
+.B ELFERR
+An unspecified internal error occurred.
+
+.SH EXAMPLES
+.B "Example 1: Retrieve the index of a section descriptor"
+.nf
+.in +4
+#include <libelf.h>
+
+Elf *elf = ...; // Assume elf is a valid Elf pointer
+Elf_Scn *scn = ...; // Assume scn is a valid section descriptor
+
+size_t index = elf_ndxscn(scn);
+if (index == SHN_UNDEF) {
+ // Handle error
+}
+.in -4
+.fi
+
+.SH SEE ALSO
+.BR elf_getscn (3),
+.BR elf_nextscn (3),
+.BR elf (3),
+.BR libelf (3)
+
+.SH AUTHORS
+Elfutils was written by the Elfutils development team.
+
+.SH COPYRIGHT
+Copyright © 2024 Elfutils Development Team.
+This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+