Simplified sigsuspend() a bit.

Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14460 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2005-10-20 18:38:30 +00:00
parent 7d9e0897ed
commit f3bb653937
3 changed files with 28 additions and 23 deletions

View File

@ -1,15 +1,18 @@
/* /*
* Copyright (c) 2005, Haiku Project. All rights reserved. * Copyright (c) 2005, Haiku Project. All rights reserved.
* Distributed under the terms of the Haiku license. * Distributed under the terms of the MIT license.
* *
* Author(s): * Author(s):
* Jérôme Duval * Jérôme Duval
*/ */
#include <errno.h>
#include <syscalls.h> #include <syscalls.h>
#include <errno.h>
#include <signal.h> #include <signal.h>
int int
sigpending(sigset_t *set) sigpending(sigset_t *set)
{ {

View File

@ -1,23 +1,22 @@
/* /*
* Copyright (c) 2005, Haiku Project. All rights reserved. * Copyright (c) 2005, Haiku Project. All rights reserved.
* Distributed under the terms of the Haiku license. * Distributed under the terms of the MIT license.
* *
* Author(s): * Author(s):
* Jérôme Duval * Jérôme Duval
*/ */
#include <errno.h>
#include <syscalls.h> #include <syscalls.h>
#include <errno.h>
#include <signal.h> #include <signal.h>
int int
sigsuspend(const sigset_t *mask) sigsuspend(const sigset_t *mask)
{ {
int err = _kern_sigsuspend(mask); errno = _kern_sigsuspend(mask);
if (err < B_OK) {
errno = err;
return -1; return -1;
}
return 0;
} }

View File

@ -1,21 +1,24 @@
/* /*
* Copyright (c) 2005, Haiku Project. All rights reserved. * Copyright (c) 2005, Haiku Project. All rights reserved.
* Distributed under the terms of the Haiku license. * Distributed under the terms of the MIT license.
* *
* Author(s): * Author(s):
* Jérôme Duval * Jérôme Duval
*/ */
#include <syscalls.h>
#include <errno.h> #include <errno.h>
#include <signal.h> #include <signal.h>
#include <syscalls.h>
#include <unistd.h>
int int
pause() pause(void)
{ {
sigset_t mask; sigset_t mask;
sigemptyset(&mask); sigemptyset(&mask);
errno = _kern_sigsuspend(&mask); errno = _kern_sigsuspend(&mask);
return -1; return -1;
} }