source: rtems/cpukit/posix/src/getitimer.c @ 3bacb250

4.104.115
Last change on this file since 3bacb250 was 5860b90, checked in by Joel Sherrill <joel.sherrill@…>, on 05/15/09 at 17:43:02

2009-05-15 Joel Sherrill <joel.sherrill@…>

  • posix/src/getitimer.c, posix/src/setitimer.c: Add error checks and clean up so coverage analysis is possible.
  • Property mode set to 100644
File size: 764 bytes
Line 
1/*
2 *  COPYRIGHT (c) 1989-20089
3 *  On-Line Applications Research Corporation (OAR).
4 *
5 *  The license and distribution terms for this file may be
6 *  found in the file LICENSE in this distribution or at
7 *  http://www.rtems.com/license/LICENSE.
8 *
9 *  $Id$
10 */
11
12#if HAVE_CONFIG_H
13#include "config.h"
14#endif
15
16#include <time.h>
17#include <sys/time.h>
18#include <errno.h>
19#include <rtems/seterr.h>
20
21int getitimer(
22  int               which,
23  struct itimerval *value
24)
25{
26  if ( !value )
27    rtems_set_errno_and_return_minus_one( EFAULT );
28
29  switch ( which ) {
30    case ITIMER_REAL:
31    case ITIMER_VIRTUAL:
32    case ITIMER_PROF:
33      rtems_set_errno_and_return_minus_one( ENOSYS );
34    default:
35      break;
36  }
37  rtems_set_errno_and_return_minus_one( EINVAL );
38}
39
Note: See TracBrowser for help on using the repository browser.