GELF_GETPHDR(3)

πŸ“¦
version 0.197 Β· 2 versions
, in alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, fedora 43, fedora 44, nixpkgs unstable, ubuntu stonking

πŸ’– GELF_GETPHDR(3) πŸ’–

okay bestie, welcome to the Libelf Programmer's Manual ✨ this one is literally called gelf_getphdr and it's here to hand you program header table entries that don't care about class 🫢


🌸 NAME 🌸

gelf_getphdr β€” Retrieve class-independent program header table entries for an ELF object file


✨ SYNOPSIS ✨

#include <gelf.h>

GElf_Phdr *gelf_getphdr (Elf *elf, int ndx, GElf_Phdr *dst);

πŸ¦‹ DESCRIPTION πŸ¦‹

so basically πŸ’… you're retrieving the class-independent program header table entry sitting at index ndx inside the ELF descriptor elf, and you're stashing it in dst. that's the whole vibe. slay.

and if you're like "okay but how many entries even are there tho" β€” go check elf_getphdrnum(3), it tells you exactly how to acquire the number of entries in the program header table. no cap. πŸ‘‘


πŸŽ€ PARAMETERS πŸŽ€

  • elf β€” the ELF descriptor of kind ELF_K_ELF that you're pulling the program header table entry out of 🧚
  • ndx β€” the index of the program header table entry you want, like a lil number ticket 🎟️
  • dst β€” pointer to a GElf_Phdr that you provide, bestie, and it receives the requested program header table entry πŸ’–

⭐ RETURN VALUE ⭐

on success? the requested entry gets copied into dst and then dst is returned. iconic. βœ…

on failure? NULL comes back and elf_errno gets set. 😭

and if elf is NULL? then NULL is returned and elf_errno is not set. like, we're not even gonna touch it. πŸ™ˆ


🌈 SEE ALSO 🌈

elf32_getphdr(3), elf64_getphdr(3), elf_getphdrnum(3), gelf_newphdr(3), gelf_update_phdr(3), libelf(3), elf(5)


πŸ‘‘ ATTRIBUTES πŸ‘‘

  • Interface: gelf_getphdr()
  • Attribute: Thread safety
  • Value: MT-Safe

so yeah, she's thread-safe, she can hang with everybody at once πŸ’…βœ¨


πŸ’€ REPORTING BUGS πŸ’€

found a bug? don't gatekeep, tell somebody fr fr:


and that's the whole page, bestie!! this lil manual page came to you from Libelf, dated 2025-12-23, and it's giving GELF_GETPHDR(3) energy all the way through πŸ’œπŸ¦‹πŸŒΈ periodt ✨

πŸ“¦ where this page comes from