This is an automated email from the ASF dual-hosted git repository.
acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 623b1a9ad18 libc/spawn: inline trivial posix_spawnattr accessors
623b1a9ad18 is described below
commit 623b1a9ad182cbd85c9027893513bdeb03765878
Author: jingfei <[email protected]>
AuthorDate: Fri Nov 20 18:46:02 2026 +0800
libc/spawn: inline trivial posix_spawnattr accessors
Most posix_spawnattr get/set functions only copy one field, yet each
is a separate translation unit, so every caller pays a call and the
callee's prologue for a single load or store.
Define the eleven single-field accessors once in spawn.h, marked
POSIX_SPAWN_INLINE (static inline by default), and build
lib_psa_inline.c with POSIX_SPAWN_INLINE empty, as the spinlock
helpers do. libc still exports callable versions for callers that do
not include spawn.h or take an accessor's address.
Signed-off-by: jingfei <[email protected]>
---
include/spawn.h | 97 +++++++++++++++++++---
libs/libc/spawn/CMakeLists.txt | 14 +---
libs/libc/spawn/Make.defs | 7 +-
libs/libc/spawn/lib_psa_destroy.c | 62 --------------
libs/libc/spawn/lib_psa_getflags.c | 59 -------------
libs/libc/spawn/lib_psa_getschedpolicy.c | 60 -------------
libs/libc/spawn/lib_psa_getsigmask.c | 61 --------------
libs/libc/spawn/lib_psa_getstacksize.c | 61 --------------
.../{lib_psa_getpriority.c => lib_psa_inline.c} | 30 ++-----
libs/libc/spawn/lib_psa_setflags.c | 58 -------------
libs/libc/spawn/lib_psa_setpriority.c | 60 -------------
libs/libc/spawn/lib_psa_setschedpolicy.c | 59 -------------
libs/libc/spawn/lib_psa_setsigmask.c | 61 --------------
libs/libc/spawn/lib_psa_setstacksize.c | 61 --------------
14 files changed, 95 insertions(+), 655 deletions(-)
diff --git a/include/spawn.h b/include/spawn.h
index 384a7971f2a..cfbac15cd3a 100644
--- a/include/spawn.h
+++ b/include/spawn.h
@@ -38,6 +38,15 @@
* Pre-processor Definitions
****************************************************************************/
+/* The single-field posix_spawnattr accessors are defined in this header.
+ * lib_psa_inline.c defines POSIX_SPAWN_INLINE empty to emit the callable
+ * libc versions.
+ */
+
+#ifndef POSIX_SPAWN_INLINE
+# define POSIX_SPAWN_INLINE static inline_function
+#endif
+
/* Configuration ************************************************************/
#ifndef CONFIG_POSIX_SPAWN_DEFAULT_STACKSIZE
@@ -180,12 +189,23 @@ int posix_spawn_file_actions_addopen(
int posix_spawnattr_init(FAR posix_spawnattr_t *attr);
-int posix_spawnattr_destroy(FAR posix_spawnattr_t *attr);
+POSIX_SPAWN_INLINE
+int posix_spawnattr_destroy(FAR posix_spawnattr_t *attr)
+{
+ (void)attr;
+ return 0;
+}
/* Get spawn attributes interfaces */
+POSIX_SPAWN_INLINE
int posix_spawnattr_getflags(FAR const posix_spawnattr_t *attr,
- FAR short *flags);
+ FAR short *flags)
+{
+ *flags = (short)attr->flags;
+ return 0;
+}
+
#ifdef CONFIG_SCHED_PROCESS_GROUPS
int posix_spawnattr_getpgroup(FAR const posix_spawnattr_t *attr,
FAR pid_t *pgroup);
@@ -194,15 +214,34 @@ int posix_spawnattr_getpgroup(FAR const posix_spawnattr_t
*attr,
#endif
int posix_spawnattr_getschedparam(FAR const posix_spawnattr_t *attr,
FAR struct sched_param *);
+
+POSIX_SPAWN_INLINE
int posix_spawnattr_getschedpolicy(FAR const posix_spawnattr_t *attr,
- FAR int *policy);
+ FAR int *policy)
+{
+ *policy = (int)attr->policy;
+ return 0;
+}
+
#define posix_spawnattr_getsigdefault(attr,sigdefault) (ENOSYS)
+
+POSIX_SPAWN_INLINE
int posix_spawnattr_getsigmask(FAR const posix_spawnattr_t *attr,
- FAR sigset_t *sigmask);
+ FAR sigset_t *sigmask)
+{
+ *sigmask = attr->sigmask;
+ return 0;
+}
/* Set spawn attributes interfaces */
-int posix_spawnattr_setflags(FAR posix_spawnattr_t *attr, short flags);
+POSIX_SPAWN_INLINE
+int posix_spawnattr_setflags(FAR posix_spawnattr_t *attr, short flags)
+{
+ attr->flags = (uint8_t)flags;
+ return 0;
+}
+
#ifdef CONFIG_SCHED_PROCESS_GROUPS
int posix_spawnattr_setpgroup(FAR posix_spawnattr_t *attr, pid_t pgroup);
#else
@@ -210,20 +249,56 @@ int posix_spawnattr_setpgroup(FAR posix_spawnattr_t
*attr, pid_t pgroup);
#endif
int posix_spawnattr_setschedparam(FAR posix_spawnattr_t *attr,
FAR const struct sched_param *);
-int posix_spawnattr_setschedpolicy(FAR posix_spawnattr_t *attr, int policy);
+
+POSIX_SPAWN_INLINE
+int posix_spawnattr_setschedpolicy(FAR posix_spawnattr_t *attr, int policy)
+{
+ attr->policy = (uint8_t)policy;
+ return 0;
+}
+
#define posix_spawnattr_setsigdefault(attr,sigdefault) (ENOSYS)
+
+POSIX_SPAWN_INLINE
int posix_spawnattr_setsigmask(FAR posix_spawnattr_t *attr,
- FAR const sigset_t *sigmask);
+ FAR const sigset_t *sigmask)
+{
+ attr->sigmask = *sigmask;
+ return 0;
+}
/* Non-standard get/set spawn attributes interfaces */
+POSIX_SPAWN_INLINE
int posix_spawnattr_getstacksize(FAR const posix_spawnattr_t *attr,
- FAR size_t *stacksize);
+ FAR size_t *stacksize)
+{
+ *stacksize = attr->stacksize;
+ return 0;
+}
+
+POSIX_SPAWN_INLINE
int posix_spawnattr_setstacksize(FAR posix_spawnattr_t *attr,
- size_t stacksize);
+ size_t stacksize)
+{
+ attr->stacksize = stacksize;
+ return 0;
+}
+
+POSIX_SPAWN_INLINE
int posix_spawnattr_setpriority(FAR posix_spawnattr_t *attr,
- uint8_t priority);
-uint8_t posix_spawnattr_getpriority(FAR posix_spawnattr_t *attr);
+ uint8_t priority)
+{
+ attr->priority = priority;
+ return 0;
+}
+
+POSIX_SPAWN_INLINE
+uint8_t posix_spawnattr_getpriority(FAR posix_spawnattr_t *attr)
+{
+ return attr->priority;
+}
+
#ifndef CONFIG_BUILD_KERNEL
int posix_spawnattr_getstackaddr(FAR const posix_spawnattr_t *attr,
FAR void **stackaddr);
diff --git a/libs/libc/spawn/CMakeLists.txt b/libs/libc/spawn/CMakeLists.txt
index 9ea672f3369..dfc42ab0dc1 100644
--- a/libs/libc/spawn/CMakeLists.txt
+++ b/libs/libc/spawn/CMakeLists.txt
@@ -27,20 +27,10 @@ set(SRCS
lib_psfa_addopen.c
lib_psfa_destroy.c
lib_psfa_init.c
- lib_psa_getflags.c
lib_psa_getschedparam.c
- lib_psa_getschedpolicy.c
lib_psa_init.c
- lib_psa_setflags.c
- lib_psa_setschedparam.c
- lib_psa_setschedpolicy.c
- lib_psa_getsigmask.c
- lib_psa_setsigmask.c
- lib_psa_getstacksize.c
- lib_psa_setstacksize.c
- lib_psa_getpriority.c
- lib_psa_setpriority.c
- lib_psa_destroy.c)
+ lib_psa_inline.c
+ lib_psa_setschedparam.c)
if(NOT CONFIG_BUILD_KERNEL)
list(APPEND SRCS lib_psa_getstackaddr.c lib_psa_setstackaddr.c)
diff --git a/libs/libc/spawn/Make.defs b/libs/libc/spawn/Make.defs
index 56e5850e4ce..758b1edd176 100644
--- a/libs/libc/spawn/Make.defs
+++ b/libs/libc/spawn/Make.defs
@@ -25,11 +25,8 @@
CSRCS += lib_psfa_addaction.c lib_psfa_addclose.c lib_psfa_adddup2.c
CSRCS += lib_psfa_addopen.c lib_psfa_destroy.c lib_psfa_init.c
-CSRCS += lib_psa_getflags.c lib_psa_getschedparam.c lib_psa_getschedpolicy.c
-CSRCS += lib_psa_init.c lib_psa_setflags.c lib_psa_setschedparam.c
-CSRCS += lib_psa_setschedpolicy.c lib_psa_getsigmask.c lib_psa_setsigmask.c
-CSRCS += lib_psa_getstacksize.c lib_psa_setstacksize.c lib_psa_destroy.c
-CSRCS += lib_psa_getpriority.c lib_psa_setpriority.c
+CSRCS += lib_psa_getschedparam.c lib_psa_init.c lib_psa_inline.c
+CSRCS += lib_psa_setschedparam.c
ifneq ($(CONFIG_BUILD_KERNEL),y)
CSRCS += lib_psa_getstackaddr.c lib_psa_setstackaddr.c
diff --git a/libs/libc/spawn/lib_psa_destroy.c
b/libs/libc/spawn/lib_psa_destroy.c
deleted file mode 100644
index c56375d9d32..00000000000
--- a/libs/libc/spawn/lib_psa_destroy.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/****************************************************************************
- * libs/libc/spawn/lib_psa_destroy.c
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * 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 <sched.h>
-#include <spawn.h>
-#include <assert.h>
-#include <errno.h>
-
-#include <nuttx/sched.h>
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: posix_spawnattr_destroy
- *
- * Description:
- * The posix_spawnattr_destroy() function shall destroy a spawn attributes
- * object. A destroyed attr attributes object can be reinitialized using
- * posix_spawnattr_init();
- *
- * Input Parameters:
- * attr - The address of the spawn attributes to be destroyed.
- *
- * Returned Value:
- * Return 0 on success. On failure returns an error
- * number from <errno.h>.
- *
- ****************************************************************************/
-
-int posix_spawnattr_destroy(FAR posix_spawnattr_t *attr)
-{
- UNUSED(attr);
-
- return OK;
-}
diff --git a/libs/libc/spawn/lib_psa_getflags.c
b/libs/libc/spawn/lib_psa_getflags.c
deleted file mode 100644
index 779705a24bc..00000000000
--- a/libs/libc/spawn/lib_psa_getflags.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/****************************************************************************
- * libs/libc/spawn/lib_psa_getflags.c
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * 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 <spawn.h>
-#include <assert.h>
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: posix_spawnattr_getflags
- *
- * Description:
- * The posix_spawnattr_getflags() function will obtain the value of the
- * spawn-flags attribute from the attributes object referenced by attr.
- *
- * Input Parameters:
- * attr - The address spawn attributes to be queried.
- * flags - The location to return the spawn flags
- *
- * Returned Value:
- * On success, these functions return 0; on failure they return an error
- * number from <errno.h>.
- *
- ****************************************************************************/
-
-int posix_spawnattr_getflags(FAR const posix_spawnattr_t *attr,
- FAR short *flags)
-{
- DEBUGASSERT(attr && flags);
- *flags = (short)attr->flags;
- return OK;
-}
diff --git a/libs/libc/spawn/lib_psa_getschedpolicy.c
b/libs/libc/spawn/lib_psa_getschedpolicy.c
deleted file mode 100644
index 81fbb6ba05e..00000000000
--- a/libs/libc/spawn/lib_psa_getschedpolicy.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/****************************************************************************
- * libs/libc/spawn/lib_psa_getschedpolicy.c
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * 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 <spawn.h>
-#include <assert.h>
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: posix_spawnattr_getschedpolicy
- *
- * Description:
- * The posix_spawnattr_getschedpolicy() function shall obtain the value
- * of the spawn-schedpolicy attribute from the attributes object referenced
- * by attr.
- *
- * Input Parameters:
- * attr - The address spawn attributes to be queried.
- * policy - The location to return the scheduler policy
- *
- * Returned Value:
- * On success, these functions return 0; on failure they return an error
- * number from <errno.h>.
- *
- ****************************************************************************/
-
-int posix_spawnattr_getschedpolicy(FAR const posix_spawnattr_t *attr,
- FAR int *policy)
-{
- DEBUGASSERT(attr && policy);
- *policy = (int)attr->policy;
- return OK;
-}
diff --git a/libs/libc/spawn/lib_psa_getsigmask.c
b/libs/libc/spawn/lib_psa_getsigmask.c
deleted file mode 100644
index d993e2cc10e..00000000000
--- a/libs/libc/spawn/lib_psa_getsigmask.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/****************************************************************************
- * libs/libc/spawn/lib_psa_getsigmask.c
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * 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 <signal.h>
-#include <spawn.h>
-#include <assert.h>
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: posix_spawnattr_getsigmask
- *
- * Description:
- * The posix_spawnattr_getsigdefault() function will obtain the value of
- * the spawn-sigmask attribute from the attributes object referenced
- * by attr.
- *
- * Input Parameters:
- * attr - The address spawn attributes to be queried.
- * sigmask - The location to return the signal mask
- *
- * Returned Value:
- * On success, these functions return 0; on failure they return an error
- * number from <errno.h>.
- *
- ****************************************************************************/
-
-int posix_spawnattr_getsigmask(FAR const posix_spawnattr_t *attr,
- FAR sigset_t *sigmask)
-{
- DEBUGASSERT(attr && sigmask);
- *sigmask = attr->sigmask;
- return OK;
-}
diff --git a/libs/libc/spawn/lib_psa_getstacksize.c
b/libs/libc/spawn/lib_psa_getstacksize.c
deleted file mode 100644
index 6118c379355..00000000000
--- a/libs/libc/spawn/lib_psa_getstacksize.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/****************************************************************************
- * libs/libc/spawn/lib_psa_getstacksize.c
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * 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 <sched.h>
-#include <spawn.h>
-#include <assert.h>
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: posix_spawnattr_getstacksize
- *
- * Description:
- * The posix_spawnattr_getstacksize() function will obtain the value of
- * the spawn-stacksize attribute from the attributes object referenced
- * by attr.
- *
- * Input Parameters:
- * attr - The address spawn attributes to be queried.
- * stacksize - The location to return the spawn-stacksize value.
- *
- * Returned Value:
- * On success, these functions return 0; on failure they return an error
- * number from <errno.h>.
- *
- ****************************************************************************/
-
-int posix_spawnattr_getstacksize(FAR const posix_spawnattr_t *attr,
- FAR size_t *stacksize)
-{
- DEBUGASSERT(attr && stacksize);
- *stacksize = attr->stacksize;
- return OK;
-}
diff --git a/libs/libc/spawn/lib_psa_getpriority.c
b/libs/libc/spawn/lib_psa_inline.c
similarity index 67%
rename from libs/libc/spawn/lib_psa_getpriority.c
rename to libs/libc/spawn/lib_psa_inline.c
index aff8dd92415..6544886b492 100644
--- a/libs/libc/spawn/lib_psa_getpriority.c
+++ b/libs/libc/spawn/lib_psa_inline.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * libs/libc/spawn/lib_psa_getpriority.c
+ * libs/libc/spawn/lib_psa_inline.c
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -26,32 +26,12 @@
#include <nuttx/config.h>
-#include <sched.h>
+/* Emit callable libc versions of the accessors defined in <spawn.h>. */
+
+#define POSIX_SPAWN_INLINE
+
#include <spawn.h>
-#include <assert.h>
/****************************************************************************
* Public Functions
****************************************************************************/
-
-/****************************************************************************
- * Name: posix_spawnattr_getpriority
- *
- * Description:
- * Retrieves the priority attribute from an initialized attributes object
- * referenced by attr.
- *
- * Input Parameters:
- * attr - The address of the spawn attributes to be used.
- *
- * Returned Value:
- * The priority value stored in the attributes object.
- *
- ****************************************************************************/
-
-uint8_t posix_spawnattr_getpriority(FAR posix_spawnattr_t *attr)
-{
- DEBUGASSERT(attr);
-
- return attr->priority;
-}
diff --git a/libs/libc/spawn/lib_psa_setflags.c
b/libs/libc/spawn/lib_psa_setflags.c
deleted file mode 100644
index 9997f750e6e..00000000000
--- a/libs/libc/spawn/lib_psa_setflags.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/****************************************************************************
- * libs/libc/spawn/lib_psa_setflags.c
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * 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 <spawn.h>
-#include <assert.h>
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: posix_spawnattr_setflags
- *
- * Description:
- * The posix_spawnattr_setflags() function will set the spawn-flags
- * attribute in an initialized attributes object referenced by attr.
- *
- * Input Parameters:
- * attr - The address spawn attributes to be used.
- * flags - The new value of the spawn flags
- *
- * Returned Value:
- * On success, these functions return 0; on failure they return an error
- * number from <errno.h>.
- *
- ****************************************************************************/
-
-int posix_spawnattr_setflags(FAR posix_spawnattr_t *attr, short flags)
-{
- DEBUGASSERT(attr && (flags & ~0xff) == 0);
- attr->flags = (uint8_t)flags;
- return OK;
-}
diff --git a/libs/libc/spawn/lib_psa_setpriority.c
b/libs/libc/spawn/lib_psa_setpriority.c
deleted file mode 100644
index 1ede796b000..00000000000
--- a/libs/libc/spawn/lib_psa_setpriority.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/****************************************************************************
- * libs/libc/spawn/lib_psa_setpriority.c
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * 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 <sched.h>
-#include <spawn.h>
-#include <assert.h>
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: posix_spawnattr_setpriority
- *
- * Description:
- * Sets the priority attribute in an initialized attributes object
- * referenced by attr.
- *
- * Input Parameters:
- * attr - The address of the spawn attributes to be used.
- * priority - The new priority to set.
- *
- * Returned Value:
- * On success, returns 0;
- *
- ****************************************************************************/
-
-int posix_spawnattr_setpriority(FAR posix_spawnattr_t *attr,
- uint8_t priority)
-{
- DEBUGASSERT(attr);
-
- attr->priority = priority;
- return OK;
-}
diff --git a/libs/libc/spawn/lib_psa_setschedpolicy.c
b/libs/libc/spawn/lib_psa_setschedpolicy.c
deleted file mode 100644
index d9f998bb798..00000000000
--- a/libs/libc/spawn/lib_psa_setschedpolicy.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/****************************************************************************
- * libs/libc/spawn/lib_psa_setschedpolicy.c
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * 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 <spawn.h>
-#include <assert.h>
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: posix_spawnattr_setschedpolicy
- *
- * Description:
- * The posix_spawnattr_setschedpolicy() function will set the spawn-
- * schedpolicy attribute in an initialized attributes object referenced
- * by attr.
- *
- * Input Parameters:
- * attr - The address spawn attributes to be used.
- * flags - The new value of the spawn flags
- *
- * Returned Value:
- * On success, these functions return 0; on failure they return an error
- * number from <errno.h>.
- *
- ****************************************************************************/
-
-int posix_spawnattr_setschedpolicy(FAR posix_spawnattr_t *attr, int policy)
-{
- DEBUGASSERT(attr && (policy >= SCHED_FIFO && policy <= SCHED_OTHER));
- attr->policy = (uint8_t)policy;
- return OK;
-}
diff --git a/libs/libc/spawn/lib_psa_setsigmask.c
b/libs/libc/spawn/lib_psa_setsigmask.c
deleted file mode 100644
index be085ce1fa6..00000000000
--- a/libs/libc/spawn/lib_psa_setsigmask.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/****************************************************************************
- * libs/libc/spawn/lib_psa_setsigmask.c
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * 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 <signal.h>
-#include <spawn.h>
-#include <assert.h>
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: posix_spawnattr_setsigmask
- *
- * Description:
- * The posix_spawnattr_setsigmask() function will set the spawn-
- * sigmask attribute in an initialized attributes object referenced
- * by attr.
- *
- * Input Parameters:
- * attr - The address spawn attributes to be used.
- * flags - The new value of the default signal set
- *
- * Returned Value:
- * On success, these functions return 0; on failure they return an error
- * number from <errno.h>.
- *
- ****************************************************************************/
-
-int posix_spawnattr_setsigmask(FAR posix_spawnattr_t *attr,
- FAR const sigset_t *sigmask)
-{
- DEBUGASSERT(attr && sigmask);
- attr->sigmask = *sigmask;
- return OK;
-}
diff --git a/libs/libc/spawn/lib_psa_setstacksize.c
b/libs/libc/spawn/lib_psa_setstacksize.c
deleted file mode 100644
index 042b53a524c..00000000000
--- a/libs/libc/spawn/lib_psa_setstacksize.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/****************************************************************************
- * libs/libc/spawn/lib_psa_setstacksize.c
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * 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 <sched.h>
-#include <spawn.h>
-#include <assert.h>
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: posix_spawnattr_setstacksize
- *
- * Description:
- * The posix_spawnattr_setstacksize() function shall set the spawn-
- * stacksize attribute in an initialized attributes object referenced
- * by attr.
- *
- * Input Parameters:
- * attr - The address spawn attributes to be used.
- * stacksize - The new stacksize to set.
- *
- * Returned Value:
- * On success, these functions return 0; on failure they return an error
- * number from <errno.h>.
- *
- ****************************************************************************/
-
-int posix_spawnattr_setstacksize(FAR posix_spawnattr_t *attr,
- size_t stacksize)
-{
- DEBUGASSERT(attr);
- attr->stacksize = stacksize;
- return OK;
-}