Back to index

glibc  2.9
timerfd.h
Go to the documentation of this file.
00001 /* Copyright (C) 2008 Free Software Foundation, Inc.
00002    This file is part of the GNU C Library.
00003 
00004    The GNU C Library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Lesser General Public
00006    License as published by the Free Software Foundation; either
00007    version 2.1 of the License, or (at your option) any later version.
00008 
00009    The GNU C Library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Lesser General Public License for more details.
00013 
00014    You should have received a copy of the GNU Lesser General Public
00015    License along with the GNU C Library; if not, write to the Free
00016    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00017    02111-1307 USA.  */
00018 
00019 #ifndef       _SYS_TIMERFD_H
00020 #define       _SYS_TIMERFD_H       1
00021 
00022 #include <time.h>
00023 
00024 
00025 /* Bits to be set in the FLAGS parameter of `timerfd_create'.  */
00026 enum
00027   {
00028     TFD_CLOEXEC = 0x400000,
00029 #define TFD_CLOEXEC TFD_CLOEXEC
00030     TFD_NONBLOCK = 0x4000
00031 #define TFD_NONBLOCK TFD_NONBLOCK
00032   };
00033 
00034 
00035 /* Bits to be set in the FLAGS parameter of `timerfd_settime'.  */
00036 enum
00037   {
00038     TFD_TIMER_ABSTIME = 1 << 0
00039 #define TFD_TIMER_ABSTIME TFD_TIMER_ABSTIME
00040   };
00041 
00042 
00043 __BEGIN_DECLS
00044 
00045 /* Return file descriptor for new interval timer source.  */
00046 extern int timerfd_create (clockid_t __clock_id, int __flags) __THROW;
00047 
00048 /* Set next expiration time of interval timer source UFD to UTMR.  If
00049    FLAGS has the TFD_TIMER_ABSTIME flag set the timeout value is
00050    absolute.  Optionally return the old expiration time in OTMR.  */
00051 extern int timerfd_settime (int __ufd, int __flags,
00052                          __const struct itimerspec *__utmr,
00053                          struct itimerspec *__otmr) __THROW;
00054 
00055 /* Return the next expiration time of UFD.  */
00056 extern int timerfd_gettime (int __ufd, struct itimerspec *__otmr) __THROW;
00057 
00058 __END_DECLS
00059 
00060 #endif /* sys/timerfd.h */