Skip to content

Commit 70a66cb

Browse files
committed
libc-wasi: remove unused code
1 parent eed3a8f commit 70a66cb

2 files changed

Lines changed: 0 additions & 162 deletions

File tree

core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/include/wasmtime_ssp.h

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -266,37 +266,6 @@ typedef uint8_t __wasi_sdflags_t;
266266
typedef uint16_t __wasi_siflags_t;
267267

268268
typedef uint8_t __wasi_signal_t;
269-
// 0 is reserved; POSIX has special semantics for kill(pid, 0).
270-
#define __WASI_SIGHUP (1)
271-
#define __WASI_SIGINT (2)
272-
#define __WASI_SIGQUIT (3)
273-
#define __WASI_SIGILL (4)
274-
#define __WASI_SIGTRAP (5)
275-
#define __WASI_SIGABRT (6)
276-
#define __WASI_SIGBUS (7)
277-
#define __WASI_SIGFPE (8)
278-
#define __WASI_SIGKILL (9)
279-
#define __WASI_SIGUSR1 (10)
280-
#define __WASI_SIGSEGV (11)
281-
#define __WASI_SIGUSR2 (12)
282-
#define __WASI_SIGPIPE (13)
283-
#define __WASI_SIGALRM (14)
284-
#define __WASI_SIGTERM (15)
285-
#define __WASI_SIGCHLD (16)
286-
#define __WASI_SIGCONT (17)
287-
#define __WASI_SIGSTOP (18)
288-
#define __WASI_SIGTSTP (19)
289-
#define __WASI_SIGTTIN (20)
290-
#define __WASI_SIGTTOU (21)
291-
#define __WASI_SIGURG (22)
292-
#define __WASI_SIGXCPU (23)
293-
#define __WASI_SIGXFSZ (24)
294-
#define __WASI_SIGVTALRM (25)
295-
#define __WASI_SIGPROF (26)
296-
#define __WASI_SIGWINCH (27)
297-
#define __WASI_SIGPOLL (28)
298-
#define __WASI_SIGPWR (29)
299-
#define __WASI_SIGSYS (30)
300269

301270
typedef uint16_t __wasi_subclockflags_t;
302271
#define __WASI_SUBSCRIPTION_CLOCK_ABSTIME (0x0001)
@@ -989,20 +958,6 @@ __wasi_errno_t wasmtime_ssp_poll_oneoff(
989958
size_t *nevents
990959
) WASMTIME_SSP_SYSCALL_NAME(poll_oneoff) __attribute__((__warn_unused_result__));
991960

992-
#if 0
993-
/**
994-
* We throw exception in libc-wasi wrapper function wasi_proc_exit()
995-
* but not call this function.
996-
*/
997-
_Noreturn void wasmtime_ssp_proc_exit(
998-
__wasi_exitcode_t rval
999-
) WASMTIME_SSP_SYSCALL_NAME(proc_exit);
1000-
#endif
1001-
1002-
__wasi_errno_t wasmtime_ssp_proc_raise(
1003-
__wasi_signal_t sig
1004-
) WASMTIME_SSP_SYSCALL_NAME(proc_raise) __attribute__((__warn_unused_result__));
1005-
1006961
__wasi_errno_t wasmtime_ssp_random_get(
1007962
void *buf,
1008963
size_t buf_len

core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/posix.c

Lines changed: 0 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -2793,123 +2793,6 @@ wasmtime_ssp_poll_oneoff(
27932793
return error;
27942794
}
27952795

2796-
#if 0
2797-
/**
2798-
* We throw exception in libc-wasi wrapper function wasi_proc_exit()
2799-
* but not call this function.
2800-
*/
2801-
void wasmtime_ssp_proc_exit(
2802-
__wasi_exitcode_t rval
2803-
) {
2804-
_Exit((int32)rval);
2805-
}
2806-
#endif
2807-
2808-
__wasi_errno_t
2809-
wasmtime_ssp_proc_raise(__wasi_signal_t sig)
2810-
{
2811-
static const int signals[] = {
2812-
#define X(v) [__WASI_##v] = v
2813-
#if defined(SIGABRT)
2814-
X(SIGABRT),
2815-
#endif
2816-
#if defined(SIGALRM)
2817-
X(SIGALRM),
2818-
#endif
2819-
#if defined(SIGBUS)
2820-
X(SIGBUS),
2821-
#endif
2822-
#if defined(SIGCHLD)
2823-
X(SIGCHLD),
2824-
#endif
2825-
#if defined(SIGCONT)
2826-
X(SIGCONT),
2827-
#endif
2828-
#if defined(SIGFPE)
2829-
X(SIGFPE),
2830-
#endif
2831-
#if defined(SIGHUP)
2832-
X(SIGHUP),
2833-
#endif
2834-
#if defined(SIGILL)
2835-
X(SIGILL),
2836-
#endif
2837-
#if defined(SIGINT)
2838-
X(SIGINT),
2839-
#endif
2840-
#if defined(SIGKILL)
2841-
X(SIGKILL),
2842-
#endif
2843-
#if defined(SIGPIPE)
2844-
X(SIGPIPE),
2845-
#endif
2846-
#if defined(SIGQUIT)
2847-
X(SIGQUIT),
2848-
#endif
2849-
#if defined(SIGSYS)
2850-
X(SIGSEGV),
2851-
#endif
2852-
#if defined(SIGSTOP)
2853-
X(SIGSTOP),
2854-
#endif
2855-
#if defined(SIGSYS)
2856-
X(SIGSYS),
2857-
#endif
2858-
#if defined(SIGTERM)
2859-
X(SIGTERM),
2860-
#endif
2861-
#if defined(SIGTRAP)
2862-
X(SIGTRAP),
2863-
#endif
2864-
#if defined(SIGTSTP)
2865-
X(SIGTSTP),
2866-
#endif
2867-
#if defined(SIGTTIN)
2868-
X(SIGTTIN),
2869-
#endif
2870-
#if defined(SIGTTOU)
2871-
X(SIGTTOU),
2872-
#endif
2873-
#if defined(SIGURG)
2874-
X(SIGURG),
2875-
#endif
2876-
#if defined(SIGUSR1)
2877-
X(SIGUSR1),
2878-
#endif
2879-
#if defined(SIGUSR2)
2880-
X(SIGUSR2),
2881-
#endif
2882-
#if defined(SIGVTALRM)
2883-
X(SIGVTALRM),
2884-
#endif
2885-
#if defined(SIGXCPU)
2886-
X(SIGXCPU),
2887-
#endif
2888-
#if defined(SIGXFSZ)
2889-
X(SIGXFSZ),
2890-
#endif
2891-
#undef X
2892-
};
2893-
if (sig >= sizeof(signals) / sizeof(signals[0]) || signals[sig] == 0)
2894-
return __WASI_EINVAL;
2895-
2896-
#if CONFIG_TLS_USE_GSBASE
2897-
// TLS on OS X depends on installing a SIGSEGV handler. Reset SIGSEGV
2898-
// to the default action before raising.
2899-
if (sig == __WASI_SIGSEGV) {
2900-
struct sigaction sa = {
2901-
.sa_handler = SIG_DFL,
2902-
};
2903-
sigemptyset(&sa.sa_mask);
2904-
sigaction(SIGSEGV, &sa, NULL);
2905-
}
2906-
#endif
2907-
2908-
if (raise(signals[sig]) < 0)
2909-
return convert_errno(errno);
2910-
return 0;
2911-
}
2912-
29132796
__wasi_errno_t
29142797
wasmtime_ssp_random_get(void *buf, size_t nbyte)
29152798
{

0 commit comments

Comments
 (0)