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(
250250 libc.include .locale
251251)
252252
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-
262253add_proxy_header_library(
263254 stack_t
264255 HDRS
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -284,13 +284,14 @@ add_header_macro(
284284 signal.h
285285 DEPENDS
286286 .llvm-libc-macros .signal_macros
287+ .llvm-libc-types.pid_t
287288 .llvm-libc-types.sig_atomic_t
289+ .llvm-libc-types.sighandler_t
290+ .llvm-libc-types.siginfo_t
288291 .llvm-libc-types.sigset_t
292+ .llvm-libc-types.stack_t
289293 .llvm-libc-types.struct_sigaction
290294 .llvm-libc-types.union_sigval
291- .llvm-libc-types.siginfo_t
292- .llvm-libc-types.stack_t
293- .llvm-libc-types.pid_t
294295)
295296
296297add_header_macro(
Original file line number Diff line number Diff line change 1616#define SIGSEGV 11
1717#define SIGTERM 15
1818
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))
2222
2323// Max signal number
2424#define NSIG 64
Original file line number Diff line number Diff line change 8686#error "Signal stack sizes not defined for your platform."
8787#endif
8888
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) )
9292
9393// SIGCHLD si_codes
9494#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)
1515add_header(__pthread_tss_dtor_t HDR __pthread_tss_dtor_t.h)
1616add_header(__qsortcompare_t HDR __qsortcompare_t.h)
1717add_header(__qsortrcompare_t HDR __qsortrcompare_t.h)
18- add_header(__sighandler_t HDR __sighandler_t.h)
1918add_header(__thread_type HDR __thread_type.h)
2019add_header(blkcnt_t HDR blkcnt_t.h)
2120add_header(blksize_t HDR blksize_t.h)
@@ -66,6 +65,7 @@ if(LIBC_TYPES_TIME_T_IS_32_BIT)
6665else ()
6766 add_header(time_t HDR time_t_64.h DEST_HDR time_t.h)
6867endif ()
68+ add_header(sighandler_t HDR sighandler_t.h)
6969add_header(stack_t HDR stack_t.h DEPENDS .size_t)
7070add_header(suseconds_t HDR suseconds_t.h)
7171add_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 --------- -------------------------------===//
22//
33// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44// See https://llvm.org/LICENSE.txt for license information.
55// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66//
77//===----------------------------------------------------------------------===//
88
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
1111
12- typedef void (* __sighandler_t )(int );
12+ #ifdef __linux__
13+ // For compatibility with glibc.
14+ typedef void (* sighandler_t )(int );
15+ #endif
1316
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 {
2525#endif
2626};
2727
28- typedef void (* __sighandler_t )(int );
29-
3028#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
33macros : []
44types :
55 - type_name : pid_t
6- - type_name : stack_t
6+ - type_name : sig_atomic_t
7+ - type_name : sighandler_t
78 - type_name : siginfo_t
8- - type_name : struct_sigaction
99 - type_name : sigset_t
10+ - type_name : stack_t
11+ - type_name : struct_sigaction
1012 - type_name : union_sigval
11- - type_name : sig_atomic_t
1213enums : []
1314objects : []
1415functions :
@@ -69,10 +70,15 @@ functions:
6970 - name : signal
7071 standards :
7172 - 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 (*
7379 arguments :
7480 - type : int
75- - type : __sighandler_t
81+ - type : void (*)(int)))(int
7682 - name : sigprocmask
7783 standards :
7884 - POSIX
Original file line number Diff line number Diff line change @@ -127,7 +127,6 @@ add_entrypoint_object(
127127 DEPENDS
128128 .sigaction
129129 libc.hdr.signal_macros
130- libc.hdr.types.sighandler_t
131130)
132131
133132add_entrypoint_object(
You can’t perform that action at this time.
0 commit comments