Searched refs:sockfd (Results 1 - 25 of 46) sorted by relevance

12

/freebsd-current/usr.sbin/nscd/
H A Dsingletons.h36 int sockfd; member in struct:runtime_env
H A Dnscdcli.h36 int sockfd; member in struct:nscd_connection_
H A Dnscdcli.c72 s_result = write(connection->sockfd,
109 s_result = read(connection->sockfd,
155 EV_SET(&eventlist, connection->sockfd, EVFILT_WRITE, EV_ADD,
161 result = sendmsg(connection->sockfd, &mhdr, 0) == -1 ? -1 : 0;
162 EV_SET(&eventlist, connection->sockfd, EVFILT_WRITE, EV_ADD,
204 retval->sockfd = client_socket;
209 EV_SET(&eventlist, retval->sockfd, EVFILT_WRITE, EV_ADD,
216 EV_SET(&eventlist, retval->sockfd, EVFILT_READ, EV_ADD,
231 close(connection->sockfd);
H A Dquery.h77 int sockfd; /* the unix socket to read/write */ member in struct:query_state
H A Dnscd.c166 retval->sockfd = socket(PF_LOCAL, SOCK_STREAM, 0);
178 if (bind(retval->sockfd, (struct sockaddr *)&serv_addr,
180 close(retval->sockfd);
196 listen(retval->sockfd, -1);
197 fcntl(retval->sockfd, F_SETFL, O_NONBLOCK);
202 EV_SET(&eventlist, retval->sockfd, EVFILT_READ, EV_ADD | EV_ONESHOT,
217 close(env->sockfd);
506 if ((int)event_data->ident == env->sockfd) {
510 EV_SET(eventlist, s_runtime_env->sockfd,
/freebsd-current/tests/sys/kqueue/libkqueue/
H A Dread.c19 static int sockfd[2]; variable
28 if (read(sockfd[0], &buf[0], 1) < 1)
36 if (write(sockfd[1], ".", 1) < 1)
48 EV_SET(&kev, sockfd[0], EVFILT_READ, EV_ADD, 0, 0, &sockfd[0]);
63 EV_SET(&kev, sockfd[0], EVFILT_READ, EV_ADD, 0, 0, &sockfd[0]);
92 EV_SET(&kev, sockfd[0], EVFILT_READ, EV_ADD | EV_CLEAR, 0, 0, &sockfd[0]);
109 EV_SET(&kev, sockfd[
[all...]
/freebsd-current/tools/test/stress2/misc/
H A Ddatagram.sh62 int sockfd;
70 if ((sockfd = socket(AF_UNIX, SOCK_DGRAM, 0)) == -1)
73 if (bind(sockfd, (struct sockaddr *) &addr,
77 if (connect(sockfd, (struct sockaddr *) &addr,
81 (void)read(sockfd, buf, sizeof(buf));
H A Ddatagram2.sh64 int sockfd;
71 if ((sockfd = socket(AF_UNIX, SOCK_DGRAM, 0)) == -1)
74 if (bind(sockfd, (struct sockaddr *) &addr,
78 if (connect(sockfd, (struct sockaddr *) &addr,
89 m.fd = sockfd;
90 len = sendmsg(sockfd, &mh, 0);
H A Ddatagram3.sh64 int i, sockfd;
71 if ((sockfd = socket(AF_UNIX, SOCK_DGRAM, 0)) == -1)
74 if (bind(sockfd, (struct sockaddr *) &addr,
78 if (connect(sockfd, (struct sockaddr *) &addr,
90 m.fd = sockfd;
91 len = sendmsg(sockfd, &mh, 0);
/freebsd-current/contrib/ldns/
H A Dnet.c113 ldns_sock_nonblock(int sockfd) argument
117 if((flag = fcntl(sockfd, F_GETFL)) != -1) {
119 if(fcntl(sockfd, F_SETFL, flag) == -1) {
125 if(ioctlsocket(sockfd, FIONBIO, &on) != 0) {
133 ldns_sock_block(int sockfd) argument
137 if((flag = fcntl(sockfd, F_GETFL)) != -1) {
139 if(fcntl(sockfd, F_SETFL, flag) == -1) {
145 if(ioctlsocket(sockfd, FIONBIO, &off) != 0) {
153 ldns_sock_wait(int sockfd, struct timeval timeout, int write) argument
160 FD_SET(FD_SET_T sockfd,
196 int sockfd; local
303 int sockfd; local
341 int sockfd; local
374 int sockfd; local
389 int sockfd; local
407 int sockfd; local
450 int sockfd; local
681 ldns_tcp_send_query(ldns_buffer *qbin, int sockfd, const struct sockaddr_storage *to, socklen_t tolen) argument
706 ldns_udp_send_query(ldns_buffer *qbin, int sockfd, const struct sockaddr_storage *to, socklen_t tolen) argument
721 ldns_udp_read_wire(int sockfd, size_t *size, struct sockaddr_storage *from, socklen_t *fromlen) argument
751 ldns_tcp_read_wire_timeout(int sockfd, size_t *size, struct timeval timeout) argument
810 ldns_tcp_read_wire(int sockfd, size_t *size) argument
[all...]
/freebsd-current/tests/sys/audit/
H A Dnetwork.c44 static int sockfd, sockfd2, connectfd; variable
123 ATF_REQUIRE((sockfd = socket(PF_UNIX, SOCK_STREAM, 0)) != -1);
124 /* Check the presence of sockfd in audit record */
125 snprintf(extregex, sizeof(extregex), "socket.*ret.*success,%d", sockfd);
127 close(sockfd);
215 ATF_REQUIRE((sockfd = socket(PF_UNIX, SOCK_STREAM, 0)) != -1);
216 /* Check the presence of sockfd in audit record */
218 "setsockopt.*0x%x.*return,success", sockfd);
221 ATF_REQUIRE_EQ(0, setsockopt(sockfd, SOL_SOCKET,
224 close(sockfd);
[all...]
/freebsd-current/contrib/ldns/ldns/
H A Dnet.h170 * \param[in] sockfd the socket to use
175 ssize_t ldns_tcp_send_query(ldns_buffer *qbin, int sockfd, const struct sockaddr_storage *to, socklen_t tolen);
181 * \param[in] sockfd the socket to use
186 ssize_t ldns_udp_send_query(ldns_buffer *qbin, int sockfd, const struct sockaddr_storage *to, socklen_t tolen);
192 * \param[in] sockfd the socket to read from
197 uint8_t *ldns_tcp_read_wire_timeout(int sockfd, size_t *size, struct timeval timeout);
204 * \param[in] sockfd the socket to read from
208 uint8_t *ldns_tcp_read_wire(int sockfd, size_t *size);
214 * \param[in] sockfd the socket to read from
220 uint8_t *ldns_udp_read_wire(int sockfd, size_
[all...]
/freebsd-current/contrib/ofed/libibverbs/examples/
H A Dxsrq_pingpong.c72 int sockfd; member in struct:pingpong_dest
320 int sockfd = ctx.rem_dest[index].sockfd; local
323 r = read(sockfd, msg + n, TERMINATION_MSG_SIZE - n);
345 int sockfd = ctx.rem_dest[index].sockfd; local
349 if (write(sockfd, msg, TERMINATION_MSG_SIZE) != TERMINATION_MSG_SIZE) {
384 static int send_local_dest(int sockfd, int index) argument
418 if (write(sockfd, msg, MSG_SIZE) != MSG_SIZE) {
426 static int recv_remote_dest(int sockfd, in argument
545 int sockfd = -1; local
596 int sockfd = -1, connfd; local
[all...]
H A Dud_pingpong.c136 int sockfd = -1; local
152 sockfd = socket(t->ai_family, t->ai_socktype, t->ai_protocol);
153 if (sockfd >= 0) {
154 if (!connect(sockfd, t->ai_addr, t->ai_addrlen))
156 close(sockfd);
157 sockfd = -1;
164 if (sockfd < 0) {
172 if (write(sockfd, msg, sizeof msg) != sizeof msg) {
177 if (read(sockfd, msg, sizeof msg) != sizeof msg ||
178 write(sockfd, "don
211 int sockfd = -1, connfd; local
[all...]
H A Duc_pingpong.c136 int sockfd = -1; local
152 sockfd = socket(t->ai_family, t->ai_socktype, t->ai_protocol);
153 if (sockfd >= 0) {
154 if (!connect(sockfd, t->ai_addr, t->ai_addrlen))
156 close(sockfd);
157 sockfd = -1;
164 if (sockfd < 0) {
172 if (write(sockfd, msg, sizeof msg) != sizeof msg) {
177 if (read(sockfd, msg, sizeof msg) != sizeof msg ||
178 write(sockfd, "don
213 int sockfd = -1, connfd; local
[all...]
H A Drc_pingpong.c163 int sockfd = -1; local
179 sockfd = socket(t->ai_family, t->ai_socktype, t->ai_protocol);
180 if (sockfd >= 0) {
181 if (!connect(sockfd, t->ai_addr, t->ai_addrlen))
183 close(sockfd);
184 sockfd = -1;
191 if (sockfd < 0) {
199 if (write(sockfd, msg, sizeof msg) != sizeof msg) {
204 if (read(sockfd, msg, sizeof msg) != sizeof msg ||
205 write(sockfd, "don
239 int sockfd = -1, connfd; local
[all...]
H A Dsrq_pingpong.c158 int sockfd = -1; local
174 sockfd = socket(t->ai_family, t->ai_socktype, t->ai_protocol);
175 if (sockfd >= 0) {
176 if (!connect(sockfd, t->ai_addr, t->ai_addrlen))
178 close(sockfd);
179 sockfd = -1;
186 if (sockfd < 0) {
195 if (write(sockfd, msg, sizeof msg) != sizeof msg) {
208 r = read(sockfd, msg + n, sizeof msg - n);
223 if (write(sockfd, "don
249 int sockfd = -1, connfd; local
[all...]
/freebsd-current/contrib/openbsm/bin/auditdistd/
H A Dproto_tls.c267 tls_loop(int sockfd, SSL *tcpssl) argument
277 FD_SET(sockfd, &fds);
279 maxfd = MAX(sockfd, tcpfd);
287 if (FD_ISSET(sockfd, &fds))
288 tcp_recv_ssl_send(sockfd, tcpssl);
290 ssl_recv_tcp_send(tcpssl, sockfd);
344 int sockfd, tcpfd; local
354 sockfd = startfd;
412 nonblock(sockfd);
422 switch (send(sockfd,
571 int error, sockfd; local
657 int sockfd, tcpfd, ret; local
714 int startfd, sockfd, tcpfd, safefd; local
[all...]
/freebsd-current/lib/libc/include/
H A Dnscachedcli.h63 int sockfd; member in struct:cached_connection_
/freebsd-current/stand/libsa/
H A Dbootparam.c104 bp_whoami(int sockfd) argument
133 if (!(d = socktodesc(sockfd))) {
134 RPC_PRINTF(("bp_whoami: bad socket. %d\n", sockfd));
232 bp_getfile(int sockfd, char *key, struct in_addr *serv_addr, char *pathname) argument
245 if (!(d = socktodesc(sockfd))) {
246 RPC_PRINTF(("bp_getfile: bad socket. %d\n", sockfd));
/freebsd-current/lib/libc/net/
H A Dnscachedcli.c77 s_result = _sendto(connection->sockfd, data + result,
120 s_result = _read(connection->sockfd, data + result,
168 EV_SET(&eventlist, connection->sockfd, EVFILT_WRITE, EV_ADD,
175 result = _sendmsg(connection->sockfd, &mhdr,
177 EV_SET(&eventlist, connection->sockfd, EVFILT_WRITE, EV_ADD,
218 retval->sockfd = client_socket;
223 EV_SET(&eventlist, retval->sockfd, EVFILT_WRITE, EV_ADD, 0, 0, NULL);
229 EV_SET(&eventlist, retval->sockfd, EVFILT_READ, EV_ADD, 0, 0, NULL);
240 _close(connection->sockfd);
/freebsd-current/contrib/capsicum-test/
H A Dsyscalls.h203 static inline int bind_(int sockfd, const struct sockaddr *addr, socklen_t addrlen) { argument
204 unsigned long args[3] = {(unsigned long)sockfd, (unsigned long)(intptr_t)addr, (unsigned long)addrlen};
211 static inline int connect_(int sockfd, const struct sockaddr *addr, socklen_t addrlen) { argument
212 unsigned long args[3] = {(unsigned long)sockfd, (unsigned long)(intptr_t)addr, (unsigned long)addrlen};
/freebsd-current/tests/sys/kern/
H A Dunix_passfd_test.c159 sendfd_payload(int sockfd, int send_fd, void *payload, size_t paylen) argument
178 return (sendmsg(sockfd, &msghdr, 0));
182 sendfd(int sockfd, int send_fd) argument
188 len = sendfd_payload(sockfd, send_fd, &ch, sizeof(ch));
195 localcreds(int sockfd) argument
201 rc = getsockopt(sockfd, 0, LOCAL_CREDS, &val, &sz);
208 recvfd_payload(int sockfd, int *recv_fd, void *buf, size_t buflen, argument
231 len = recvmsg(sockfd, &msghdr, recvmsg_flags);
251 ATF_REQUIRE_MSG(!localcreds(sockfd) || foundcreds,
260 recvfd(int sockfd, in argument
686 send_cmsg(int sockfd, void *cmsg, size_t cmsgsz) argument
711 recv_cmsg(int sockfd, char *cmsg, size_t cmsgsz, int flags) argument
[all...]
/freebsd-current/contrib/mandoc/
H A Dcatman.c53 run_mandocd(int sockfd, const char *outtype, const char* defos) argument
57 if (snprintf(sockfdstr, sizeof(sockfdstr), "%d", sockfd) == -1)
/freebsd-current/contrib/ntp/ntpdc/
H A Dntpdc.c181 static SOCKET sockfd; /* fd socket is opened on */ variable
507 closesocket(sockfd);
537 sockfd = socket(ai->ai_family, SOCK_DGRAM, 0);
538 if (sockfd == INVALID_SOCKET) {
548 if (setsockopt(sockfd, SOL_SOCKET, SO_RCVBUF,
556 if (connect(sockfd, (struct sockaddr *)&hostaddr,
559 if (connect(sockfd, ai->ai_addr, ai->ai_addrlen) == -1)
584 if (send(sockfd, xdata, xdatalen, 0) == -1) {
665 FD_SET(sockfd, &fds);
666 n = select(sockfd
[all...]

Completed in 222 milliseconds

12