More tweaks to the libbsd.so compatibility library:
* added sigsetmask(), and sigblock() * added ALIGN(), ALIGNBYTES, and howmany() macros git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19493 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -10,6 +10,7 @@ SharedLibrary libbsd.so :
|
||||
getpass.c
|
||||
issetugid.c
|
||||
progname.c
|
||||
signal.c
|
||||
stringlist.c
|
||||
unvis.c
|
||||
vis.c
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright 2006, Haiku, Inc. All Rights Reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
* Axel Dörfler, [email protected]
|
||||
*/
|
||||
|
||||
|
||||
#include <signal.h>
|
||||
|
||||
|
||||
int
|
||||
sigsetmask(int mask)
|
||||
{
|
||||
sigset_t set = mask;
|
||||
sigset_t oset;
|
||||
|
||||
if (sigprocmask(SIG_SETMASK, &set, &oset) < 0)
|
||||
return -1;
|
||||
|
||||
return (int)oset;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
sigblock(int mask)
|
||||
{
|
||||
sigset_t set = mask;
|
||||
sigset_t oset;
|
||||
|
||||
if (sigprocmask(SIG_BLOCK, &set, &oset) < 0)
|
||||
return -1;
|
||||
|
||||
return (int)oset;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user