v2 / vlib / os / signal.v
43 lines · 40 sloc · 1.46 KB · 402e239edfe4ab32e3eef57ec68c87fcc67c7388
Raw
1module os
2
3// os.Signal - enumerate possible POSIX signals and
4// their integer codes.
5// Note: the integer codes are given here explicitly,
6// to make it easier to lookup, without needing to
7// consult man pages / signal.h .
8
9pub enum Signal {
10 hup = 1 // hangup
11 int = 2 // interrupt from keyboard
12 quit = 3 // quit from keyboard
13 ill = 4 // illegal instruction
14 trap = 5 // trace trap
15 abrt = 6 // abort
16 bus = 7 // bus error
17 fpe = 8 // floating point exception
18 kill = 9 // kill signal
19 usr1 = 10 // user-defined signal 1
20 segv = 11 // segmentation violation
21 usr2 = 12 // user-defined signal 2
22 pipe = 13 // write on a pipe with no one to read it
23 alrm = 14 // alarm clock
24 term = 15 // software termination signal
25 stkflt = 16 // stack fault
26 chld = 17 // child process has stopped or exited
27 cont = 18 // continue executing, if stopped
28 stop = 19 // stop executing (cannot be caught or ignored)
29 tstp = 20 // stop executing, can be caught and ignored
30 ttin = 21 // terminal input for background process
31 ttou = 22 // terminal output for background process
32 urg = 23 // urgent condition on socket
33 xcpu = 24 // CPU time limit exceeded
34 xfsz = 25 // file size limit exceeded
35 vtalrm = 26 // virtual time alarm
36 prof = 27 // profiling timer alarm
37 winch = 28 // window size change
38 poll = 29 // pollable event occurred
39 pwr = 30 // power failure
40 sys = 31 // bad system call
41}
42
43pub type SignalHandler = fn (Signal)
44