From 98dbd760b91be0163be9a23da138424b96748b4a Mon Sep 17 00:00:00 2001 From: Urban Wallasch Date: Thu, 24 Oct 2019 06:03:23 +0200 Subject: [PATCH] * net: amended comments --- net/net.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/net/net.h b/net/net.h index 6fe5704..5116176 100644 --- a/net/net.h +++ b/net/net.h @@ -133,7 +133,8 @@ extern int net_close(int sock); * Note: When the time-out expires a negative value is returned and * errno is set to ETIME. A negative value for timeout will cause * tcp_accept() to wait indefinitely. Set timeout to zero for immediate - * return. + * return. The function will return prematurely when interrupted by a + * signal. */ extern int tcp_accept(int sock, int timeout); @@ -156,7 +157,10 @@ extern int tcp_accept(int sock, int timeout); * underlying call to recvfrom(). When the time-out expires, a negative * value is returned and errno is set to ETIME. A negative value for * timeout will cause indefinite wait. Set timeout to zero for immediate - * return. + * return. The function will return prematurely when interrupted by a + * signal. When reading from a non-socket file descriptor flags, addr + * and alen are ignored, and performance may be slightly inferior + * compared to a plain read() call. */ extern ssize_t recvfrom_tm(int fd, void *buf, size_t len, int flags, struct sockaddr *addr, socklen_t *alen, int timeout); @@ -185,7 +189,10 @@ extern ssize_t recvfrom_tm(int fd, void *buf, size_t len, int flags, * added in the underlying call to sendto(). When the time-out expires, * a negative value is returned and errno is set to ETIME. A negative * value for timeout will cause indefinite wait. Set timeout to zero - * for immediate return. + * for immediate return. The function will return prematurely when + * interrupted by a signal. When writing to a non-socket file descriptor + * flags, addr and alen are ignored, and performance may be slightly + * inferior compared to a plain write() call. */ extern ssize_t sendto_tm(int fd, void *buf, size_t len, int flags, const struct sockaddr *addr, socklen_t alen, int timeout); -- 2.30.2