2015-10-03 07:43:18 +08:00
|
|
|
/****************************************************************************
|
2014-08-09 04:21:48 +08:00
|
|
|
* sched/pthread/pthread_sigmask.c
|
2007-03-24 07:22:22 +08:00
|
|
|
*
|
2021-02-08 23:33:58 +08:00
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed with
|
|
|
|
* this work for additional information regarding copyright ownership. The
|
|
|
|
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
|
|
|
* "License"); you may not use this file except in compliance with the
|
|
|
|
* License. You may obtain a copy of the License at
|
2007-03-24 07:22:22 +08:00
|
|
|
*
|
2021-02-08 23:33:58 +08:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2007-03-24 07:22:22 +08:00
|
|
|
*
|
2021-02-08 23:33:58 +08:00
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
|
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
|
|
* License for the specific language governing permissions and limitations
|
|
|
|
* under the License.
|
2007-03-24 07:22:22 +08:00
|
|
|
*
|
2015-10-03 07:43:18 +08:00
|
|
|
****************************************************************************/
|
2007-03-24 07:22:22 +08:00
|
|
|
|
2015-10-03 07:43:18 +08:00
|
|
|
/****************************************************************************
|
2007-03-24 07:22:22 +08:00
|
|
|
* Included Files
|
2015-10-03 07:43:18 +08:00
|
|
|
****************************************************************************/
|
2009-12-15 02:39:29 +08:00
|
|
|
|
|
|
|
#include <nuttx/config.h>
|
2007-03-24 07:22:22 +08:00
|
|
|
|
|
|
|
#include <signal.h>
|
|
|
|
#include <pthread.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#include <debug.h>
|
|
|
|
|
2017-10-08 22:13:47 +08:00
|
|
|
#include <nuttx/signal.h>
|
|
|
|
|
2015-10-03 07:43:18 +08:00
|
|
|
/****************************************************************************
|
2007-03-24 07:22:22 +08:00
|
|
|
* Public Functions
|
2015-10-03 07:43:18 +08:00
|
|
|
****************************************************************************/
|
2007-03-24 07:22:22 +08:00
|
|
|
|
2015-10-03 07:43:18 +08:00
|
|
|
/****************************************************************************
|
2012-07-15 03:30:31 +08:00
|
|
|
* Name: pthread_sigmask
|
2007-03-24 07:22:22 +08:00
|
|
|
*
|
|
|
|
* Description:
|
2017-10-08 02:16:10 +08:00
|
|
|
* This function is a simple wrapper around nxsig_procmask().
|
|
|
|
* See the nxsig_procmask() function description for further
|
2007-03-24 07:22:22 +08:00
|
|
|
* information.
|
|
|
|
*
|
2018-03-13 23:52:27 +08:00
|
|
|
* Input Parameters:
|
2020-10-17 06:16:23 +08:00
|
|
|
* how - How the signal mask will be changed:
|
2007-03-24 07:22:22 +08:00
|
|
|
* SIG_BLOCK - The resulting set is the union of
|
|
|
|
* the current set and the signal set
|
|
|
|
* pointed to by 'set'.
|
|
|
|
* SIG_UNBLOCK - The resulting set is the intersection
|
|
|
|
* of the current set and the complement
|
|
|
|
* of the signal set pointed to by 'set'.
|
|
|
|
* SIG_SETMASK - The resulting set is the signal set
|
|
|
|
* pointed to by 'set'.
|
|
|
|
* set - Location of the new signal mask
|
|
|
|
* oset - Location to store the old signal mask
|
|
|
|
*
|
2018-02-02 00:00:02 +08:00
|
|
|
* Returned Value:
|
2017-10-08 02:16:10 +08:00
|
|
|
* On success, this function will return 0 (OK). It will return EINVAL if
|
|
|
|
* how is invalid.
|
2007-03-24 07:22:22 +08:00
|
|
|
*
|
2015-10-03 07:43:18 +08:00
|
|
|
****************************************************************************/
|
2007-03-24 07:22:22 +08:00
|
|
|
|
|
|
|
int pthread_sigmask(int how, FAR const sigset_t *set, FAR sigset_t *oset)
|
|
|
|
{
|
2017-10-08 02:16:10 +08:00
|
|
|
int ret = nxsig_procmask(how, set, oset);
|
|
|
|
return ret < 0 ? -ret : OK;
|
2007-03-24 07:22:22 +08:00
|
|
|
}
|