Lines Matching refs:sock
61 int sock;
63 sock = socket(PF_LOCAL, SOCK_STREAM, 0);
64 if (sock < 0) {
75 if (bind(sock, (struct sockaddr *) addr, size) < 0) {
81 return sock;
87 int sock;
89 sock = socket(PF_INET, SOCK_STREAM, 0);
90 if (sock < 0) {
100 if (bind(sock, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
106 return sock;
880 int sock;
881 sock = accept(waiter->fd, 0, 0);
882 if (sock < 0) {
888 client->ctrl_fd = sock;
891 add_waiter(sock, POLLIN | POLLHUP, client_ctrl_handler, client);
899 int sock;
900 sock = accept(waiter->fd, 0, 0);
901 if (sock < 0) {
907 pending->fd = sock;
909 add_waiter(sock, POLLIN, inet_pending_handler, pending);
934 int sock = make_local_socket(sockname);
935 if (sock < 0)
936 return sock;
937 if (fcntl(sock, F_SETFL, O_NONBLOCK) < 0) {
942 if (listen(sock, 4) < 0) {
947 add_waiter(sock, POLLIN, local_handler, NULL);
950 int sock = make_inet_socket(port);
951 if (sock < 0)
952 return sock;
953 if (fcntl(sock, F_SETFL, O_NONBLOCK) < 0) {
958 if (listen(sock, 4) < 0) {
963 add_waiter(sock, POLLIN, inet_handler, NULL);