| 233 | } |
| 234 | |
| 235 | int fstack_socket(int domain, int type, int protocol) { |
| 236 | int fd = ff_socket(domain, type, protocol); |
| 237 | if (fd < 0) |
| 238 | return fd; |
| 239 | int val = 1; |
| 240 | if (ff_ioctl(fd, FIONBIO, &val) < 0) |
| 241 | LOG_WARN("failed to set socket non-blocking"); |
| 242 | if (ff_ioctl(fd, TCP_NODELAY, &val) < 0) |
| 243 | LOG_WARN("failed to set TCP_NODELAY"); |
| 244 | return fd; |
| 245 | } |
| 246 | |
| 247 | // linux_sockaddr is required by f-stack api, and has the same layout to sockaddr |
| 248 | static_assert(sizeof(linux_sockaddr) == sizeof(sockaddr)); |
no outgoing calls
no test coverage detected