RTEMS 6.1-rc4
Loading...
Searching...
No Matches
face.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
20/*
21 * Copyright (C) 2022 On-Line Applications Research Corporation (OAR)
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the above copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 *
32 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
33 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
34 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
35 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
36 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
37 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
38 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
39 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
40 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
41 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
42 * POSSIBILITY OF SUCH DAMAGE.
43 */
44
45#ifndef _RTEMS_CONFDEFS_FACE_H
46#define _RTEMS_CONFDEFS_FACE_H
47
48#ifndef __CONFIGURATION_TEMPLATE_h
49#error "Do not include this file directly, use <rtems/confdefs.h> instead"
50#endif
51
52#ifdef CONFIGURE_INIT
53
54#ifdef CONFIGURE_POSIX_TIMERS_FACE_BEHAVIOR
55
56 #include <rtems/posix/timer.h>
57
59 clockid_t clock_id
60 )
61 {
62 /*
63 * Per the FACE Technical Standard, POSIX timers should not be
64 * allowed on CLOCK_REALTIME for safety reasons. If the application
65 * wants the FACE behavior, then this method is instantiated.
66 */
67 if ( clock_id == CLOCK_REALTIME ) {
68 return EPERM;
69 }
70
71 if ( clock_id != CLOCK_MONOTONIC ) {
72 return EINVAL;
73 }
74
75 return 0;
76 }
77
78#endif /* CONFIGURE_POSIX_TIMERS_FACE_BEHAVIOR */
79
80#endif /* CONFIGURE_INIT */
81
82#endif /* _RTEMS_CONFDEFS_FACE_H */
POSIX Timers Internal Support.
int _POSIX_Timer_Is_allowed(clockid_t clock_id)
Follow POSIX or FACE Technical Standard on timer_create.
Definition: psxtimercreate.c:54