source: rtems/testsuites/psxtests/psxhdrs/sys/time/select.c @ e25acd8

5
Last change on this file since e25acd8 was e25acd8, checked in by zehata <zenon.hans.taneka@…>, on 12/04/18 at 16:43:59

psxhdrs: Added POSIX Compliance Test fot sys/time.h (GCI 2018)

  • Property mode set to 100644
File size: 1.2 KB
Line 
1/**
2 *  @file
3 *  @brief select() API Conformance Test
4 */
5
6/*
7 *  COPYRIGHT (c) <2018>.
8 *  On-Line Applications Research Corporation (OAR).
9 *
10 *  Permission to use, copy, modify, and/or distribute this software
11 *  for any purpose with or without fee is hereby granted.
12 *
13 *  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
14 *  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
15 *  WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
16 *  BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
17 *  OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
18 *  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
19 *  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20 */
21
22#ifdef HAVE_CONFIG_H
23#include "config.h"
24#endif
25
26#include <sys/time.h>
27
28int test(void);
29
30int test(void)
31{
32  int callback;
33  int nfds = 0;
34  struct timeval tv;
35  time_t tv_sec = 0;
36  suseconds_t tv_usec = 0;
37  fd_set readfds, writefds, errorfds;
38
39  tv.tv_sec = tv_sec;
40  tv.tv_usec = tv_usec;
41  FD_ZERO(&readfds);
42  FD_ZERO(&writefds);
43  FD_ZERO(&errorfds);
44  callback = select(nfds, &readfds, &writefds, &errorfds, &tv);
45  return callback;
46}
Note: See TracBrowser for help on using the repository browser.