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:
Axel Dörfler
2006-12-13 16:26:43 +00:00
parent caddb025c9
commit 8f813eeb9d
4 changed files with 91 additions and 0 deletions
+1
View File
@@ -10,6 +10,7 @@ SharedLibrary libbsd.so :
getpass.c
issetugid.c
progname.c
signal.c
stringlist.c
unvis.c
vis.c
+37
View File
@@ -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;
}