Home
last modified time | relevance | path

Searched refs:sock_fd (Results 1 – 15 of 15) sorted by relevance

/system/core/libcutils/
Ddebugger.c32 static int send_request(int sock_fd, void* msg_ptr, size_t msg_len) { in send_request() argument
34 if (TEMP_FAILURE_RETRY(write(sock_fd, msg_ptr, msg_len)) != (ssize_t) msg_len) { in send_request()
38 if (TEMP_FAILURE_RETRY(read(sock_fd, &ack, 1)) != 1) { in send_request()
51 int sock_fd = socket_local_client(DEBUGGER_SOCKET_NAME, ANDROID_SOCKET_NAMESPACE_ABSTRACT, in make_dump_request() local
53 if (sock_fd < 0) { in make_dump_request()
61 if (setsockopt(sock_fd, SOL_SOCKET, SO_RCVTIMEO, &tm, sizeof(tm)) == -1) { in make_dump_request()
65 if (setsockopt(sock_fd, SOL_SOCKET, SO_SNDTIMEO, &tm, sizeof(tm)) == -1) { in make_dump_request()
70 if (send_request(sock_fd, &msg, sizeof(msg)) < 0) { in make_dump_request()
71 close(sock_fd); in make_dump_request()
75 return sock_fd; in make_dump_request()
[all …]
/system/bt/btif/src/
Dbtif_sock.c37 …t type, const char *service_name, const uint8_t *uuid, int channel, int *sock_fd, int flags, int a…
38 …r_t *bd_addr, btsock_type_t type, const uint8_t *uuid, int channel, int *sock_fd, int flags, int a…
120 …const char *service_name, const uint8_t *service_uuid, int channel, int *sock_fd, int flags, int a… in btsock_listen() argument
123 assert(sock_fd != NULL); in btsock_listen()
126 *sock_fd = INVALID_FD; in btsock_listen()
131 status = btsock_rfc_listen(service_name, service_uuid, channel, sock_fd, flags, app_uid); in btsock_listen()
134 status = btsock_l2cap_listen(service_name, channel, sock_fd, flags, app_uid); in btsock_listen()
138 status = btsock_sco_listen(sock_fd, flags); in btsock_listen()
149 …r_t *bd_addr, btsock_type_t type, const uint8_t *uuid, int channel, int *sock_fd, int flags, int a… in btsock_connect() argument
152 assert(sock_fd != NULL); in btsock_connect()
[all …]
Dbtif_sock_util.c58 int sock_send_all(int sock_fd, const uint8_t* buf, int len) in sock_send_all() argument
65 OSI_NO_INTR(ret = send(sock_fd, buf, s, 0)); in sock_send_all()
68 BTIF_TRACE_ERROR("sock fd:%d send errno:%d, ret:%d", sock_fd, errno, ret); in sock_send_all()
76 int sock_recv_all(int sock_fd, uint8_t* buf, int len) in sock_recv_all() argument
83 OSI_NO_INTR(ret = recv(sock_fd, buf, r, MSG_WAITALL)); in sock_recv_all()
86 BTIF_TRACE_ERROR("sock fd:%d recv errno:%d, ret:%d", sock_fd, errno, ret); in sock_recv_all()
95 int sock_send_fd(int sock_fd, const uint8_t* buf, int len, int send_fd) in sock_send_fd() argument
104 if(sock_fd == -1 || send_fd == -1) in sock_send_fd()
129 OSI_NO_INTR(ret = sendmsg(sock_fd, &msg, MSG_NOSIGNAL)); in sock_send_fd()
132 sock_fd, send_fd, (int)ret, errno, strerror(errno)); in sock_send_fd()
Dbtif_sock_sco.c76 …socket_t *sco_socket_establish_locked(bool is_listening, const bt_bdaddr_t *bd_addr, int *sock_fd);
114 bt_status_t btsock_sco_listen(int *sock_fd, UNUSED_ATTR int flags) { in btsock_sco_listen() argument
115 assert(sock_fd != NULL); in btsock_sco_listen()
119 sco_socket_t *sco_socket = sco_socket_establish_locked(true, NULL, sock_fd); in btsock_sco_listen()
130 bt_status_t btsock_sco_connect(const bt_bdaddr_t *bd_addr, int *sock_fd, UNUSED_ATTR int flags) { in btsock_sco_connect() argument
132 assert(sock_fd != NULL); in btsock_sco_connect()
135 sco_socket_t *sco_socket = sco_socket_establish_locked(false, bd_addr, sock_fd); in btsock_sco_connect()
142 …ocket_t *sco_socket_establish_locked(bool is_listening, const bt_bdaddr_t *bd_addr, int *sock_fd) { in sco_socket_establish_locked() argument
169 *sock_fd = pair[0]; // Transfer ownership of one end to caller. in sco_socket_establish_locked()
Dbtif_sock_rfc.c263 …const char *service_name, const uint8_t *service_uuid, int channel, int *sock_fd, int flags, int a… in btsock_rfc_listen() argument
264 assert(sock_fd != NULL); in btsock_rfc_listen()
269 *sock_fd = INVALID_FD; in btsock_rfc_listen()
300 *sock_fd = slot->app_fd; // Transfer ownership of fd to caller. in btsock_rfc_listen()
319 …nst bt_bdaddr_t *bd_addr, const uint8_t *service_uuid, int channel, int *sock_fd, int flags, int a… in btsock_rfc_connect() argument
320 assert(sock_fd != NULL); in btsock_rfc_connect()
323 *sock_fd = INVALID_FD; in btsock_rfc_connect()
367 *sock_fd = slot->app_fd; // Transfer ownership of fd to caller. in btsock_rfc_connect()
Dbtif_sock_l2cap.c892 int channel, int* sock_fd, int flags, char listen, int app_uid) in btsock_l2cap_listen_or_connect() argument
900 if (!sock_fd) in btsock_l2cap_listen_or_connect()
966 *sock_fd = sock->app_fd; in btsock_l2cap_listen_or_connect()
982 bt_status_t btsock_l2cap_listen(const char* name, int channel, int* sock_fd, int flags, int app_uid) in btsock_l2cap_listen() argument
984 return btsock_l2cap_listen_or_connect(name, NULL, channel, sock_fd, flags, 1, app_uid); in btsock_l2cap_listen()
987 bt_status_t btsock_l2cap_connect(const bt_bdaddr_t *bd_addr, int channel, int* sock_fd, int flags, … in btsock_l2cap_connect() argument
989 return btsock_l2cap_listen_or_connect(NULL, bd_addr, channel, sock_fd, flags, 0, app_uid); in btsock_l2cap_connect()
/system/bt/btif/include/
Dbtif_sock_util.h34 int sock_send_fd(int sock_fd, const uint8_t* buffer, int len, int send_fd);
35 int sock_send_all(int sock_fd, const uint8_t* buf, int len);
36 int sock_recv_all(int sock_fd, uint8_t* buf, int len);
Dbtif_sock_sco.h27 bt_status_t btsock_sco_listen(int *sock_fd, int flags);
28 bt_status_t btsock_sco_connect(const bt_bdaddr_t *bd_addr, int *sock_fd, int flags);
Dbtif_sock_rfc.h35 int* sock_fd, int flags, int app_uid);
37 int channel, int* sock_fd, int flags, int app_uid);
Dbtif_sock_l2cap.h18 int* sock_fd, int flags, int app_uid);
20 int channel, int* sock_fd, int flags, int app_uid);
/system/connectivity/shill/
Dconnection_health_checker.h113 void set_sock_fd(int sock_fd) { sock_fd_ = sock_fd; } in set_sock_fd() argument
184 void OnConnectionComplete(bool success, int sock_fd);
187 bool GetSocketInfo(int sock_fd, SocketInfo* sock_info);
189 void SetSocketDescriptor(int sock_fd);
Dconnection_health_checker.cc295 void ConnectionHealthChecker::OnConnectionComplete(bool success, int sock_fd) { in OnConnectionComplete() argument
306 SetSocketDescriptor(sock_fd); in OnConnectionComplete()
385 bool ConnectionHealthChecker::GetSocketInfo(int sock_fd, in GetSocketInfo() argument
390 if (socket_->GetSockName(sock_fd, in GetSocketInfo()
460 void ConnectionHealthChecker::SetSocketDescriptor(int sock_fd) { in SetSocketDescriptor() argument
465 sock_fd_ = sock_fd; in SetSocketDescriptor()
Dconnection_health_checker_unittest.cc115 void InvokeOnConnectionComplete(bool success, int sock_fd) { in InvokeOnConnectionComplete() argument
116 health_checker_->OnConnectionComplete(success, sock_fd); in InvokeOnConnectionComplete()
/system/bt/tools/bdtool/
Dbdtool.c210 int sock_fd = INVALID_FD; in main() local
211 error = sock->listen(BTSOCK_SCO, NULL, NULL, 5, &sock_fd, 0, app_uid); in main()
242 int sock_fd = INVALID_FD; in main() local
243 error = sock->connect(&bt_remote_bdaddr, BTSOCK_SCO, NULL, 5, &sock_fd, 0, app_uid); in main()
/system/core/debuggerd/
Ddebuggerd.cpp376 int sock_fd = socket_local_client(DEBUGGER32_SOCKET_NAME, ANDROID_SOCKET_NAMESPACE_ABSTRACT, in redirect_to_32() local
378 if (sock_fd < 0) { in redirect_to_32()
383 if (TEMP_FAILURE_RETRY(write(sock_fd, &msg, sizeof(msg))) != (ssize_t) sizeof(msg)) { in redirect_to_32()
385 close(sock_fd); in redirect_to_32()
390 if (TEMP_FAILURE_RETRY(read(sock_fd, &ack, 1)) == -1) { in redirect_to_32()
392 close(sock_fd); in redirect_to_32()
398 while ((bytes_read = TEMP_FAILURE_RETRY(read(sock_fd, buffer, sizeof(buffer)))) > 0) { in redirect_to_32()
419 close(sock_fd); in redirect_to_32()