MT#61625 add socket_rcvtimeout helper

Change-Id: I17de1f5948e64712fb60bd96708c07ea87cfe010
pull/1910/head
Richard Fuchs 10 months ago
parent eeeb2d8641
commit af789073a7

@ -251,6 +251,11 @@ INLINE void nonblock(int fd) {
// coverity[check_return : FALSE] // coverity[check_return : FALSE]
fcntl(fd, F_SETFL, O_NONBLOCK); fcntl(fd, F_SETFL, O_NONBLOCK);
} }
INLINE void socket_rcvtimeout(socket_t *s, unsigned int us) {
struct timeval tv = timeval_from_us(us);
// coverity[check_return : FALSE]
setsockopt(s->fd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv));
}
INLINE int socket_cpu_affinity(socket_t *s, int cpu) { INLINE int socket_cpu_affinity(socket_t *s, int cpu) {
#ifndef SO_INCOMING_CPU #ifndef SO_INCOMING_CPU
errno = ENOTSUP; errno = ENOTSUP;

Loading…
Cancel
Save