summaryrefslogtreecommitdiffstats
path: root/man2/select.2
diff options
context:
space:
mode:
Diffstat (limited to 'man2/select.2')
-rw-r--r--man2/select.218
1 files changed, 9 insertions, 9 deletions
diff --git a/man2/select.2 b/man2/select.2
index fd592a3b2..ef01cc85e 100644
--- a/man2/select.2
+++ b/man2/select.2
@@ -304,7 +304,7 @@ executing the following calls:
.in +4n
.EX
sigset_t origmask;
-
+\&
pthread_sigmask(SIG_SETMASK, &sigmask, &origmask);
ready = select(nfds, &readfds, &writefds, &exceptfds, timeout);
pthread_sigmask(SIG_SETMASK, &origmask, NULL);
@@ -714,27 +714,27 @@ to a local variable and passing that variable to the system call.
#include <stdio.h>
#include <stdlib.h>
#include <sys/select.h>
-
+\&
int
main(void)
{
int retval;
fd_set rfds;
struct timeval tv;
-
+\&
/* Watch stdin (fd 0) to see when it has input. */
-
+\&
FD_ZERO(&rfds);
FD_SET(0, &rfds);
-
+\&
/* Wait up to five seconds. */
-
+\&
tv.tv_sec = 5;
tv.tv_usec = 0;
-
+\&
retval = select(1, &rfds, NULL, NULL, &tv);
/* Don\[aq]t rely on the value of tv now! */
-
+\&
if (retval == \-1)
perror("select()");
else if (retval)
@@ -742,7 +742,7 @@ main(void)
/* FD_ISSET(0, &rfds) will be true. */
else
printf("No data within five seconds.\en");
-
+\&
exit(EXIT_SUCCESS);
}
.EE