HESIOD(3)
π HESIOD(3) π
okay bestie, welcome to the Library Functions Manual era, we're doing Hesiod today and honestly? it's giving vintage but make it useful. β¨
πΈ NAME πΈ
hesiod_getmailhost, hesiod_free_postoffice β Hesiod functions for retrieving user to postoffice mappings π«Ά
β¨ SYNOPSIS β¨
#include <hesiod.h>
struct hesiod_postoffice *hesiod_getmailhost(void *context,
const char *user)
void hesiod_free_postoffice(void *context,
struct hesiod_postoffice *po)
cc file.c -lhesiod
π¦ DESCRIPTION π¦
so this whole little family of functions lets you pull user β postoffice mappings using Hesiod. iconic behavior, no cap. π
but before you can do literally any lookups, you need an initialized Hesiod context β go read hesiod(3) for the deets on that, i'm not gatekeeping but that's a different page, bestie. π
the info comes back to you inside a hesiod_postoffice structure, and it has these fields:
hesiod_po_typeβ the type of postoffice box, typically ``POP''. it's giving very specific. πhesiod_po_hostβ the hostname where the postoffice box resides. that's its home, its main character address. πhesiod_po_nameβ the account name on the given postoffice server.
β οΈ and this part is on you, fr fr: it is the caller's responsibility to call hesiod_free_postoffice with the returned postoffice entry to free the resources used by the postoffice entry. don't just walk away from it, that's rude and also a memory leak. π
so how does the actual lookup work? Hesiod queries for postoffice information are made using the ``pobox'' Hesiod type, using the username as the Hesiod name. and the corresponding entries should be space-separated lists of strings giving:
- the type of postoffice box
- the hostname
- the account name
three little strings, one slay little list. β
π RETURN VALUES π
on failure, hesiod_getservbyname returns NULL and sets the global variable errno to indicate the error. (yes, that's the name the page says β i'm not editing the lore, i'm just reporting it. π)
π ERRORS π
hesiod_getmailhost may fail for any of the reasons the routine hesiod_resolve may fail. that's it, that's the whole tea β go check hesiod_resolve if you want the receipts. π₯
π§ SEE ALSO π§
and that's the page, bestie!! this cutie dropped on 30 November 1996 as part of the HESIOD(3) library functions manual energy β vintage queen behavior, we respect her. πβ¨π
π¦ where this page comes from
- centos-stream 9: hesiod-devel 3.2.1-16.el9 Β· MIT
- centos-stream 9: hesiod-devel 3.2.1-16.el9 Β· MIT
- debian bookworm: libhesiod-dev 3.2.1-4
- debian trixie: libhesiod-dev 3.2.1-5
- ubuntu jammy: libhesiod-dev 3.2.1-3.1build1
- ubuntu noble: libhesiod-dev 3.2.1-4build1
- ubuntu questing: libhesiod-dev 3.2.1-5
- ubuntu resolute: libhesiod-dev 3.2.1-5build1
- ubuntu stonking: libhesiod-dev 3.2.1-5build1
- Copyright 1996 by the Massachusetts Institute of Technology
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms