File tree Expand file tree Collapse file tree 15 files changed +38
-65
lines changed Expand file tree Collapse file tree 15 files changed +38
-65
lines changed Original file line number Diff line number Diff line change @@ -250,15 +250,6 @@ add_proxy_header_library(
250
250
libc.include.locale
251
251
)
252
252
253
- add_proxy_header_library (
254
- sighandler_t
255
- HDRS
256
- sighandler_t.h
257
- FULL_BUILD_DEPENDS
258
- libc.include.llvm-libc-types.__sighandler_t
259
- libc.include.signal
260
- )
261
-
262
253
add_proxy_header_library (
263
254
stack_t
264
255
HDRS
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -284,13 +284,14 @@ add_header_macro(
284
284
signal.h
285
285
DEPENDS
286
286
.llvm-libc-macros.signal_macros
287
+ .llvm-libc-types.pid_t
287
288
.llvm-libc-types.sig_atomic_t
289
+ .llvm-libc-types.sighandler_t
290
+ .llvm-libc-types.siginfo_t
288
291
.llvm-libc-types.sigset_t
292
+ .llvm-libc-types.stack_t
289
293
.llvm-libc-types.struct_sigaction
290
294
.llvm-libc-types.union_sigval
291
- .llvm-libc-types.siginfo_t
292
- .llvm-libc-types.stack_t
293
- .llvm-libc-types.pid_t
294
295
)
295
296
296
297
add_header_macro (
Original file line number Diff line number Diff line change 16
16
#define SIGSEGV 11
17
17
#define SIGTERM 15
18
18
19
- #define SIG_DFL ((__sighandler_t )(0))
20
- #define SIG_IGN ((__sighandler_t )(1))
21
- #define SIG_ERR ((__sighandler_t )(-1))
19
+ #define SIG_DFL ((void (*)(int) )(0))
20
+ #define SIG_IGN ((void (*)(int) )(1))
21
+ #define SIG_ERR ((void (*)(int) )(-1))
22
22
23
23
// Max signal number
24
24
#define NSIG 64
Original file line number Diff line number Diff line change 86
86
#error "Signal stack sizes not defined for your platform."
87
87
#endif
88
88
89
- #define SIG_DFL ((__sighandler_t )0)
90
- #define SIG_IGN ((__sighandler_t )1)
91
- #define SIG_ERR ((__sighandler_t)-1 )
89
+ #define SIG_DFL ((void (*)(int) )0)
90
+ #define SIG_IGN ((void (*)(int) )1)
91
+ #define SIG_ERR ((void (*)(int))(-1) )
92
92
93
93
// SIGCHLD si_codes
94
94
#define CLD_EXITED 1 // child has exited
Original file line number Diff line number Diff line change @@ -15,7 +15,6 @@ add_header(__pthread_start_t HDR __pthread_start_t.h)
15
15
add_header (__pthread_tss_dtor_t HDR __pthread_tss_dtor_t.h )
16
16
add_header (__qsortcompare_t HDR __qsortcompare_t.h )
17
17
add_header (__qsortrcompare_t HDR __qsortrcompare_t.h )
18
- add_header (__sighandler_t HDR __sighandler_t.h )
19
18
add_header (__thread_type HDR __thread_type.h )
20
19
add_header (blkcnt_t HDR blkcnt_t.h )
21
20
add_header (blksize_t HDR blksize_t.h )
@@ -66,6 +65,7 @@ if(LIBC_TYPES_TIME_T_IS_32_BIT)
66
65
else ()
67
66
add_header (time_t HDR time_t_64.h DEST_HDR time_t.h )
68
67
endif ()
68
+ add_header (sighandler_t HDR sighandler_t.h )
69
69
add_header (stack_t HDR stack_t.h DEPENDS .size_t )
70
70
add_header (suseconds_t HDR suseconds_t.h )
71
71
add_header (struct_dirent HDR struct_dirent.h DEPENDS .ino_t .off_t )
Original file line number Diff line number Diff line change 1
- //===-- Definition of struct __sighandler_t -------------------------------===//
1
+ //===-- Definition of sighandler_t --------- -------------------------------===//
2
2
//
3
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
4
// See https://llvm.org/LICENSE.txt for license information.
5
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
6
//
7
7
//===----------------------------------------------------------------------===//
8
8
9
- #ifndef LLVM_LIBC_TYPES___SIGHANDLER_T_H
10
- #define LLVM_LIBC_TYPES___SIGHANDLER_T_H
9
+ #ifndef LLVM_LIBC_TYPES_SIGHANDLER_T_H
10
+ #define LLVM_LIBC_TYPES_SIGHANDLER_T_H
11
11
12
- typedef void (* __sighandler_t )(int );
12
+ #ifdef __linux__
13
+ // For compatibility with glibc.
14
+ typedef void (* sighandler_t )(int );
15
+ #endif
13
16
14
- #endif // LLVM_LIBC_TYPES___SIGHANDLER_T_H
17
+ #endif // LLVM_LIBC_TYPES_SIGHANDLER_T_H
Original file line number Diff line number Diff line change @@ -25,6 +25,4 @@ struct sigaction {
25
25
#endif
26
26
};
27
27
28
- typedef void (* __sighandler_t )(int );
29
-
30
28
#endif // LLVM_LIBC_TYPES_STRUCT_SIGACTION_H
Original file line number Diff line number Diff line change @@ -3,12 +3,13 @@ header_template: signal.h.def
3
3
macros : []
4
4
types :
5
5
- type_name : pid_t
6
- - type_name : stack_t
6
+ - type_name : sig_atomic_t
7
+ - type_name : sighandler_t
7
8
- type_name : siginfo_t
8
- - type_name : struct_sigaction
9
9
- type_name : sigset_t
10
+ - type_name : stack_t
11
+ - type_name : struct_sigaction
10
12
- type_name : union_sigval
11
- - type_name : sig_atomic_t
12
13
enums : []
13
14
objects : []
14
15
functions :
@@ -69,10 +70,15 @@ functions:
69
70
- name : signal
70
71
standards :
71
72
- stdc
72
- return_type : __sighandler_t
73
+ # May the Geneva Convention have mercy on my soul... Why this insanity?
74
+ # Well: signal returns a function pointer to a function with no return
75
+ # value and which accepts an int. The parameter list appears on the far
76
+ # right of the declaration. i.e.
77
+ # void (*signal(int, void (*)(int)))(int);
78
+ return_type : void (*
73
79
arguments :
74
80
- type : int
75
- - type : __sighandler_t
81
+ - type : void (*)(int)))(int
76
82
- name : sigprocmask
77
83
standards :
78
84
- POSIX
Original file line number Diff line number Diff line change @@ -127,7 +127,6 @@ add_entrypoint_object(
127
127
DEPENDS
128
128
.sigaction
129
129
libc.hdr.signal_macros
130
- libc.hdr.types.sighandler_t
131
130
)
132
131
133
132
add_entrypoint_object (
You can’t perform that action at this time.
0 commit comments