717bb04cb7
Refer to issue #8867 for details and rational. Convert sigset_t to an array type so that more than 32 signals can be supported. Why not use a uin64_t? - Using a uin32_t is more flexible if we decide to increase the number of signals beyound 64. - 64-bit accesses are not atomic, at least not on 32-bit ARMv7-M and similar - Keeping the base type as uint32_t does not introduce additional overhead due to padding to achieve 64-bit alignment of uin64_t - Some architectures still supported by NuttX do not support uin64_t types, Increased the number of signals to 64. This matches Linux. This will support all xsignals defined by Linux and also 32 real time signals (also like Linux). This is is a work in progress; a draft PR that you are encouraged to comment on.
132 lines
3.7 KiB
C
132 lines
3.7 KiB
C
/****************************************************************************
|
|
* libs/libc/spawn/lib_psa_dump.c
|
|
*
|
|
* 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
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* 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.
|
|
*
|
|
****************************************************************************/
|
|
|
|
/****************************************************************************
|
|
* Included Files
|
|
****************************************************************************/
|
|
|
|
#include <nuttx/config.h>
|
|
#include <nuttx/signal.h>
|
|
|
|
/* Output debug info even if debug output is not selected. */
|
|
|
|
#undef CONFIG_DEBUG_ERROR
|
|
#undef CONFIG_DEBUG_WARN
|
|
#undef CONFIG_DEBUG_INFO
|
|
#define CONFIG_DEBUG_ERROR 1
|
|
#define CONFIG_DEBUG_WARN 1
|
|
#define CONFIG_DEBUG_INFO 1
|
|
|
|
#include <spawn.h>
|
|
#include <stdint.h>
|
|
#include <debug.h>
|
|
|
|
#ifdef CONFIG_DEBUG_FEATURES
|
|
|
|
/****************************************************************************
|
|
* Public Functions
|
|
****************************************************************************/
|
|
|
|
/****************************************************************************
|
|
* Name: posix_spawnattr_dump
|
|
*
|
|
* Description:
|
|
* Show the current attributes.
|
|
*
|
|
* Input Parameters:
|
|
* attr - The address of the spawn attributes to be dumped.
|
|
*
|
|
* Returned Value:
|
|
* None
|
|
*
|
|
****************************************************************************/
|
|
|
|
void posix_spawnattr_dump(posix_spawnattr_t *attr)
|
|
{
|
|
#ifdef CONFIG_DEBUG_ERROR
|
|
_err("attr[%p]:\n", attr);
|
|
_err(" flags: %04x\n", attr->flags);
|
|
if (attr->flags == 0)
|
|
{
|
|
_err(" None\n");
|
|
}
|
|
else
|
|
{
|
|
if ((attr->flags & POSIX_SPAWN_RESETIDS) != 0)
|
|
{
|
|
_err(" POSIX_SPAWN_RESETIDS\n");
|
|
}
|
|
|
|
if ((attr->flags & POSIX_SPAWN_SETPGROUP) != 0)
|
|
{
|
|
_err(" POSIX_SPAWN_SETPGROUP\n");
|
|
}
|
|
|
|
if ((attr->flags & POSIX_SPAWN_SETSCHEDPARAM) != 0)
|
|
{
|
|
_err(" POSIX_SPAWN_SETSCHEDPARAM\n");
|
|
}
|
|
|
|
if ((attr->flags & POSIX_SPAWN_SETSCHEDULER) != 0)
|
|
{
|
|
_err(" POSIX_SPAWN_SETSCHEDULER\n");
|
|
}
|
|
|
|
if ((attr->flags & POSIX_SPAWN_SETSIGDEF) != 0)
|
|
{
|
|
_err(" POSIX_SPAWN_SETSIGDEF\n");
|
|
}
|
|
|
|
if ((attr->flags & POSIX_SPAWN_SETSIGMASK) != 0)
|
|
{
|
|
_err(" POSIX_SPAWN_SETSIGMASK\n");
|
|
}
|
|
}
|
|
|
|
_err(" priority: %d\n", attr->priority);
|
|
|
|
_err(" policy: %d\n", attr->policy);
|
|
if (attr->policy == SCHED_OTHER)
|
|
{
|
|
_err(" SCHED_OTHER\n");
|
|
}
|
|
else if (attr->policy == SCHED_FIFO)
|
|
{
|
|
_err(" SCHED_FIFO\n");
|
|
}
|
|
else if (attr->policy == SCHED_RR)
|
|
{
|
|
_err(" SCHED_RR\n");
|
|
}
|
|
else if (attr->policy == SCHED_SPORADIC)
|
|
{
|
|
_err(" SCHED_SPORADIC\n");
|
|
}
|
|
else
|
|
{
|
|
_err(" Unrecognized\n");
|
|
}
|
|
|
|
_err(" sigmask: " SIGSET_FMT "\n", SIGSET_ELEM(&attr->sigmask));
|
|
#endif /* CONFIG_DEBUG_ERROR */
|
|
}
|
|
|
|
#endif /* CONFIG_DEBUG_FEATURES */
|