When creating a unix socket, the path name (man 7 unix
) is allowed to be maximally 108 chars long. For a friend this caused a bug in his program because his path was longer. Now we wonder how exactly that number was determined.
I have the suspicion that the number was determined so that sizeof
of that struct sockaddr_un
is unambiguous compared to the sizeof of other sockaddresses like sockaddr_in
. But if they wanted to avoid clashes with other sizeof values, why not use a prime number for example? Can someone please provide an authorative source for that?