* net: amended comments
authorUrban Wallasch <urban.wallasch@freenet.de>
Thu, 24 Oct 2019 04:03:23 +0000 (06:03 +0200)
committerUrban Wallasch <urban.wallasch@freenet.de>
Thu, 24 Oct 2019 04:03:23 +0000 (06:03 +0200)
net/net.h

index 6fe5704005fbc0077f480e8468d02de29cf466e9..511617671ea22e206f811f962a3d5ad145911ce8 100644 (file)
--- 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);