added a libroot sigsuspend, kernel support isn't implemented

(fixed partly bug #48)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14129 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jérôme Duval 2005-09-08 12:26:16 +00:00
parent 7f539a934a
commit 96e6579454
5 changed files with 42 additions and 3 deletions

View File

@ -29,6 +29,7 @@ extern int _user_send_signal(pid_t tid, uint sig);
extern int _user_sigprocmask(int how, const sigset_t *set, sigset_t *oldSet);
extern int _user_sigaction(int sig, const struct sigaction *action, struct sigaction *oldAction);
extern bigtime_t _user_set_alarm(bigtime_t time, uint32 mode);
extern int _user_sigsuspend(const sigset_t *mask);
#ifdef __cplusplus
} // extern "C"

View File

@ -99,10 +99,11 @@ extern status_t _kern_get_next_team_info(int32 *cookie, team_info *info);
extern status_t _kern_get_team_usage_info(team_id team, int32 who, team_usage_info *info, size_t size);
// signal functions
extern int _kern_send_signal(pid_t tid, uint sig);
extern int _kern_sigprocmask(int how, const sigset_t *set, sigset_t *oldSet);
extern int _kern_sigaction(int sig, const struct sigaction *action, struct sigaction *oldAction);
extern int _kern_send_signal(pid_t tid, uint sig);
extern int _kern_sigprocmask(int how, const sigset_t *set, sigset_t *oldSet);
extern int _kern_sigaction(int sig, const struct sigaction *action, struct sigaction *oldAction);
extern bigtime_t _kern_set_alarm(bigtime_t time, uint32 mode);
extern int _kern_sigsuspend(const sigset_t *mask);
// image functions
extern image_id _kern_register_image(image_info *info, size_t size);

View File

@ -598,3 +598,16 @@ _user_sigaction(int signal, const struct sigaction *userAction, struct sigaction
return status;
}
int
_user_sigsuspend(const sigset_t *mask) {
sigset_t set;
if (mask == NULL)
return B_BAD_VALUE;
if (user_memcpy(&set, mask, sizeof(sigset_t)) < B_OK)
return B_BAD_ADDRESS;
// Todo : implement
return EINVAL;
}

View File

@ -8,6 +8,7 @@ KernelMergeObject posix_signal.o :
signal.c
sigprocmask.c
sigset.c
sigsuspend.c
strsignal.c
: -fPIC -DPIC
;

View File

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