Lines Matching refs:sock
35 int sock; member
50 _cleanup_close_ int sock = -1; in udev_ctrl_new_from_fd() local
56 sock = socket(AF_UNIX, SOCK_SEQPACKET|SOCK_NONBLOCK|SOCK_CLOEXEC, 0); in udev_ctrl_new_from_fd()
57 if (sock < 0) in udev_ctrl_new_from_fd()
67 .sock = fd >= 0 ? fd : TAKE_FD(sock), in udev_ctrl_new_from_fd()
90 if (bind(uctrl->sock, &uctrl->saddr.sa, uctrl->addrlen) < 0) in udev_ctrl_enable_receiving()
93 if (listen(uctrl->sock, 0) < 0) in udev_ctrl_enable_receiving()
114 safe_close(uctrl->sock); in udev_ctrl_free()
221 _cleanup_close_ int sock = -1; in udev_ctrl_event_handler() local
227 sock = accept4(fd, NULL, NULL, SOCK_CLOEXEC|SOCK_NONBLOCK); in udev_ctrl_event_handler()
228 if (sock < 0) { in udev_ctrl_event_handler()
236 r = getpeercred(sock, &ucred); in udev_ctrl_event_handler()
248 r = setsockopt_int(sock, SOL_SOCKET, SO_PASSCRED, true); in udev_ctrl_event_handler()
252 …r = sd_event_add_io(uctrl->event, &uctrl->event_source_connect, sock, EPOLLIN, udev_ctrl_connectio… in udev_ctrl_event_handler()
263 uctrl->sock_connect = TAKE_FD(sock); in udev_ctrl_event_handler()
285 …r = sd_event_add_io(uctrl->event, &uctrl->event_source, uctrl->sock, EPOLLIN, udev_ctrl_event_hand… in udev_ctrl_start()
311 if (connect(uctrl->sock, &uctrl->saddr.sa, uctrl->addrlen) < 0) in udev_ctrl_send()
316 if (send(uctrl->sock, &ctrl_msg_wire, sizeof(ctrl_msg_wire), 0) < 0) in udev_ctrl_send()
331 if (uctrl->sock < 0) in udev_ctrl_wait()
351 r = sd_event_add_io(uctrl->event, &source_io, uctrl->sock, EPOLLIN, NULL, INT_TO_PTR(0)); in udev_ctrl_wait()