diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-08-15 08:19:04 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-08-15 08:45:15 -0700 |
commit | 35a94efcc6eb5a844c0e463fe0be88cd882099a8 (patch) | |
tree | c8b0211978c15c2857c17bdcdda6276fe6a7042c /txr.1 | |
parent | e447b1ad43730410ec96cda54c580c043885b530 (diff) | |
download | txr-35a94efcc6eb5a844c0e463fe0be88cd882099a8.tar.gz txr-35a94efcc6eb5a844c0e463fe0be88cd882099a8.tar.bz2 txr-35a94efcc6eb5a844c0e463fe0be88cd882099a8.zip |
getaddrinfo: implement canonname.
Paul A. Patience noted that the canonname_s variable is not
used in the C code. This indicates that the AI_CANONNAME
functionality of getaddrinfo isn't implemented. Let's do that.
* stdlib/socket.tl (sockaddr): New slot, canonname.
(addrinfo): Default canonname to nil, not 0, since it is
a string that may be absent.
* socket.c (getaddrinfo_wrap): If the first address object has
a non-null ai_canonname and it was requested via the flags,
then stick that name into every returned structure.
* txr.1: Documented.
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 27 |
1 files changed, 25 insertions, 2 deletions
@@ -70174,6 +70174,7 @@ newly created datagram socket which is returned. .coNP Structure @ sockaddr .synb .mets (defstruct sockaddr nil +.mets \ \ canonname .mets \ \ (:static family nil)) .syne .desc @@ -70186,11 +70187,22 @@ several other types are derived: and .codn sockaddr-un . -It has a single slot called +It has a single static slot named .code family -which is static, and initialized to +and a single instance slot +.codn canonname , +both initialized to .codn nil . +Note: the +.code canonname +slot is optionally by the +.code getaddrinfo +function on address structures that it returns, if requested via the +.code ai-canonname +flag. The slot only provides information to the application, playing no +semantic role in addressing. + .coNP Structure @ sockaddr-in .synb .mets (defstruct sockaddr-in sockaddr @@ -70372,6 +70384,7 @@ flags: values given by the variables. .codn ai-passive , .codn ai-numerichost , .codn ai-v4mapped , +.codn ai-canonname , .codn ai-all , .code ai-addrconfig and @@ -70381,6 +70394,16 @@ These correspond to the C constants .code AI_NUMERICHOST and so forth. +If +.code ai-canonname +is specified, then every returned address structure will have its +.code canonname +member set to a string value rather than +.codn nil . +This string is a copy of the canonical name reported by the underlying +C library function, which that function places only into the first +returned address structure. + The .code family slot holds an address family, which may be the value of |