| 280 | } |
| 281 | |
| 282 | int 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__ |
| 298 | static int recv_errqueue(int fd, uint32_t &ret_counter) { |
no outgoing calls
no test coverage detected