Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions libc/include/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@ add_header_macro(
.llvm-libc-macros.signal_macros
.llvm-libc-types.pid_t
.llvm-libc-types.sig_atomic_t
.llvm-libc-types.sig_t
.llvm-libc-types.sighandler_t
.llvm-libc-types.siginfo_t
.llvm-libc-types.sigset_t
Expand Down
4 changes: 4 additions & 0 deletions libc/include/llvm-libc-macros/linux/signal-macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,5 +150,9 @@
#define SI_TIMER (-2) // Expiration of a timer set by timer_settime()
#define SI_ASYNCIO (-4) // Completion of an synchronous I/O request
#define SI_MESGQ (-3) // Arrival of a message on an empty message queue
#define SI_SIGIO (-5) // Queued SIGIO, on older versions of Linux
#define SI_TKILL (-6) // Sent by tkill or tgkill
#define SI_ASYNCNL (-60) // Async name lookup completion
#define SI_KERNEL 128 // Sent by the kernel

#endif // LLVM_LIBC_MACROS_LINUX_SIGNAL_MACROS_H
1 change: 1 addition & 0 deletions libc/include/llvm-libc-types/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ add_header(rlim_t HDR rlim_t.h)
add_header(sem_t HDR sem_t.h DEPENDS .__futex_word)
add_header(time_t HDR time_t_64.h DEST_HDR time_t.h)
add_header(timer_t HDR timer_t.h)
add_header(sig_t HDR sig_t.h)
add_header(sighandler_t HDR sighandler_t.h)
add_header(stack_t HDR stack_t.h DEPENDS .size_t)
add_header(suseconds_t HDR suseconds_t.h)
Expand Down
20 changes: 20 additions & 0 deletions libc/include/llvm-libc-types/sig_t.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
///
/// \file
/// Definition of sig_t type.
///
//===----------------------------------------------------------------------===//

#ifndef LLVM_LIBC_TYPES_SIG_T_H
#define LLVM_LIBC_TYPES_SIG_T_H

// BSD type for signal handlers.
typedef void (*sig_t)(int);

#endif // LLVM_LIBC_TYPES_SIG_T_H
2 changes: 1 addition & 1 deletion libc/include/llvm-libc-types/siginfo_t.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ typedef struct {
/* POSIX.1b timers */
struct {
int si_tid; /* timer id */
int _overrun; /* overrun count */
int si_overrun; /* overrun count */
union sigval si_sigval; /* same as below */
} _timer;

Expand Down
5 changes: 5 additions & 0 deletions libc/include/signal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ macros:
types:
- type_name: pid_t
- type_name: sig_atomic_t
- type_name: sig_t
standards:
- bsd
- type_name: sighandler_t
standards:
- gnu
- type_name: siginfo_t
- type_name: sigset_t
- type_name: stack_t
Expand Down
Loading