Created
January 30, 2013 09:40
-
-
Save shugo/4671992 to your computer and use it in GitHub Desktop.
rsock_unix_sockaddr_len
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
socklen_t | |
rsock_unix_sockaddr_len(VALUE path) | |
{ | |
#ifdef __linux__ | |
if (RSTRING_PTR(path)[0] == '\0') { | |
/* abstract namespace; see unix(7) for details. */ | |
return (socklen_t) offsetof(struct sockaddr_un, sun_path) + | |
RSTRING_LEN(path); | |
} | |
else { | |
#endif | |
return (socklen_t) sizeof(struct sockaddr_un); | |
#ifdef __linux__ | |
} | |
#endif | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment