> It's always bugged me that AF_UNIX addresses have a relatively short length limit.
I agree, it's not pretty. Some unixes have an extremely short limit, so short you can't really use absolute paths portably unless in somewhere like /tmp.
But there is a workaround.
The path doesn't have to be absolute, so if you chdir(2) first and use a relative name with bind() and connect(); that gets you a socket in any directory.
(See also bindat() and connectat() in FreeBSD).
If you don't want to chdir(), you can make a temporary symbolic link in /tmp to your directory of choice for bind(), and directly to the socket for connect().
If the last path component is too long for bind(), renaming afterwards may work (or hard linking on the same filesystem then unlinking).
All the above assumes that AF_UNIX sockets are indexed by the inode on the filesystem, so different paths, rename etc work. I'm not sure if that is true on every old and weird kernel, if you're going for high portability.