FREEBSD::ADDRINFO_UP(3)
π 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
- Copyright (c) 2025 Chelsio Communications, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms