2016-08-07 22:25:30 +08:00
|
|
|
/****************************************************************************
|
2014-08-09 04:55:16 +08:00
|
|
|
* sched/timer/timer_getoverrun.c
|
2007-03-21 08:56:49 +08:00
|
|
|
*
|
2020-03-12 04:09:41 +08:00
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed with
|
|
|
|
* this work for additional information regarding copyright ownership. The
|
|
|
|
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
|
|
|
* "License"); you may not use this file except in compliance with the
|
|
|
|
* License. You may obtain a copy of the License at
|
2007-03-21 08:56:49 +08:00
|
|
|
*
|
2020-03-12 04:09:41 +08:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2007-03-21 08:56:49 +08:00
|
|
|
*
|
2020-03-12 04:09:41 +08:00
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
|
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
|
|
* License for the specific language governing permissions and limitations
|
|
|
|
* under the License.
|
2007-03-21 08:56:49 +08:00
|
|
|
*
|
2016-08-07 22:25:30 +08:00
|
|
|
****************************************************************************/
|
2007-03-21 08:56:49 +08:00
|
|
|
|
2016-08-07 22:25:30 +08:00
|
|
|
/****************************************************************************
|
2007-03-21 08:56:49 +08:00
|
|
|
* Included Files
|
2016-08-07 22:25:30 +08:00
|
|
|
****************************************************************************/
|
2007-03-21 08:56:49 +08:00
|
|
|
|
|
|
|
#include <nuttx/config.h>
|
2012-07-15 03:30:31 +08:00
|
|
|
|
2007-03-21 08:56:49 +08:00
|
|
|
#include <time.h>
|
|
|
|
#include <errno.h>
|
2012-07-15 03:30:31 +08:00
|
|
|
|
2014-08-09 04:55:16 +08:00
|
|
|
#include "timer/timer.h"
|
2007-03-21 08:56:49 +08:00
|
|
|
|
|
|
|
#ifndef CONFIG_DISABLE_POSIX_TIMERS
|
|
|
|
|
2016-08-07 22:25:30 +08:00
|
|
|
/****************************************************************************
|
2007-03-21 08:56:49 +08:00
|
|
|
* Public Functions
|
2016-08-07 22:25:30 +08:00
|
|
|
****************************************************************************/
|
2007-03-21 08:56:49 +08:00
|
|
|
|
2016-08-07 22:25:30 +08:00
|
|
|
/****************************************************************************
|
2012-07-15 03:30:31 +08:00
|
|
|
* Name: timer_getoverrun
|
2007-03-21 08:56:49 +08:00
|
|
|
*
|
|
|
|
* Description:
|
2016-08-07 22:25:30 +08:00
|
|
|
* Only a single signal will be queued to the process for a given timer at
|
|
|
|
* any point in time. When a timer for which a signal is still pending
|
|
|
|
* expires, no signal will be queued, and a timer overrun will occur. When
|
|
|
|
* a timer expiration signal is delivered to or accepted by a process, if
|
|
|
|
* the implementation supports the Realtime Signals Extension, the
|
|
|
|
* timer_getoverrun() function will return the timer expiration overrun
|
|
|
|
* count for the specified timer. The overrun count returned contains the
|
|
|
|
* number of extra timer expirations that occurred between the time the
|
|
|
|
* signal was generated (queued) and when it was delivered or accepted, up
|
|
|
|
* to but not including an implementation-defined maximum of
|
|
|
|
* DELAYTIMER_MAX. If the number of such extra expirations is greater than
|
|
|
|
* or equal to DELAYTIMER_MAX, then the overrun count will be set to
|
|
|
|
* DELAYTIMER_MAX. The value returned by timer_getoverrun() will apply to
|
|
|
|
* the most recent expiration signal delivery or acceptance for the timer.
|
|
|
|
* If no expiration signal has been delivered for the timer, or if the
|
|
|
|
* Realtime Signals Extension is not supported, the return value of
|
|
|
|
* timer_getoverrun() is unspecified.
|
2007-03-21 08:56:49 +08:00
|
|
|
*
|
2018-03-13 23:52:27 +08:00
|
|
|
* Input Parameters:
|
2007-03-21 08:56:49 +08:00
|
|
|
* timerid - The pre-thread timer, previously created by the call to
|
|
|
|
* timer_create(), whose overrun count will be returned..
|
|
|
|
*
|
2018-02-02 00:00:02 +08:00
|
|
|
* Returned Value:
|
2007-03-21 08:56:49 +08:00
|
|
|
* If the timer_getoverrun() function succeeds, it will return the timer
|
2016-08-07 22:25:30 +08:00
|
|
|
* expiration overrun count as explained above. timer_getoverrun() will
|
|
|
|
* fail if:
|
2007-03-21 08:56:49 +08:00
|
|
|
*
|
|
|
|
* EINVAL - The timerid argument does not correspond to an ID returned by
|
|
|
|
* timer_create() but not yet deleted by timer_delete().
|
|
|
|
*
|
|
|
|
* Assumptions:
|
|
|
|
*
|
2016-08-07 22:25:30 +08:00
|
|
|
****************************************************************************/
|
2007-03-21 08:56:49 +08:00
|
|
|
|
|
|
|
int timer_getoverrun(timer_t timerid)
|
|
|
|
{
|
2022-07-11 23:11:40 +08:00
|
|
|
UNUSED(timerid);
|
2023-09-13 19:42:05 +08:00
|
|
|
set_errno(EINVAL);
|
2007-03-22 01:21:26 +08:00
|
|
|
return ERROR;
|
2007-03-21 08:56:49 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* CONFIG_DISABLE_POSIX_TIMERS */
|