Home
last modified time | relevance | path

Searched refs:sock (Results 1 – 16 of 16) sorted by relevance

/system/vold/
Dvdc.c36 static int do_monitor(int sock, int stop_after_cmd);
37 static int do_cmd(int sock, int argc, char **argv);
40 int sock; in main() local
57 while ((sock = socket_local_client("vold", in main()
69 exit(do_monitor(sock, 0)); in main()
71 exit(do_cmd(sock, argc, argv)); in main()
75 static int do_cmd(int sock, int argc, char **argv) { in do_cmd() argument
94 if (write(sock, final_cmd, strlen(final_cmd) + 1) < 0) { in do_cmd()
99 return do_monitor(sock, 1); in do_cmd()
102 static int do_monitor(int sock, int stop_after_cmd) { in do_monitor() argument
[all …]
/system/netd/server/
Dndc.c35 static int do_monitor(int sock, int stop_after_cmd);
36 static int do_cmd(int sock, int argc, char **argv);
39 int sock; in main() local
47 if ((sock = socket_local_client(argv[1], in main()
50 if ((sock = socket_local_client("netd", in main()
63 exit(do_monitor(sock, 0)); in main()
64 exit(do_cmd(sock, argc-cmdOffset, &(argv[cmdOffset]))); in main()
67 static int do_cmd(int sock, int argc, char **argv) { in do_cmd() argument
106 if (write(sock, final_cmd, strlen(final_cmd) + 1) < 0) { in do_cmd()
114 return do_monitor(sock, 1); in do_cmd()
[all …]
DNetlinkManager.cpp53 NetlinkHandler *NetlinkManager::setupSocket(int *sock, int netlinkFamily, in setupSocket() argument
65 if ((*sock = socket(PF_NETLINK, SOCK_DGRAM, netlinkFamily)) < 0) { in setupSocket()
70 if (setsockopt(*sock, SOL_SOCKET, SO_RCVBUFFORCE, &sz, sizeof(sz)) < 0) { in setupSocket()
72 close(*sock); in setupSocket()
76 if (setsockopt(*sock, SOL_SOCKET, SO_PASSCRED, &on, sizeof(on)) < 0) { in setupSocket()
78 close(*sock); in setupSocket()
82 if (bind(*sock, (struct sockaddr *) &nladdr, sizeof(nladdr)) < 0) { in setupSocket()
84 close(*sock); in setupSocket()
88 NetlinkHandler *handler = new NetlinkHandler(this, *sock, format); in setupSocket()
91 close(*sock); in setupSocket()
DNetlinkManager.h58 NetlinkHandler* setupSocket(int *sock, int netlinkFamily, int groups,
DRouteController.cpp201 int sock = socket(AF_NETLINK, SOCK_DGRAM, NETLINK_ROUTE); in sendNetlinkRequest() local
202 if (sock != -1 && in sendNetlinkRequest()
203 connect(sock, reinterpret_cast<const sockaddr*>(&NETLINK_ADDRESS), in sendNetlinkRequest()
205 writev(sock, iov, iovlen) != -1 && in sendNetlinkRequest()
206 (ret = recv(sock, &response, sizeof(response), 0)) != -1) { in sendNetlinkRequest()
221 if (sock != -1) { in sendNetlinkRequest()
222 close(sock); in sendNetlinkRequest()
/system/core/liblog/
Dlog_read.c244 int sock; member
282 int sock = socket_local_client("logd", ANDROID_SOCKET_NAMESPACE_RESERVED, in send_log_msg() local
284 if (sock < 0) { in send_log_msg()
285 return sock; in send_log_msg()
293 ret = TEMP_FAILURE_RETRY(write(sock, buf, len)); in send_log_msg()
300 while ((ret = TEMP_FAILURE_RETRY(read(sock, cp, len))) > 0) { in send_log_msg()
311 p.fd = sock; in send_log_msg()
335 close(sock); in send_log_msg()
483 logger_list->sock = -1; in android_logger_list_alloc()
504 logger_list->sock = -1; in android_logger_list_alloc_time()
[all …]
/system/core/logd/
DLogListener.cpp114 int sock = android_get_control_socket(socketName); in getLogSocket() local
116 if (sock < 0) { in getLogSocket()
117 sock = socket_local_server(socketName, in getLogSocket()
123 if (setsockopt(sock, SOL_SOCKET, SO_PASSCRED, &on, sizeof(on)) < 0) { in getLogSocket()
126 return sock; in getLogSocket()
DLogReader.cpp182 int sock = android_get_control_socket(socketName); in getLogSocket() local
184 if (sock < 0) { in getLogSocket()
185 sock = socket_local_server(socketName, in getLogSocket()
190 return sock; in getLogSocket()
DCommandListener.cpp301 int sock = android_get_control_socket(socketName); in getLogSocket() local
303 if (sock < 0) { in getLogSocket()
304 sock = socket_local_server(socketName, in getLogSocket()
309 return sock; in getLogSocket()
/system/core/logd/tests/
Dlogd_test.cpp37 int sock = socket_local_client("logd", in my_android_logger_get_statistics() local
40 if (sock >= 0) { in my_android_logger_get_statistics()
41 if (write(sock, buf, strlen(buf) + 1) > 0) { in my_android_logger_get_statistics()
43 while ((ret = read(sock, buf, len)) > 0) { in my_android_logger_get_statistics()
51 .fd = sock, in my_android_logger_get_statistics()
62 close(sock); in my_android_logger_get_statistics()
651 int sock = socket_local_client("logd", in TEST() local
655 ASSERT_TRUE(sock >= 0); in TEST()
658 if (write(sock, getPruneList, sizeof(getPruneList)) > 0) { in TEST()
661 read(sock, buffer, sizeof(buffer)); in TEST()
[all …]
/system/core/libcutils/
Dproperties.c185 int sock = -1; in connectToServer() local
190 sock = socket(AF_UNIX, SOCK_STREAM, 0); in connectToServer()
191 if (sock < 0) { in connectToServer()
199 cc = connect(sock, (struct sockaddr*) &addr, SUN_LEN(&addr)); in connectToServer()
205 close(sock); in connectToServer()
209 return sock; in connectToServer()
/system/core/include/sysutils/
DSocketClient.h34 SocketClient(int sock, bool owned);
35 SocketClient(int sock, bool owned, bool useCmdNum);
DFrameworkClient.h13 FrameworkClient(int sock);
DFrameworkListener.h39 FrameworkListener(int sock);
/system/core/libsysutils/src/
DFrameworkListener.cpp42 FrameworkListener::FrameworkListener(int sock) : in FrameworkListener() argument
43 SocketListener(sock, true) { in FrameworkListener()
/system/core/libnetutils/
Ddhcpclient.c344 static int send_message(int sock, int if_index, dhcp_msg *msg, int size) in send_message() argument
349 return send_packet(sock, if_index, msg, size, INADDR_ANY, INADDR_BROADCAST, in send_message()