0 | -- Note: This module is automatically generated when Idris builds
  1 | -- the library and the constants will be replaced with values
  2 | -- matching the system this is generated on.
  3 | --
  4 | -- The placeholders are here so that it works with tools like the LSP
  5 | -- without first compiling the library. They were generated on an x86_64
  6 | -- GNU/Linux system with GCC. If you are on a similar system, your numbers
  7 | -- might very well be identical.
  8 | module System.Posix.Signal.Types
  9 |
 10 | import Data.Bits
 11 | import Data.C.Integer
 12 | import Data.SortedMap
 13 | import Derive.Prelude
 14 |
 15 | %default total
 16 | %language ElabReflection
 17 |
 18 | public export
 19 | data How : Type where
 20 |   SIG_BLOCK   : How
 21 |   SIG_UNBLOCK : How
 22 |   SIG_SETMASK : How
 23 |
 24 | %runElab derive "How" [Show,Eq,Ord]
 25 |
 26 | public export
 27 | record Signal where
 28 |   constructor S
 29 |   sig : Bits32
 30 |
 31 | %runElab derive "Signal" [Show,Eq,Ord,FromInteger]
 32 |
 33 |
 34 | public export
 35 | howCode : How -> Bits8
 36 | howCode SIG_BLOCK   = 0
 37 | howCode SIG_UNBLOCK = 1
 38 | howCode SIG_SETMASK = 2
 39 |
 40 | public export
 41 | SIGRTMIN : Signal
 42 | SIGRTMIN = 34
 43 |
 44 | public export
 45 | SIGRTMAX : Signal
 46 | SIGRTMAX = 64
 47 |
 48 | public export %inline
 49 | SIGHUP : Signal
 50 | SIGHUP = 1
 51 |
 52 | public export %inline
 53 | SIGINT : Signal
 54 | SIGINT = 2
 55 |
 56 | public export %inline
 57 | SIGQUIT : Signal
 58 | SIGQUIT = 3
 59 |
 60 | public export %inline
 61 | SIGILL : Signal
 62 | SIGILL = 4
 63 |
 64 | public export %inline
 65 | SIGTRAP : Signal
 66 | SIGTRAP = 5
 67 |
 68 | public export %inline
 69 | SIGABRT : Signal
 70 | SIGABRT = 6
 71 |
 72 | public export %inline
 73 | SIGBUS : Signal
 74 | SIGBUS = 7
 75 |
 76 | public export %inline
 77 | SIGFPE : Signal
 78 | SIGFPE = 8
 79 |
 80 | public export %inline
 81 | SIGKILL : Signal
 82 | SIGKILL = 9
 83 |
 84 | public export %inline
 85 | SIGUSR1 : Signal
 86 | SIGUSR1 = 10
 87 |
 88 | public export %inline
 89 | SIGSEGV : Signal
 90 | SIGSEGV = 11
 91 |
 92 | public export %inline
 93 | SIGUSR2 : Signal
 94 | SIGUSR2 = 12
 95 |
 96 | public export %inline
 97 | SIGPIPE : Signal
 98 | SIGPIPE = 13
 99 |
100 | public export %inline
101 | SIGALRM : Signal
102 | SIGALRM = 14
103 |
104 | public export %inline
105 | SIGTERM : Signal
106 | SIGTERM = 15
107 |
108 | public export %inline
109 | SIGCHLD : Signal
110 | SIGCHLD = 17
111 |
112 | public export %inline
113 | SIGCONT : Signal
114 | SIGCONT = 18
115 |
116 | public export %inline
117 | SIGSTOP : Signal
118 | SIGSTOP = 19
119 |
120 | public export %inline
121 | SIGTSTP : Signal
122 | SIGTSTP = 20
123 |
124 | public export %inline
125 | SIGTTIN : Signal
126 | SIGTTIN = 21
127 |
128 | public export %inline
129 | SIGTTOU : Signal
130 | SIGTTOU = 22
131 |
132 | public export %inline
133 | SIGURG : Signal
134 | SIGURG = 23
135 |
136 | public export %inline
137 | SIGXCPU : Signal
138 | SIGXCPU = 24
139 |
140 | public export %inline
141 | SIGXFSZ : Signal
142 | SIGXFSZ = 25
143 |
144 | public export %inline
145 | SIGVTALRM : Signal
146 | SIGVTALRM = 26
147 |
148 | public export %inline
149 | SIGPROF : Signal
150 | SIGPROF = 27
151 |
152 | public export %inline
153 | SIGWINCH : Signal
154 | SIGWINCH = 28
155 |
156 | public export %inline
157 | SIGSYS : Signal
158 | SIGSYS = 31
159 |
160 | public export %inline
161 | SIGPOLL : Signal
162 | SIGPOLL = 29
163 |
164 | export
165 | sigName : SortedMap Signal String
166 | sigName =
167 |   SortedMap.fromList
168 |     [ (SIGHUP, "SIGHUP")
169 |     , (SIGINT, "SIGINT")
170 |     , (SIGQUIT, "SIGQUIT")
171 |     , (SIGILL, "SIGILL")
172 |     , (SIGTRAP, "SIGTRAP")
173 |     , (SIGABRT, "SIGABRT")
174 |     , (SIGBUS, "SIGBUS")
175 |     , (SIGFPE, "SIGFPE")
176 |     , (SIGKILL, "SIGKILL")
177 |     , (SIGUSR1, "SIGUSR1")
178 |     , (SIGSEGV, "SIGSEGV")
179 |     , (SIGUSR2, "SIGUSR2")
180 |     , (SIGPIPE, "SIGPIPE")
181 |     , (SIGALRM, "SIGALRM")
182 |     , (SIGTERM, "SIGTERM")
183 |     , (SIGCHLD, "SIGCHLD")
184 |     , (SIGCONT, "SIGCONT")
185 |     , (SIGSTOP, "SIGSTOP")
186 |     , (SIGTSTP, "SIGTSTP")
187 |     , (SIGTTIN, "SIGTTIN")
188 |     , (SIGTTOU, "SIGTTOU")
189 |     , (SIGURG, "SIGURG")
190 |     , (SIGXCPU, "SIGXCPU")
191 |     , (SIGXFSZ, "SIGXFSZ")
192 |     , (SIGVTALRM, "SIGVTALRM")
193 |     , (SIGPROF, "SIGPROF")
194 |     , (SIGWINCH, "SIGWINCH")
195 |     , (SIGSYS, "SIGSYS")
196 |     , (SIGPOLL, "SIGPOLL")
197 |     ]
198 |
199 | public export %inline
200 | siginfo_t_size : Bits32
201 | siginfo_t_size = 128
202 |