]> git.proxmox.com Git - wasi-libc.git/commitdiff
Remove the signal constants and proc_raise function.
authorDan Gohman <dev@sunfishcode.online>
Wed, 23 Mar 2022 22:07:36 +0000 (15:07 -0700)
committerDan Gohman <dev@sunfishcode.online>
Mon, 28 Mar 2022 21:58:07 +0000 (14:58 -0700)
The WASI signal constants and proc_raise function were removed in the
latest [ephemeral], which had been scheduled to be in the next snapshot,
however WASI itself is now transitioning away from the snapshot system.

WASI libc will also be transitioning to updated wit specs once they're
ready, however until that time, we can make the simple change of
removing these signal constants to avoid confusion.

Fixes #271.
Fixes #272.

[ephemeral]: https://github.com/WebAssembly/WASI/tree/main/phases/ephemeral/witx

expected/wasm32-wasi/defined-symbols.txt
expected/wasm32-wasi/predefined-macros.txt
expected/wasm32-wasi/undefined-symbols.txt
libc-bottom-half/headers/public/wasi/api.h
libc-bottom-half/sources/__wasilibc_real.c

index 866f679f6f2aabe31b46acccec4fe16ee2b1d5da..d136babda62856ba02a2d628fba8757eeb69324c 100644 (file)
@@ -298,7 +298,6 @@ __wasi_path_symlink
 __wasi_path_unlink_file
 __wasi_poll_oneoff
 __wasi_proc_exit
-__wasi_proc_raise
 __wasi_random_get
 __wasi_sched_yield
 __wasi_sock_recv
index c1bb19e9a87e897961f649019282cd959adaa63f..77a54857bc3ef992e65bef2735b8672d373cfa6d 100644 (file)
 #define __WASI_ROFLAGS_RECV_DATA_TRUNCATED ((__wasi_roflags_t)(1 << 0))
 #define __WASI_SDFLAGS_RD ((__wasi_sdflags_t)(1 << 0))
 #define __WASI_SDFLAGS_WR ((__wasi_sdflags_t)(1 << 1))
-#define __WASI_SIGNAL_ABRT (UINT8_C(6))
-#define __WASI_SIGNAL_ALRM (UINT8_C(14))
-#define __WASI_SIGNAL_BUS (UINT8_C(7))
-#define __WASI_SIGNAL_CHLD (UINT8_C(16))
-#define __WASI_SIGNAL_CONT (UINT8_C(17))
-#define __WASI_SIGNAL_FPE (UINT8_C(8))
-#define __WASI_SIGNAL_HUP (UINT8_C(1))
-#define __WASI_SIGNAL_ILL (UINT8_C(4))
-#define __WASI_SIGNAL_INT (UINT8_C(2))
-#define __WASI_SIGNAL_KILL (UINT8_C(9))
-#define __WASI_SIGNAL_NONE (UINT8_C(0))
-#define __WASI_SIGNAL_PIPE (UINT8_C(13))
-#define __WASI_SIGNAL_POLL (UINT8_C(28))
-#define __WASI_SIGNAL_PROF (UINT8_C(26))
-#define __WASI_SIGNAL_PWR (UINT8_C(29))
-#define __WASI_SIGNAL_QUIT (UINT8_C(3))
-#define __WASI_SIGNAL_SEGV (UINT8_C(11))
-#define __WASI_SIGNAL_STOP (UINT8_C(18))
-#define __WASI_SIGNAL_SYS (UINT8_C(30))
-#define __WASI_SIGNAL_TERM (UINT8_C(15))
-#define __WASI_SIGNAL_TRAP (UINT8_C(5))
-#define __WASI_SIGNAL_TSTP (UINT8_C(19))
-#define __WASI_SIGNAL_TTIN (UINT8_C(20))
-#define __WASI_SIGNAL_TTOU (UINT8_C(21))
-#define __WASI_SIGNAL_URG (UINT8_C(22))
-#define __WASI_SIGNAL_USR1 (UINT8_C(10))
-#define __WASI_SIGNAL_USR2 (UINT8_C(12))
-#define __WASI_SIGNAL_VTALRM (UINT8_C(25))
-#define __WASI_SIGNAL_WINCH (UINT8_C(27))
-#define __WASI_SIGNAL_XCPU (UINT8_C(23))
-#define __WASI_SIGNAL_XFSZ (UINT8_C(24))
 #define __WASI_SUBCLOCKFLAGS_SUBSCRIPTION_CLOCK_ABSTIME ((__wasi_subclockflags_t)(1 << 0))
 #define __WASI_WHENCE_CUR (UINT8_C(1))
 #define __WASI_WHENCE_END (UINT8_C(2))
index dd981ecd10e7adf150525e3b8a644df386d573ff..4b3d265e58461bf16dfba78653b2eec763773369 100644 (file)
@@ -50,7 +50,6 @@ __imported_wasi_snapshot_preview1_path_symlink
 __imported_wasi_snapshot_preview1_path_unlink_file
 __imported_wasi_snapshot_preview1_poll_oneoff
 __imported_wasi_snapshot_preview1_proc_exit
-__imported_wasi_snapshot_preview1_proc_raise
 __imported_wasi_snapshot_preview1_random_get
 __imported_wasi_snapshot_preview1_sched_yield
 __imported_wasi_snapshot_preview1_sock_recv
index 7a208be51e5145ba42527ceb98dec49a6aef3dd8..3141644ac72503b0efb31bdc813bd0bf5ad7992c 100644 (file)
@@ -1300,200 +1300,6 @@ typedef uint32_t __wasi_exitcode_t;
 _Static_assert(sizeof(__wasi_exitcode_t) == 4, "witx calculated size");
 _Static_assert(_Alignof(__wasi_exitcode_t) == 4, "witx calculated align");
 
-/**
- * Signal condition.
- */
-typedef uint8_t __wasi_signal_t;
-
-/**
- * No signal. Note that POSIX has special semantics for `kill(pid, 0)`,
- * so this value is reserved.
- */
-#define __WASI_SIGNAL_NONE (UINT8_C(0))
-
-/**
- * Hangup.
- * Action: Terminates the process.
- */
-#define __WASI_SIGNAL_HUP (UINT8_C(1))
-
-/**
- * Terminate interrupt signal.
- * Action: Terminates the process.
- */
-#define __WASI_SIGNAL_INT (UINT8_C(2))
-
-/**
- * Terminal quit signal.
- * Action: Terminates the process.
- */
-#define __WASI_SIGNAL_QUIT (UINT8_C(3))
-
-/**
- * Illegal instruction.
- * Action: Terminates the process.
- */
-#define __WASI_SIGNAL_ILL (UINT8_C(4))
-
-/**
- * Trace/breakpoint trap.
- * Action: Terminates the process.
- */
-#define __WASI_SIGNAL_TRAP (UINT8_C(5))
-
-/**
- * Process abort signal.
- * Action: Terminates the process.
- */
-#define __WASI_SIGNAL_ABRT (UINT8_C(6))
-
-/**
- * Access to an undefined portion of a memory object.
- * Action: Terminates the process.
- */
-#define __WASI_SIGNAL_BUS (UINT8_C(7))
-
-/**
- * Erroneous arithmetic operation.
- * Action: Terminates the process.
- */
-#define __WASI_SIGNAL_FPE (UINT8_C(8))
-
-/**
- * Kill.
- * Action: Terminates the process.
- */
-#define __WASI_SIGNAL_KILL (UINT8_C(9))
-
-/**
- * User-defined signal 1.
- * Action: Terminates the process.
- */
-#define __WASI_SIGNAL_USR1 (UINT8_C(10))
-
-/**
- * Invalid memory reference.
- * Action: Terminates the process.
- */
-#define __WASI_SIGNAL_SEGV (UINT8_C(11))
-
-/**
- * User-defined signal 2.
- * Action: Terminates the process.
- */
-#define __WASI_SIGNAL_USR2 (UINT8_C(12))
-
-/**
- * Write on a pipe with no one to read it.
- * Action: Ignored.
- */
-#define __WASI_SIGNAL_PIPE (UINT8_C(13))
-
-/**
- * Alarm clock.
- * Action: Terminates the process.
- */
-#define __WASI_SIGNAL_ALRM (UINT8_C(14))
-
-/**
- * Termination signal.
- * Action: Terminates the process.
- */
-#define __WASI_SIGNAL_TERM (UINT8_C(15))
-
-/**
- * Child process terminated, stopped, or continued.
- * Action: Ignored.
- */
-#define __WASI_SIGNAL_CHLD (UINT8_C(16))
-
-/**
- * Continue executing, if stopped.
- * Action: Continues executing, if stopped.
- */
-#define __WASI_SIGNAL_CONT (UINT8_C(17))
-
-/**
- * Stop executing.
- * Action: Stops executing.
- */
-#define __WASI_SIGNAL_STOP (UINT8_C(18))
-
-/**
- * Terminal stop signal.
- * Action: Stops executing.
- */
-#define __WASI_SIGNAL_TSTP (UINT8_C(19))
-
-/**
- * Background process attempting read.
- * Action: Stops executing.
- */
-#define __WASI_SIGNAL_TTIN (UINT8_C(20))
-
-/**
- * Background process attempting write.
- * Action: Stops executing.
- */
-#define __WASI_SIGNAL_TTOU (UINT8_C(21))
-
-/**
- * High bandwidth data is available at a socket.
- * Action: Ignored.
- */
-#define __WASI_SIGNAL_URG (UINT8_C(22))
-
-/**
- * CPU time limit exceeded.
- * Action: Terminates the process.
- */
-#define __WASI_SIGNAL_XCPU (UINT8_C(23))
-
-/**
- * File size limit exceeded.
- * Action: Terminates the process.
- */
-#define __WASI_SIGNAL_XFSZ (UINT8_C(24))
-
-/**
- * Virtual timer expired.
- * Action: Terminates the process.
- */
-#define __WASI_SIGNAL_VTALRM (UINT8_C(25))
-
-/**
- * Profiling timer expired.
- * Action: Terminates the process.
- */
-#define __WASI_SIGNAL_PROF (UINT8_C(26))
-
-/**
- * Window changed.
- * Action: Ignored.
- */
-#define __WASI_SIGNAL_WINCH (UINT8_C(27))
-
-/**
- * I/O possible.
- * Action: Terminates the process.
- */
-#define __WASI_SIGNAL_POLL (UINT8_C(28))
-
-/**
- * Power failure.
- * Action: Terminates the process.
- */
-#define __WASI_SIGNAL_PWR (UINT8_C(29))
-
-/**
- * Bad system call.
- * Action: Terminates the process.
- */
-#define __WASI_SIGNAL_SYS (UINT8_C(30))
-
-_Static_assert(sizeof(__wasi_signal_t) == 1, "witx calculated size");
-_Static_assert(_Alignof(__wasi_signal_t) == 1, "witx calculated align");
-
 /**
  * Flags provided to `sock_recv`.
  */
@@ -2181,16 +1987,6 @@ _Noreturn void __wasi_proc_exit(
      */
     __wasi_exitcode_t rval
 );
-/**
- * Send a signal to the process of the calling thread.
- * Note: This is similar to `raise` in POSIX.
- */
-__wasi_errno_t __wasi_proc_raise(
-    /**
-     * The signal condition to trigger.
-     */
-    __wasi_signal_t sig
-) __attribute__((__warn_unused_result__));
 /**
  * Temporarily yield execution of the calling thread.
  * Note: This is similar to `sched_yield` in POSIX.
index e6481f701e7561b2b2b04b9d5941de9c746fbcb1..37ca7d95a1f306af6db408740333b564540b4157 100644 (file)
@@ -574,18 +574,6 @@ _Noreturn void __wasi_proc_exit(
     __imported_wasi_snapshot_preview1_proc_exit((int32_t) rval);
 }
 
-int32_t __imported_wasi_snapshot_preview1_proc_raise(int32_t arg0) __attribute__((
-    __import_module__("wasi_snapshot_preview1"),
-    __import_name__("proc_raise")
-));
-
-__wasi_errno_t __wasi_proc_raise(
-    __wasi_signal_t sig
-){
-    int32_t ret = __imported_wasi_snapshot_preview1_proc_raise((int32_t) sig);
-    return (uint16_t) ret;
-}
-
 int32_t __imported_wasi_snapshot_preview1_sched_yield() __attribute__((
     __import_module__("wasi_snapshot_preview1"),
     __import_name__("sched_yield")