2013-01-11 17:53:44 +01:00
|
|
|
/****************************************************************************
|
2018-05-29 21:21:26 +02:00
|
|
|
* libs/libc/string/lib_psa_dump.c
|
2013-01-11 17:53:44 +01:00
|
|
|
*
|
2021-03-02 15:54:21 +01: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
|
2013-01-11 17:53:44 +01:00
|
|
|
*
|
2021-03-02 15:54:21 +01:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2013-01-11 17:53:44 +01:00
|
|
|
*
|
2021-03-02 15:54:21 +01: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.
|
2013-01-11 17:53:44 +01:00
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Included Files
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#include <nuttx/config.h>
|
|
|
|
|
2016-06-12 19:11:57 +02:00
|
|
|
/* 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
|
|
|
|
|
2013-01-11 17:53:44 +01:00
|
|
|
#include <spawn.h>
|
2020-12-05 06:21:07 +01:00
|
|
|
#include <stdint.h>
|
2013-01-11 17:53:44 +01:00
|
|
|
#include <debug.h>
|
|
|
|
|
2016-06-11 22:14:08 +02:00
|
|
|
#ifdef CONFIG_DEBUG_FEATURES
|
2013-01-11 17:53:44 +01:00
|
|
|
|
|
|
|
/****************************************************************************
|
2015-10-03 00:30:35 +02:00
|
|
|
* Public Functions
|
2013-01-11 17:53:44 +01:00
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* 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)
|
|
|
|
{
|
2016-06-12 02:09:39 +02:00
|
|
|
#ifdef CONFIG_DEBUG_ERROR
|
2016-06-16 20:33:32 +02:00
|
|
|
_err("attr[%p]:\n", attr);
|
|
|
|
_err(" flags: %04x\n", attr->flags);
|
2013-01-11 17:53:44 +01:00
|
|
|
if (attr->flags == 0)
|
|
|
|
{
|
2016-06-16 20:33:32 +02:00
|
|
|
_err(" None\n");
|
2013-01-11 17:53:44 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if ((attr->flags & POSIX_SPAWN_RESETIDS) != 0)
|
|
|
|
{
|
2016-06-16 20:33:32 +02:00
|
|
|
_err(" POSIX_SPAWN_RESETIDS\n");
|
2013-01-11 17:53:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if ((attr->flags & POSIX_SPAWN_SETPGROUP) != 0)
|
|
|
|
{
|
2016-06-16 20:33:32 +02:00
|
|
|
_err(" POSIX_SPAWN_SETPGROUP\n");
|
2013-01-11 17:53:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if ((attr->flags & POSIX_SPAWN_SETSCHEDPARAM) != 0)
|
|
|
|
{
|
2016-06-16 20:33:32 +02:00
|
|
|
_err(" POSIX_SPAWN_SETSCHEDPARAM\n");
|
2013-01-11 17:53:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if ((attr->flags & POSIX_SPAWN_SETSCHEDULER) != 0)
|
|
|
|
{
|
2016-06-16 20:33:32 +02:00
|
|
|
_err(" POSIX_SPAWN_SETSCHEDULER\n");
|
2013-01-11 17:53:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if ((attr->flags & POSIX_SPAWN_SETSIGDEF) != 0)
|
|
|
|
{
|
2016-06-16 20:33:32 +02:00
|
|
|
_err(" POSIX_SPAWN_SETSIGDEF\n");
|
2013-01-11 17:53:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if ((attr->flags & POSIX_SPAWN_SETSIGMASK) != 0)
|
|
|
|
{
|
2016-06-16 20:33:32 +02:00
|
|
|
_err(" POSIX_SPAWN_SETSIGMASK\n");
|
2013-01-11 17:53:44 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-06-16 20:33:32 +02:00
|
|
|
_err(" priority: %d\n", attr->priority);
|
2013-01-11 17:53:44 +01:00
|
|
|
|
2016-06-16 20:33:32 +02:00
|
|
|
_err(" policy: %d\n", attr->policy);
|
2013-01-11 17:53:44 +01:00
|
|
|
if (attr->policy == SCHED_FIFO)
|
|
|
|
{
|
2016-06-16 20:33:32 +02:00
|
|
|
_err(" SCHED_FIFO\n");
|
2013-01-11 17:53:44 +01:00
|
|
|
}
|
|
|
|
else if (attr->policy == SCHED_RR)
|
|
|
|
{
|
2016-06-16 20:33:32 +02:00
|
|
|
_err(" SCHED_RR\n");
|
2013-01-11 17:53:44 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2016-06-16 20:33:32 +02:00
|
|
|
_err(" Unrecognized\n");
|
2013-01-11 17:53:44 +01:00
|
|
|
}
|
|
|
|
|
2020-12-05 06:21:07 +01:00
|
|
|
_err(" sigmask: %08jx\n", (uintmax_t)attr->sigmask);
|
2016-06-12 02:09:39 +02:00
|
|
|
#endif /* CONFIG_DEBUG_ERROR */
|
2013-11-28 22:57:41 +01:00
|
|
|
}
|
2013-01-11 17:53:44 +01:00
|
|
|
|
2016-06-11 22:14:08 +02:00
|
|
|
#endif /* CONFIG_DEBUG_FEATURES */
|