diff options
Diffstat (limited to 'man2/select_tut.2')
-rw-r--r-- | man2/select_tut.2 | 84 |
1 files changed, 42 insertions, 42 deletions
diff --git a/man2/select_tut.2 b/man2/select_tut.2 index 59c241973..1f6ea6242 100644 --- a/man2/select_tut.2 +++ b/man2/select_tut.2 @@ -17,7 +17,7 @@ Standard C library .RI ( libc ", " \-lc ) .SH SYNOPSIS See -.BR select (2) +.MR select 2 .SH DESCRIPTION The .BR select () @@ -35,7 +35,7 @@ For details of the arguments and semantics of and .BR pselect (), see -.BR select (2). +.MR select 2 . .\" .SS Combining signal and data events .BR pselect () @@ -75,7 +75,7 @@ For instance, let us say that the event in question was the exit of a child process. Before the start of the main loop, we would block \fBSIGCHLD\fP using -.BR sigprocmask (2). +.MR sigprocmask 2 . Our .BR pselect () call would enable @@ -151,9 +151,9 @@ UNIX programmers often find themselves in a position where they have to handle I/O from more than one file descriptor where the data flow may be intermittent. If you were to merely create a sequence of -.BR read (2) +.MR read 2 and -.BR write (2) +.MR write 2 calls, you would find that one of your calls may block waiting for data from/to a file descriptor, while another file descriptor is unused though ready for I/O. @@ -201,11 +201,11 @@ should be checked to see if they are ready. .TP 5. The functions -.BR read (2), -.BR recv (2), -.BR write (2), +.MR read 2 , +.MR recv 2 , +.MR write 2 , and -.BR send (2) +.MR send 2 do \fInot\fP necessarily read/write the full amount of data that you have requested. If they do read/write the full amount, it's @@ -224,20 +224,20 @@ easily be made larger. .TP 7. Calls to -.BR read (2), -.BR recv (2), -.BR write (2), -.BR send (2), +.MR read 2 , +.MR recv 2 , +.MR write 2 , +.MR send 2 , and .BR select () can fail with the error \fBEINTR\fP, and calls to -.BR read (2), -.BR recv (2), -.BR write (2), +.MR read 2 , +.MR recv 2 , +.MR write 2 , and -.BR send (2) +.MR send 2 can fail with .I errno set to \fBEAGAIN\fP (\fBEWOULDBLOCK\fP). @@ -250,20 +250,20 @@ you will not get \fBEAGAIN\fP. .TP 8. Never call -.BR read (2), -.BR recv (2), -.BR write (2), +.MR read 2 , +.MR recv 2 , +.MR write 2 , or -.BR send (2) +.MR send 2 with a buffer length of zero. .TP 9. If the functions -.BR read (2), -.BR recv (2), -.BR write (2), +.MR read 2 , +.MR recv 2 , +.MR write 2 , and -.BR send (2) +.MR send 2 fail with errors other than those listed in \fB7.\fP, or one of the input functions returns 0, indicating end of file, then you should \fInot\fP pass that file descriptor to @@ -300,7 +300,7 @@ then the sets must be reinitialized before each call. .\" (See further on.) .SH RETURN VALUE See -.BR select (2). +.MR select 2 . .SH NOTES Generally speaking, all operating systems that support sockets also support @@ -312,7 +312,7 @@ to solve in a more complicated manner using threads, forking, IPCs, signals, memory sharing, and so on. .P The -.BR poll (2) +.MR poll 2 system call has the same functionality as .BR select (), and is somewhat more efficient when monitoring sparse @@ -321,11 +321,11 @@ It is nowadays widely available, but historically was less portable than .BR select (). .P The Linux-specific -.BR epoll (7) +.MR epoll 7 API provides an interface that is more efficient than -.BR select (2) +.MR select 2 and -.BR poll (2) +.MR poll 2 when monitoring large numbers of file descriptors. .SH EXAMPLES Here is an example that better demonstrates the true utility of @@ -610,11 +610,11 @@ including OOB signal data transmitted by \fBtelnet\fP servers. It handles the tricky problem of having data flow in both directions simultaneously. You might think it more efficient to use a -.BR fork (2) +.MR fork 2 call and devote a thread to each stream. This becomes more tricky than you might suspect. Another idea is to set nonblocking I/O using -.BR fcntl (2). +.MR fcntl 2 . This also has its problems because you end up using inefficient timeouts. .P @@ -624,15 +624,15 @@ of buffers\[em]one for each connection. At the moment, new connections cause the current connection to be dropped. .SH SEE ALSO -.BR accept (2), -.BR connect (2), -.BR poll (2), -.BR read (2), -.BR recv (2), -.BR select (2), -.BR send (2), -.BR sigprocmask (2), -.BR write (2), -.BR epoll (7) +.MR accept 2 , +.MR connect 2 , +.MR poll 2 , +.MR read 2 , +.MR recv 2 , +.MR select 2 , +.MR send 2 , +.MR sigprocmask 2 , +.MR write 2 , +.MR epoll 7 .\" .SH AUTHORS .\" This man page was written by Paul Sheer. |