use oxpcie only if enabled to avoid baud bottleneck of uart.
[minix.git] / test / select / test00.c
blobf25a9cd8c3eea64e226deea760cc0b231c103a83
1 /*
2 * Test name: test00.c
4 * Objetive: The purpose of this test is to make sure that the bitmap
5 * manipulation macros work without problems.
7 * Description: This tests first fills a fd_set bit by bit, and shows it, then
8 * it clears the fd_set bit by bit as well.
10 * Jose M. Gomez
13 #include <sys/types.h>
14 #include <fcntl.h>
15 #include <unistd.h>
16 #include <sys/select.h>
17 #include <stdio.h>
18 #include <stdlib.h>
19 #include <limits.h>
21 int main(int argc, char *argv[]) {
22 fd_set fds;
23 int i,j;
25 FD_ZERO(&fds);
26 for (i=0;i<FD_SETSIZE;i++) {
27 /* see if SET works */
28 FD_SET(i, &fds);
29 if(!FD_ISSET(i, &fds))
30 return 1;
32 FD_ZERO(&fds);
33 for (i=0;i<FD_SETSIZE;i++) {
34 /* see if ZERO works */
35 if(FD_ISSET(i, &fds))
36 return 1;
38 for (i=0;i<FD_SETSIZE;i++) {
39 FD_SET(i, &fds);
40 for(j = 0; j <= i; j++)
41 if(!FD_ISSET(j, &fds))
42 return 1;
43 for(; j < FD_SETSIZE; j++)
44 if(FD_ISSET(j, &fds))
45 return 1;
47 for (i=0;i<FD_SETSIZE;i++) {
48 FD_CLR(i, &fds);
49 for(j = 0; j <= i; j++)
50 if(FD_ISSET(j, &fds))
51 return 1;
52 for(; j < FD_SETSIZE; j++)
53 if(!FD_ISSET(j, &fds))
54 return 1;
56 printf("ok\n");
57 return 0;