File tree Expand file tree Collapse file tree 17 files changed +348
-0
lines changed Expand file tree Collapse file tree 17 files changed +348
-0
lines changed Original file line number Diff line number Diff line change @@ -363,6 +363,10 @@ set(TARGET_LIBC_ENTRYPOINTS
363
363
# sys/uio.h entrypoints
364
364
libc.src.sys.uio.writev
365
365
libc.src.sys.uio.readv
366
+
367
+ # sys/time.h entrypoints
368
+ libc.src.sys.time.setitimer
369
+ libc.src.sys.time.getitimer
366
370
)
367
371
368
372
if(LLVM_LIBC_INCLUDE_SCUDO)
Original file line number Diff line number Diff line change @@ -185,6 +185,9 @@ set(TARGET_LIBC_ENTRYPOINTS
185
185
# libc.src.sys.epoll.epoll_pwait
186
186
# libc.src.sys.epoll.epoll_pwait2
187
187
188
+ # sys/time.h entrypoints
189
+ libc.src.sys.time.setitimer
190
+ libc.src.sys.time.getitimer
188
191
)
189
192
190
193
if(LLVM_LIBC_FULL_BUILD)
Original file line number Diff line number Diff line change @@ -368,6 +368,10 @@ set(TARGET_LIBC_ENTRYPOINTS
368
368
# sys/uio.h entrypoints
369
369
libc.src.sys.uio.writev
370
370
libc.src.sys.uio.readv
371
+
372
+ # sys/time.h entrypoints
373
+ libc.src.sys.time.setitimer
374
+ libc.src.sys.time.getitimer
371
375
)
372
376
373
377
if(LLVM_LIBC_INCLUDE_SCUDO)
Original file line number Diff line number Diff line change @@ -190,6 +190,15 @@ add_proxy_header_library(
190
190
libc.include.sys_time
191
191
)
192
192
193
+ add_proxy_header_library (
194
+ struct_itimerval
195
+ HDRS
196
+ struct_itimerval.h
197
+ FULL_BUILD_DEPENDS
198
+ libc.include.llvm-libc-types.struct_itimerval
199
+ libc.include.sys_time
200
+ )
201
+
193
202
add_proxy_header_library (
194
203
pid_t
195
204
HDRS
Original file line number Diff line number Diff line change
1
+ //===-- Proxy for struct itimerval ----------------------------------------===//
2
+ //
3
+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
+ // See https://llvm.org/LICENSE.txt for license information.
5
+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
+ //
7
+ //===----------------------------------------------------------------------===//
8
+ #ifndef LLVM_LIBC_HDR_TYPES_STRUCT_ITIMERVAL_H
9
+ #define LLVM_LIBC_HDR_TYPES_STRUCT_ITIMERVAL_H
10
+
11
+ #ifdef LIBC_FULL_BUILD
12
+
13
+ #include "include/llvm-libc-types/struct_itimerval.h"
14
+
15
+ #else
16
+
17
+ #include <sys/time.h>
18
+
19
+ #endif // LIBC_FULL_BUILD
20
+
21
+ #endif // LLVM_LIBC_HDR_TYPES_STRUCT_ITIMERVAL_H
Original file line number Diff line number Diff line change @@ -77,6 +77,7 @@ add_header(struct_pollfd HDR struct_pollfd.h)
77
77
add_header (struct_rlimit HDR struct_rlimit.h DEPENDS .rlim_t )
78
78
add_header (struct_sched_param HDR struct_sched_param.h )
79
79
add_header (struct_timeval HDR struct_timeval.h DEPENDS .suseconds_t .time_t )
80
+ add_header (struct_itimerval HDR struct_itimerval.h DEPENDS .struct_timeval )
80
81
add_header (struct_rusage HDR struct_rusage.h DEPENDS .struct_timeval )
81
82
add_header (union_sigval HDR union_sigval.h )
82
83
add_header (siginfo_t HDR siginfo_t.h DEPENDS .union_sigval .pid_t .uid_t .clock_t )
Original file line number Diff line number Diff line change
1
+ //===-- Definition of struct itimerval ------------------------------------===//
2
+ //
3
+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
+ // See https://llvm.org/LICENSE.txt for license information.
5
+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
+ //
7
+ //===----------------------------------------------------------------------===//
8
+
9
+ #ifndef LLVM_LIBC_TYPES_STRUCT_ITIMERVAL_H
10
+ #define LLVM_LIBC_TYPES_STRUCT_ITIMERVAL_H
11
+
12
+ #include "struct_timeval.h"
13
+
14
+ struct itimerval {
15
+ struct timeval it_interval ; /* Interval for periodic timer */
16
+ struct timeval it_value ; /* Time until next expiration */
17
+ };
18
+
19
+ #endif // LLVM_LIBC_TYPES_STRUCT_ITIMERVAL_H
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ standards: Linux
4
4
macros : []
5
5
types :
6
6
- type_name : struct_timeval
7
+ - type_name : struct_itimerval
7
8
enums : []
8
9
objects : []
9
10
functions :
@@ -12,3 +13,20 @@ functions:
12
13
arguments :
13
14
- type : const char*
14
15
- type : const struct timeval*
16
+
17
+ - name : setitimer
18
+ standards :
19
+ - POSIX
20
+ return_type : int
21
+ arguments :
22
+ - type : int
23
+ - type : const struct itimerval *__restrict
24
+ - type : struct itimerval *__restrict
25
+
26
+ - name : getitimer
27
+ standards :
28
+ - POSIX
29
+ return_type : int
30
+ arguments :
31
+ - type : int
32
+ - type : struct itimerval *
Original file line number Diff line number Diff line change @@ -8,3 +8,17 @@ add_entrypoint_object(
8
8
DEPENDS
9
9
.${LIBC_TARGET_OS}.utimes
10
10
)
11
+
12
+ add_entrypoint_object (
13
+ setitimer
14
+ ALIAS
15
+ DEPENDS
16
+ .${LIBC_TARGET_OS}.setitimer
17
+ )
18
+
19
+ add_entrypoint_object (
20
+ getitimer
21
+ ALIAS
22
+ DEPENDS
23
+ .${LIBC_TARGET_OS}.getitimer
24
+ )
Original file line number Diff line number Diff line change
1
+ // ===-- Implementation header for getitimer -------------------------------===//
2
+ //
3
+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
+ // See https://llvm.org/LICENSE.txt for license information.
5
+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
+ //
7
+ // ===----------------------------------------------------------------------===//
8
+
9
+ #ifndef LLVM_LIBC_SRC_SYS_TIME_GETITIMER_H
10
+ #define LLVM_LIBC_SRC_SYS_TIME_GETITIMER_H
11
+
12
+ #include " hdr/types/struct_itimerval.h"
13
+ #include " src/__support/macros/config.h"
14
+
15
+ namespace LIBC_NAMESPACE_DECL {
16
+ int getitimer (int which, struct itimerval *curr_value);
17
+ } // namespace LIBC_NAMESPACE_DECL
18
+
19
+ #endif // LLVM_LIBC_SRC_SYS_TIME_GETITIMER_H
You can’t perform that action at this time.
0 commit comments