Next: posix socket addresses in, Up: posix socket addresses [Index]
Instances of struct sockaddr_un
can be handled at the Scheme
level as follows:
(import (vicare) (prefix (vicare posix) px.)) (define sockaddr (px.make-sockaddr_un "/tmp/the-unix-socket")) (px.sockaddr_un.pathname/string sockaddr) ⇒ "/tmp/the-unix-socket"
care must be taken when handling such raw values.
Given a pathname representing the pathname of a local socket,
build and return a bytevector holding the struct sockaddr_un
representing it.
Given a bytevector socket_address, which must be the return value
of a previous call to make-sockaddr_un
, holding a struct
sockaddr_un
: sockaddr_un.pathname
builds and returns a
bytevector holding the corresponding socket pathname,
sockaddr_un.pathname/string
builds and returns a string holding
the corresponding socket pathname. If the data in socket_address
is invalid: an exception is raised.