huenfrplsv
#ifndef NO_UDOM_SUPPORT static int udom_open(const char *path, int flags) { struct sockaddr_un sou; int fd; unsigned int len; bzero(&sou, sizeof(sou)); /* * Construct the unix domain socket address and attempt to connect */ fd = socket(AF_UNIX, SOCK_STREAM, 0); if (fd >= 0) { sou.sun_family = AF_UNIX; if ((len = strlcpy(sou.sun_path, path, sizeof(sou.sun_path))) >= sizeof(sou.sun_path)) { errno = ENAMETOOLONG; return (-1); } len = offsetof(struct sockaddr_un, sun_path[len+1]); if (connect(fd, (void *)&sou, len) < 0) { close(fd); fd = -1; } } /* * handle the open flags by shutting down appropriate directions */ if (fd >= 0) { switch(flags & O_ACCMODE) { case O_RDONLY: if (shutdown(fd, SHUT_WR) == -1) warn(NULL); break; case O_WRONLY: if (shutdown(fd, SHUT_RD) == -1) warn(NULL); break; default: break; } } return(fd); } #endif

Elapsed time 00:00
Total errors 0
Not corrected 0
Accuracy -
Gross WPM ? -
Net WPM ? -
Press Esc to close this popup or F5 to restart practicing!

Words   Numbers   Texts   Lorem ipsum   Poems   Sourcecode   Custom text