MCPcopy Create free account
hub / github.com/alibaba/PhotonLibOS / fill_uds_path

Function fill_uds_path

net/basic_socket.cpp:282–295  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

280}
281
282int fill_uds_path(struct sockaddr_un& name, const char* path, size_t count) {
283 const int LEN = sizeof(name.sun_path) - 1;
284 if (count == 0) count = strlen(path);
285 if (count > LEN)
286 LOG_ERROR_RETURN(ENAMETOOLONG, -1, "pathname is too long (`>`)", count, LEN);
287
288 memset(&name, 0, sizeof(name));
289 memcpy(name.sun_path, path, count + 1);
290#ifndef __linux__
291 name.sun_len = 0;
292#endif
293 name.sun_family = AF_UNIX;
294 return 0;
295}
296
297#ifdef __linux__
298static int recv_errqueue(int fd, uint32_t &ret_counter) {

Callers 3

to_addr_unMethod · 0.85
connectMethod · 0.85
bindMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected