FREEBSD::ADDRINFO_UP(3)

πŸ“¦ version 15.1, in freebsd 15.1

πŸ’– NAME πŸ’–

hey bestie, welcome to FREEBSD::ADDRINFO_UP(3) from the Library Functions Manual πŸ’… okay so freebsd::addrinfo_up β€” it’s a std::unique_ptr specialization for lists of socket addresses. That’s the whole name vibe, no cap ✨

πŸŽ€ LIBRARY πŸŽ€

library libutil++ β€” yes, that’s where this cutie lives 🫢

🌈 SYNOPSIS 🌈

#include <libutil++.hh>

using addrinfo_up = std::unique_ptr<addrinfo, freeaddrinfo_deleter>;

πŸ¦‹ DESCRIPTION πŸ¦‹

So this class is a specialization of std::unique_ptr for socket addresses returned by getaddrinfo(3) β€” main character energy fr fr πŸ”₯

When a list of socket addresses managed by an instance of this class is disposed, freeaddrinfo(3) is invoked to dispose of the list. That’s the disposal pipeline, bestie β€” it’s giving managed cleanup πŸ’œ

⭐ EXAMPLES ⭐

Here’s the example exactly as the page serves it β€” copy-paste ready, iykyk πŸ“

             freebsd::addrinfo_up
             resolve_address(const char *address, const char *port)
             {
                     struct addrinfo hints, *ai;
                     int error;

                     memset(&hints, 0, sizeof(hints));
                     hints.ai_family = AF_UNSPEC;
                     hints.ai_socktype = SOCK_STREAM;
                     error = getaddrinfo(address, port, &hints, &ai);
                     if (error != 0)
                             return {};
                     return freebsd::addrinfo_up(ai);
             }

πŸ’œ SEE ALSO πŸ’œ

  • getaddrinfo(3) β€” the icon that brought the addresses to the function, iykyk πŸ‘‘

that’s the whole page, bestie 🫢 source/version: Debian Β· date: July 31, 2025 Β· FREEBSD::ADDRINFO_UP(3) β€” slay responsibly πŸ’…βœ¨

πŸ“¦ where this page comes from
  • freebsd 15.1: base 15.1
  • πŸ“œ the page's license: BSD-2-Clause
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms