diff options
Diffstat (limited to 'tests/syntax-tests/highlighted/Manpage/select-2.man')
-rw-r--r-- | tests/syntax-tests/highlighted/Manpage/select-2.man | 98 |
1 files changed, 49 insertions, 49 deletions
diff --git a/tests/syntax-tests/highlighted/Manpage/select-2.man b/tests/syntax-tests/highlighted/Manpage/select-2.man index e01db209..a746c365 100644 --- a/tests/syntax-tests/highlighted/Manpage/select-2.man +++ b/tests/syntax-tests/highlighted/Manpage/select-2.man @@ -18,9 +18,9 @@ [38;2;248;248;242m fd_set [0m[38;2;249;38;114m*[0m[3;38;2;253;151;31mexceptfds[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mstruct[0m[38;2;248;248;242m timespec [0m[38;2;249;38;114m*[0m[3;38;2;253;151;31mtimeout[0m[38;2;248;248;242m,[0m [38;2;248;248;242m [0m[38;2;249;38;114mconst[0m[38;2;248;248;242m sigset_t [0m[38;2;249;38;114m*[0m[3;38;2;253;151;31msigmask[0m[38;2;248;248;242m)[0m[38;2;248;248;242m;[0m -[38;2;248;248;242m Feature Test Macro Requirements for [0m[38;2;166;226;46mglibc[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242msee [0m[38;2;248;248;242mfeature_test_macros[0m[38;2;248;248;242m([0m[38;2;190;132;255m7[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m[38;2;249;38;114m:[0m +[38;2;248;248;242m Feature Test Macro Requirements for glibc (see [0m[38;2;166;226;46mfeature_test_macros[0m[38;2;249;38;114m([0m[38;2;190;132;255m7[0m[38;2;249;38;114m)[0m[38;2;248;248;242m):[0m -[38;2;248;248;242m [0m[38;2;248;248;242mpselect[0m[38;2;248;248;242m([0m[38;2;248;248;242m)[0m[38;2;249;38;114m:[0m[38;2;248;248;242m _POSIX_C_SOURCE [0m[38;2;249;38;114m>=[0m[38;2;248;248;242m [0m[38;2;190;132;255m200112[0m[3;38;2;102;217;239mL[0m +[38;2;248;248;242m [0m[38;2;166;226;46mpselect[0m[38;2;249;38;114m([0m[38;2;249;38;114m)[0m[38;2;248;248;242m: _POSIX_C_SOURCE >= 200112L[0m [38;2;253;151;31mDESCRIPTION[0m [38;2;248;248;242m [0m[38;2;166;226;46mselect[0m[38;2;249;38;114m([0m[38;2;249;38;114m)[0m[38;2;248;248;242m allows a program to monitor multiple file descriptors, waiting until one or more of the file descriptors become[0m @@ -142,17 +142,17 @@ [38;2;248;248;242m The timeout[0m [38;2;248;248;242m The timeout argument for [0m[38;2;166;226;46mselect[0m[38;2;249;38;114m([0m[38;2;249;38;114m)[0m[38;2;248;248;242m is a structure of the following type:[0m -[38;2;248;248;242m struct timeval {[0m -[38;2;248;248;242m time_t tv_sec; /* seconds */[0m -[38;2;248;248;242m suseconds_t tv_usec; /* microseconds */[0m -[38;2;248;248;242m };[0m +[38;2;248;248;242m [0m[3;38;2;102;217;239mstruct[0m[38;2;248;248;242m [0m[38;2;166;226;46mtimeval[0m[38;2;248;248;242m [0m[38;2;248;248;242m{[0m +[38;2;248;248;242m [0m[3;38;2;166;226;46mtime_t[0m[38;2;248;248;242m tv_sec[0m[38;2;248;248;242m;[0m[38;2;248;248;242m [0m[38;2;117;113;94m/*[0m[38;2;117;113;94m seconds [0m[38;2;117;113;94m*/[0m +[38;2;248;248;242m [0m[3;38;2;166;226;46msuseconds_t[0m[38;2;248;248;242m tv_usec[0m[38;2;248;248;242m;[0m[38;2;248;248;242m [0m[38;2;117;113;94m/*[0m[38;2;117;113;94m microseconds [0m[38;2;117;113;94m*/[0m +[38;2;248;248;242m [0m[38;2;248;248;242m}[0m[38;2;248;248;242m;[0m [38;2;248;248;242m The corresponding argument for [0m[38;2;166;226;46mpselect[0m[38;2;249;38;114m([0m[38;2;249;38;114m)[0m[38;2;248;248;242m has the following type:[0m -[38;2;248;248;242m struct timespec {[0m -[38;2;248;248;242m time_t tv_sec; /* seconds */[0m -[38;2;248;248;242m long tv_nsec; /* nanoseconds */[0m -[38;2;248;248;242m };[0m +[38;2;248;248;242m [0m[3;38;2;102;217;239mstruct[0m[38;2;248;248;242m [0m[38;2;166;226;46mtimespec[0m[38;2;248;248;242m [0m[38;2;248;248;242m{[0m +[38;2;248;248;242m [0m[3;38;2;166;226;46mtime_t[0m[38;2;248;248;242m tv_sec[0m[38;2;248;248;242m;[0m[38;2;248;248;242m [0m[38;2;117;113;94m/*[0m[38;2;117;113;94m seconds [0m[38;2;117;113;94m*/[0m +[38;2;248;248;242m [0m[3;38;2;102;217;239mlong[0m[38;2;248;248;242m tv_nsec[0m[38;2;248;248;242m;[0m[38;2;248;248;242m [0m[38;2;117;113;94m/*[0m[38;2;117;113;94m nanoseconds [0m[38;2;117;113;94m*/[0m +[38;2;248;248;242m [0m[38;2;248;248;242m}[0m[38;2;248;248;242m;[0m [38;2;248;248;242m On Linux, [0m[38;2;166;226;46mselect[0m[38;2;249;38;114m([0m[38;2;249;38;114m)[0m[38;2;248;248;242m modifies timeout to reflect the amount of time not slept; most other implementations do not do this.[0m [38;2;248;248;242m (POSIX.1 permits either behavior.) This causes problems both when Linux code which reads timeout is ported to other operating[0m @@ -213,14 +213,14 @@ [38;2;248;248;242m Within the Linux kernel source, we find the following definitions which show the correspondence between the readable,[0m [38;2;248;248;242m writable, and exceptional condition notifications of [0m[38;2;166;226;46mselect[0m[38;2;249;38;114m([0m[38;2;249;38;114m)[0m[38;2;248;248;242m and the event notifications provided by [0m[38;2;166;226;46mpoll[0m[38;2;249;38;114m([0m[38;2;190;132;255m2[0m[38;2;249;38;114m)[0m[38;2;248;248;242m and [0m[38;2;166;226;46mepoll[0m[38;2;249;38;114m([0m[38;2;190;132;255m7[0m[38;2;249;38;114m)[0m[38;2;248;248;242m:[0m -[38;2;248;248;242m #define POLLIN_SET (EPOLLRDNORM | EPOLLRDBAND | EPOLLIN |[0m -[38;2;248;248;242m EPOLLHUP | EPOLLERR)[0m -[38;2;248;248;242m /* Ready for reading */[0m -[38;2;248;248;242m #define POLLOUT_SET (EPOLLWRBAND | EPOLLWRNORM | EPOLLOUT |[0m -[38;2;248;248;242m EPOLLERR)[0m -[38;2;248;248;242m /* Ready for writing */[0m -[38;2;248;248;242m #define POLLEX_SET (EPOLLPRI)[0m -[38;2;248;248;242m /* Exceptional condition */[0m +[38;2;248;248;242m [0m[38;2;249;38;114m#define[0m[38;2;190;132;255m [0m[38;2;166;226;46mPOLLIN_SET[0m[38;2;190;132;255m [0m[38;2;190;132;255m([0m[38;2;190;132;255mEPOLLRDNORM [0m[38;2;249;38;114m|[0m[38;2;190;132;255m EPOLLRDBAND [0m[38;2;249;38;114m|[0m[38;2;190;132;255m EPOLLIN [0m[38;2;249;38;114m|[0m +[38;2;190;132;255m EPOLLHUP [0m[38;2;249;38;114m|[0m[38;2;190;132;255m EPOLLERR[0m[38;2;190;132;255m)[0m +[38;2;248;248;242m [0m[38;2;117;113;94m/*[0m[38;2;117;113;94m Ready for reading [0m[38;2;117;113;94m*/[0m +[38;2;248;248;242m [0m[38;2;249;38;114m#define[0m[38;2;190;132;255m [0m[38;2;166;226;46mPOLLOUT_SET[0m[38;2;190;132;255m [0m[38;2;190;132;255m([0m[38;2;190;132;255mEPOLLWRBAND [0m[38;2;249;38;114m|[0m[38;2;190;132;255m EPOLLWRNORM [0m[38;2;249;38;114m|[0m[38;2;190;132;255m EPOLLOUT [0m[38;2;249;38;114m|[0m +[38;2;190;132;255m EPOLLERR[0m[38;2;190;132;255m)[0m +[38;2;248;248;242m [0m[38;2;117;113;94m/*[0m[38;2;117;113;94m Ready for writing [0m[38;2;117;113;94m*/[0m +[38;2;248;248;242m [0m[38;2;249;38;114m#define[0m[38;2;190;132;255m [0m[38;2;166;226;46mPOLLEX_SET[0m[38;2;190;132;255m [0m[38;2;190;132;255m([0m[38;2;190;132;255mEPOLLPRI[0m[38;2;190;132;255m)[0m +[38;2;248;248;242m [0m[38;2;117;113;94m/*[0m[38;2;117;113;94m Exceptional condition [0m[38;2;117;113;94m*/[0m [38;2;248;248;242m Multithreaded applications[0m [38;2;248;248;242m If a file descriptor being monitored by [0m[38;2;166;226;46mselect[0m[38;2;249;38;114m([0m[38;2;249;38;114m)[0m[38;2;248;248;242m is closed in another thread, the result is unspecified. On some UNIX sys‐[0m @@ -242,11 +242,11 @@ [38;2;248;248;242m The final argument of the [0m[38;2;166;226;46mpselect6[0m[38;2;249;38;114m([0m[38;2;249;38;114m)[0m[38;2;248;248;242m system call is not a sigset_t * pointer, but is instead a structure of the form:[0m -[38;2;248;248;242m struct {[0m -[38;2;248;248;242m const kernel_sigset_t *ss; /* Pointer to signal set */[0m -[38;2;248;248;242m size_t ss_len; /* Size (in bytes) of object[0m -[38;2;248;248;242m pointed to by 'ss' */[0m -[38;2;248;248;242m };[0m +[38;2;248;248;242m [0m[3;38;2;102;217;239mstruct[0m[38;2;248;248;242m [0m[38;2;248;248;242m{[0m +[38;2;248;248;242m [0m[38;2;249;38;114mconst[0m[38;2;248;248;242m kernel_sigset_t [0m[38;2;249;38;114m*[0m[38;2;248;248;242mss[0m[38;2;248;248;242m;[0m[38;2;248;248;242m [0m[38;2;117;113;94m/*[0m[38;2;117;113;94m Pointer to signal set [0m[38;2;117;113;94m*/[0m +[38;2;248;248;242m [0m[3;38;2;166;226;46msize_t[0m[38;2;248;248;242m ss_len[0m[38;2;248;248;242m;[0m[38;2;248;248;242m [0m[38;2;117;113;94m/*[0m[38;2;117;113;94m Size (in bytes) of object[0m +[38;2;117;113;94m pointed to by 'ss' [0m[38;2;117;113;94m*/[0m +[38;2;248;248;242m [0m[38;2;248;248;242m}[0m[38;2;248;248;242m;[0m [38;2;248;248;242m This allows the system call to obtain both a pointer to the signal set and its size, while allowing for the fact that most ar‐[0m [38;2;248;248;242m chitectures support a maximum of 6 arguments to a system call. See [0m[38;2;166;226;46msigprocmask[0m[38;2;249;38;114m([0m[38;2;190;132;255m2[0m[38;2;249;38;114m)[0m[38;2;248;248;242m for a discussion of the difference between[0m @@ -283,40 +283,40 @@ [38;2;248;248;242m by internally copying the timeout to a local variable and passing that variable to the system call.[0m [38;2;253;151;31mEXAMPLES[0m -[38;2;248;248;242m #include <stdio.h>[0m -[38;2;248;248;242m #include <stdlib.h>[0m -[38;2;248;248;242m #include <sys/select.h>[0m +[38;2;190;132;255m [0m[38;2;249;38;114m#include[0m[38;2;190;132;255m [0m[38;2;230;219;116m<[0m[38;2;230;219;116mstdio.h[0m[38;2;230;219;116m>[0m +[38;2;190;132;255m [0m[38;2;249;38;114m#include[0m[38;2;190;132;255m [0m[38;2;230;219;116m<[0m[38;2;230;219;116mstdlib.h[0m[38;2;230;219;116m>[0m +[38;2;190;132;255m [0m[38;2;249;38;114m#include[0m[38;2;190;132;255m [0m[38;2;230;219;116m<[0m[38;2;230;219;116msys/select.h[0m[38;2;230;219;116m>[0m -[38;2;248;248;242m int[0m -[38;2;248;248;242m [0m[38;2;166;226;46mmain[0m[38;2;249;38;114m([0m[38;2;190;132;255mvoid[0m[38;2;249;38;114m)[0m -[38;2;248;248;242m {[0m -[38;2;248;248;242m fd_set rfds;[0m -[38;2;248;248;242m struct timeval tv;[0m -[38;2;248;248;242m int retval;[0m +[38;2;248;248;242m [0m[3;38;2;102;217;239mint[0m +[38;2;248;248;242m [0m[38;2;166;226;46mmain[0m[38;2;248;248;242m([0m[3;38;2;102;217;239mvoid[0m[38;2;248;248;242m)[0m +[38;2;248;248;242m [0m[38;2;248;248;242m{[0m +[38;2;248;248;242m fd_set rfds[0m[38;2;248;248;242m;[0m +[38;2;248;248;242m [0m[3;38;2;102;217;239mstruct[0m[38;2;248;248;242m timeval tv[0m[38;2;248;248;242m;[0m +[38;2;248;248;242m [0m[3;38;2;102;217;239mint[0m[38;2;248;248;242m retval[0m[38;2;248;248;242m;[0m -[38;2;248;248;242m /* Watch stdin (fd 0) to see when it has input. */[0m +[38;2;248;248;242m [0m[38;2;117;113;94m/*[0m[38;2;117;113;94m Watch stdin (fd 0) to see when it has input. [0m[38;2;117;113;94m*/[0m -[38;2;248;248;242m [0m[38;2;166;226;46mFD_ZERO[0m[38;2;249;38;114m([0m[38;2;190;132;255m&rfds[0m[38;2;249;38;114m)[0m[38;2;248;248;242m;[0m -[38;2;248;248;242m [0m[38;2;166;226;46mFD_SET[0m[38;2;249;38;114m([0m[38;2;190;132;255m0, &rfds[0m[38;2;249;38;114m)[0m[38;2;248;248;242m;[0m +[38;2;248;248;242m [0m[38;2;248;248;242mFD_ZERO[0m[38;2;248;248;242m([0m[38;2;249;38;114m&[0m[38;2;248;248;242mrfds[0m[38;2;248;248;242m)[0m[38;2;248;248;242m;[0m +[38;2;248;248;242m [0m[38;2;248;248;242mFD_SET[0m[38;2;248;248;242m([0m[38;2;190;132;255m0[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;249;38;114m&[0m[38;2;248;248;242mrfds[0m[38;2;248;248;242m)[0m[38;2;248;248;242m;[0m -[38;2;248;248;242m /* Wait up to five seconds. */[0m +[38;2;248;248;242m [0m[38;2;117;113;94m/*[0m[38;2;117;113;94m Wait up to five seconds. [0m[38;2;117;113;94m*/[0m -[38;2;248;248;242m tv.tv_sec = 5;[0m -[38;2;248;248;242m tv.tv_usec = 0;[0m +[38;2;248;248;242m tv[0m[38;2;248;248;242m.[0m[38;2;255;255;255mtv_sec[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m5[0m[38;2;248;248;242m;[0m +[38;2;248;248;242m tv[0m[38;2;248;248;242m.[0m[38;2;255;255;255mtv_usec[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;248;248;242m;[0m -[38;2;248;248;242m retval = [0m[38;2;166;226;46mselect[0m[38;2;249;38;114m([0m[38;2;190;132;255m1, &rfds, NULL, NULL, &tv[0m[38;2;249;38;114m)[0m[38;2;248;248;242m;[0m -[38;2;248;248;242m /* Don't rely on the value of tv now! */[0m +[38;2;248;248;242m retval [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;248;248;242mselect[0m[38;2;248;248;242m([0m[38;2;190;132;255m1[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;249;38;114m&[0m[38;2;248;248;242mrfds[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;190;132;255mNULL[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;190;132;255mNULL[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;249;38;114m&[0m[38;2;248;248;242mtv[0m[38;2;248;248;242m)[0m[38;2;248;248;242m;[0m +[38;2;248;248;242m [0m[38;2;117;113;94m/*[0m[38;2;117;113;94m Don't rely on the value of tv now! [0m[38;2;117;113;94m*/[0m -[38;2;248;248;242m if (retval == [0m[38;2;166;226;46m-1[0m[38;2;248;248;242m)[0m -[38;2;248;248;242m [0m[38;2;166;226;46mperror[0m[38;2;249;38;114m([0m[38;2;190;132;255m"select([0m[38;2;249;38;114m)[0m[38;2;248;248;242m");[0m -[38;2;248;248;242m else if (retval)[0m -[38;2;248;248;242m [0m[38;2;166;226;46mprintf[0m[38;2;249;38;114m([0m[38;2;190;132;255m"Data is available now.\n"[0m[38;2;249;38;114m)[0m[38;2;248;248;242m;[0m -[38;2;248;248;242m /* [0m[38;2;166;226;46mFD_ISSET[0m[38;2;249;38;114m([0m[38;2;190;132;255m0, &rfds[0m[38;2;249;38;114m)[0m[38;2;248;248;242m will be true. */[0m -[38;2;248;248;242m else[0m -[38;2;248;248;242m [0m[38;2;166;226;46mprintf[0m[38;2;249;38;114m([0m[38;2;190;132;255m"No data within five seconds.\n"[0m[38;2;249;38;114m)[0m[38;2;248;248;242m;[0m +[38;2;248;248;242m [0m[38;2;249;38;114mif[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242mretval [0m[38;2;249;38;114m==[0m[38;2;248;248;242m [0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;248;248;242m)[0m +[38;2;248;248;242m [0m[38;2;102;217;239mperror[0m[38;2;248;248;242m([0m[38;2;230;219;116m"[0m[38;2;230;219;116mselect()[0m[38;2;230;219;116m"[0m[38;2;248;248;242m)[0m[38;2;248;248;242m;[0m +[38;2;248;248;242m [0m[38;2;249;38;114melse[0m[38;2;248;248;242m [0m[38;2;249;38;114mif[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242mretval[0m[38;2;248;248;242m)[0m +[38;2;248;248;242m [0m[38;2;102;217;239mprintf[0m[38;2;248;248;242m([0m[38;2;230;219;116m"[0m[38;2;230;219;116mData is available now.[0m[38;2;190;132;255m\n[0m[38;2;230;219;116m"[0m[38;2;248;248;242m)[0m[38;2;248;248;242m;[0m +[38;2;248;248;242m [0m[38;2;117;113;94m/*[0m[38;2;117;113;94m FD_ISSET(0, &rfds) will be true. [0m[38;2;117;113;94m*/[0m +[38;2;248;248;242m [0m[38;2;249;38;114melse[0m +[38;2;248;248;242m [0m[38;2;102;217;239mprintf[0m[38;2;248;248;242m([0m[38;2;230;219;116m"[0m[38;2;230;219;116mNo data within five seconds.[0m[38;2;190;132;255m\n[0m[38;2;230;219;116m"[0m[38;2;248;248;242m)[0m[38;2;248;248;242m;[0m -[38;2;248;248;242m [0m[38;2;166;226;46mexit[0m[38;2;249;38;114m([0m[38;2;190;132;255mEXIT_SUCCESS[0m[38;2;249;38;114m)[0m[38;2;248;248;242m;[0m -[38;2;248;248;242m }[0m +[38;2;248;248;242m [0m[38;2;102;217;239mexit[0m[38;2;248;248;242m([0m[38;2;248;248;242mEXIT_SUCCESS[0m[38;2;248;248;242m)[0m[38;2;248;248;242m;[0m +[38;2;248;248;242m [0m[38;2;248;248;242m}[0m [38;2;253;151;31mSEE ALSO[0m [38;2;248;248;242m [0m[38;2;166;226;46maccept[0m[38;2;249;38;114m([0m[38;2;190;132;255m2[0m[38;2;249;38;114m)[0m[38;2;248;248;242m, [0m[38;2;166;226;46mconnect[0m[38;2;249;38;114m([0m[38;2;190;132;255m2[0m[38;2;249;38;114m)[0m[38;2;248;248;242m, [0m[38;2;166;226;46mpoll[0m[38;2;249;38;114m([0m[38;2;190;132;255m2[0m[38;2;249;38;114m)[0m[38;2;248;248;242m, [0m[38;2;166;226;46mread[0m[38;2;249;38;114m([0m[38;2;190;132;255m2[0m[38;2;249;38;114m)[0m[38;2;248;248;242m, [0m[38;2;166;226;46mrecv[0m[38;2;249;38;114m([0m[38;2;190;132;255m2[0m[38;2;249;38;114m)[0m[38;2;248;248;242m, [0m[38;2;166;226;46mrestart_syscall[0m[38;2;249;38;114m([0m[38;2;190;132;255m2[0m[38;2;249;38;114m)[0m[38;2;248;248;242m, [0m[38;2;166;226;46msend[0m[38;2;249;38;114m([0m[38;2;190;132;255m2[0m[38;2;249;38;114m)[0m[38;2;248;248;242m, [0m[38;2;166;226;46msigprocmask[0m[38;2;249;38;114m([0m[38;2;190;132;255m2[0m[38;2;249;38;114m)[0m[38;2;248;248;242m, [0m[38;2;166;226;46mwrite[0m[38;2;249;38;114m([0m[38;2;190;132;255m2[0m[38;2;249;38;114m)[0m[38;2;248;248;242m, [0m[38;2;166;226;46mepoll[0m[38;2;249;38;114m([0m[38;2;190;132;255m7[0m[38;2;249;38;114m)[0m[38;2;248;248;242m, [0m[38;2;166;226;46mtime[0m[38;2;249;38;114m([0m[38;2;190;132;255m7[0m[38;2;249;38;114m)[0m |