Revision eda379a3 xseg/drivers/user/xseg_posix.c
b/xseg/drivers/user/xseg_posix.c | ||
---|---|---|
174 | 174 |
static int posix_prepare_wait(struct xseg *xseg, uint32_t portno) |
175 | 175 |
{ |
176 | 176 |
struct xseg_port *port = xseg_get_port(xseg, portno); |
177 |
if (!port)
|
|
177 |
if (!port) |
|
178 | 178 |
return -1; |
179 | 179 |
struct posix_signal_desc *psd = xseg_get_signal_desc(xseg, port); |
180 | 180 |
if (!psd) |
... | ... | |
186 | 186 |
static int posix_cancel_wait(struct xseg *xseg, uint32_t portno) |
187 | 187 |
{ |
188 | 188 |
struct xseg_port *port = xseg_get_port(xseg, portno); |
189 |
if (!port)
|
|
189 |
if (!port) |
|
190 | 190 |
return -1; |
191 | 191 |
struct posix_signal_desc *psd = xseg_get_signal_desc(xseg, port); |
192 | 192 |
if (!psd) |
... | ... | |
217 | 217 |
static int posix_signal(struct xseg *xseg, uint32_t portno) |
218 | 218 |
{ |
219 | 219 |
struct xseg_port *port = xseg_get_port(xseg, portno); |
220 |
if (!port)
|
|
220 |
if (!port) |
|
221 | 221 |
return -1; |
222 | 222 |
struct posix_signal_desc *psd = xseg_get_signal_desc(xseg, port); |
223 | 223 |
if (!psd) |
224 | 224 |
return -1; |
225 | 225 |
pid_t cue = (pid_t)psd->waitcue; |
226 | 226 |
if (!cue) |
227 |
return 0; |
|
227 |
//HACKY! |
|
228 |
return -2; |
|
228 | 229 |
|
229 | 230 |
/* FIXME: Make calls to xseg_signal() check for errors */ |
230 | 231 |
return syscall(SYS_tkill, cue, SIGIO); |
... | ... | |
262 | 263 |
|
263 | 264 |
void * posix_alloc_data(struct xseg *xseg) |
264 | 265 |
{ |
265 |
struct xobject_h *sd_h = xseg_get_objh(xseg, MAGIC_POSIX_SD,
|
|
266 |
struct xobject_h *sd_h = xseg_get_objh(xseg, MAGIC_POSIX_SD, |
|
266 | 267 |
sizeof(struct posix_signal_desc)); |
267 | 268 |
return sd_h; |
268 | 269 |
} |
Also available in: Unified diff