Home
last modified time | relevance | path

Searched refs:sockfd (Results 1 – 5 of 5) sorted by relevance

/base/hiviewdfx/faultloggerd/interfaces/innerkits/faultloggerd_client/
Dfaultloggerd_client.cpp73 int sockfd; in RequestFileDescriptorEx() local
75 if (!StartConnect(sockfd, name.c_str(), SOCKET_TIMEOUT)) { in RequestFileDescriptorEx()
80 write(sockfd, request, sizeof(struct FaultLoggerdRequest)); in RequestFileDescriptorEx()
81 int fd = ReadFileDescriptorFromSocket(sockfd); in RequestFileDescriptorEx()
83 close(sockfd); in RequestFileDescriptorEx()
87 static bool CheckReadResp(int sockfd) in CheckReadResp() argument
92 ssize_t nread = read(sockfd, ControlBuffer, sizeof(ControlBuffer) - 1); in CheckReadResp()
108 int sockfd = -1; in RequestFileDescriptorByCheck() local
111 if (!StartConnect(sockfd, name.c_str(), SOCKET_TIMEOUT)) { in RequestFileDescriptorByCheck()
116 write(sockfd, request, sizeof(struct FaultLoggerdRequest)); in RequestFileDescriptorByCheck()
[all …]
Dfaultloggerd_socket.cpp33 bool StartConnect(int& sockfd, const char* path, const int timeout) in StartConnect() argument
36 if ((sockfd = socket(AF_LOCAL, SOCK_STREAM, 0)) < 0) { in StartConnect()
48 if (setsockopt(sockfd, SOL_SOCKET, SO_RCVTIMEO, \ in StartConnect()
66 int connected = connect(sockfd, reinterpret_cast<struct sockaddr *>(&server), len); in StartConnect()
76 close(sockfd); in StartConnect()
81 static bool GetServerSocket(int& sockfd, const char* name) in GetServerSocket() argument
83 sockfd = OHOS_TEMP_FAILURE_RETRY(socket(AF_LOCAL, SOCK_STREAM, 0)); in GetServerSocket()
84 if (sockfd < 0) { in GetServerSocket()
102 int ret = setsockopt(sockfd, SOL_SOCKET, SO_PASSCRED, &optval, sizeof(optval)); in GetServerSocket()
108 if (bind(sockfd, (struct sockaddr *)&server, in GetServerSocket()
[all …]
Dfaultloggerd_socket.h25 bool StartConnect(int& sockfd, const char* path, const int timeout);
26 bool StartListen(int& sockfd, const char* name, const int listenCnt);
28 bool RecvMsgCredFromSocket(int sockfd, struct ucred* pucred);
30 bool SendMsgIovToSocket(int sockfd, void *iovBase, const int iovLen);
32 bool SendFileDescriptorToSocket(int sockfd, int fd);
33 int ReadFileDescriptorFromSocket(int sockfd);
/base/startup/init/ueventd/
Dueventd_socket.c42 …int sockfd = socket(PF_NETLINK, SOCK_DGRAM | SOCK_CLOEXEC | SOCK_NONBLOCK, NETLINK_KOBJECT_UEVENT); in UeventdSocketInit() local
43 if (sockfd < 0) { in UeventdSocketInit()
48 setsockopt(sockfd, SOL_SOCKET, SO_RCVBUFFORCE, &buffSize, sizeof(buffSize)); in UeventdSocketInit()
49 setsockopt(sockfd, SOL_SOCKET, SO_PASSCRED, &on, sizeof(on)); in UeventdSocketInit()
51 if (bind(sockfd, (struct sockaddr *)&addr, sizeof(addr)) < 0) { in UeventdSocketInit()
54 close(sockfd); in UeventdSocketInit()
58 return sockfd; in UeventdSocketInit()
/base/startup/appspawn/test/unittest/
Dapp_spawn_stub.cpp106 int BindStub(int sockfd, const struct sockaddr *addr, socklen_t addrlen) in BindStub() argument
108 UNUSED(sockfd); in BindStub()
136 int GetsockoptStub(int sockfd, int level, int optname, void *optval, socklen_t *optlen) in GetsockoptStub() argument
138 UNUSED(sockfd); in GetsockoptStub()