Notice: We have migrated to GitLab launching 2024-05-01 see here:

#2514 closed enhancement (fixed)

Make POSIX API mandatory (except signals and the sporadic server)

Reported by: Sebastian Huber Owned by: Sebastian Huber
Priority: normal Milestone: 5.1
Component: posix Version:
Severity: normal Keywords:
Cc: Blocked By: #3551

Description (last modified by Sebastian Huber)

The POSIX API is currently a build-time configuration option. In general it is beneficial to avoid build-time configuration options since this reduces the testing scope.

Applications not using the POSIX API should observe only a minimal overhead due to this change.

This enhancement depends on #2408.

Attachments (1)

0001-RTEMS-Self-contained-POSIX-objects.patch (5.7 KB) - added by Sebastian Huber on 10/05/17 at 05:20:56.

Download all attachments as: .zip

Change History (59)

comment:1 Changed on 01/07/16 at 09:10:38 by Sebastian Huber

Description: modified (diff)

comment:2 Changed on 01/08/16 at 08:02:42 by Sebastian Huber <sebastian.huber@…>

In [changeset:"fe100e16117c36c40e99a853d09cd8dcf98dbff0/rtems"]:

score: Add fatal errors for NULL entry init tasks

This simplifies the global construction.

Update #2514.

comment:3 Changed on 01/08/16 at 08:37:30 by Sebastian Huber

In [44e987192e47910b8551a8f9409e9cd6133695d1/rtems]:

score: Avoid dead code in global construction

Update #2514.

Last edited on 01/08/16 at 08:38:01 by Sebastian Huber (previous) (diff)

comment:4 Changed on 01/11/16 at 07:47:12 by Sebastian Huber <sebastian.huber@…>

In [changeset:"ccd54344d904b657123e4e4ba795a32212382be2/rtems"]:

score: Introduce Thread_Entry_information

This avoids potential dead code in _Thread_Handler(). It gets rid of
the dangerous function pointer casts.

Update #2514.

comment:5 Changed on 01/26/16 at 09:26:22 by Sebastian Huber <sebastian.huber@…>

In [changeset:"885c342e043f2281a0bc707cd0bc59726d1c4b79/rtems"]:

mpci: Update due to API changes

Update due to API changes introduced by

Update #2514.

comment:6 Changed on 01/31/17 at 09:13:49 by Sebastian Huber

Milestone: 4.125.0
Version: 4.12

comment:7 Changed on 05/11/17 at 10:05:24 by Sebastian Huber

The signals implementation has some (severe) defects:


Fixing them is a major work package. I suggest to enable the non-signal related stuff of the POSIX API by default.

Last edited on 05/11/17 at 10:05:44 by Sebastian Huber (previous) (diff)

Changed on 10/05/17 at 05:20:56 by Sebastian Huber

comment:8 Changed on 10/05/17 at 12:34:58 by Sebastian Huber <sebastian.huber@…>

In [changeset:"76d9db31feb7835c66f926d280ea717b7933e152/rtems-source-builder" 76d9db3/rtems-source-builder]:

4.12: Update to Newlib

The time_t is now a 64-bit signed integer.

This update includes a patch to introduce the self-contained POSIX
synchronization objects.

Update #2514.
Update #3111.
Update #3112.
Update #3113.
Update #3114.
Update #3115.
Update #3116.

comment:9 Changed on 10/05/17 at 12:35:53 by Sebastian Huber <sebastian.huber@…>

In [changeset:"e46a075d35fa821b9d5f841032149d74e828be2b/rtems" e46a075/rtems]:

Enforce compatible Newlib version

This Newlib check ensures that we have a 64-bit time_t and
self-contained POSIX synchronization objects.

Update #2514.
Update #3111.
Update #3112.
Update #3113.
Update #3114.
Update #3115.
Update #3116.

comment:10 Changed on 10/05/17 at 12:36:18 by Sebastian Huber <sebastian.huber@…>

In [changeset:"c090db7405b72ce6d0b726c0a39fb1c1aebab7ea/rtems" c090db7/rtems]:

posix: Implement self-contained POSIX semaphores

For semaphore object pointer and object validation see

Destruction or close of a busy semaphore returns an error status. The
object is not flushed.

POSIX semaphores are now available in all configurations and no longer
depend on --enable-posix.

Update #2514.
Update #3116.

comment:11 Changed on 10/05/17 at 12:36:31 by Sebastian Huber <sebastian.huber@…>

In [changeset:"e67929c4c0025ef46053523be4c8736dd178cbec/rtems" e67929c/rtems]:

posix: Implement self-contained POSIX barriers

POSIX barriers are now available in all configurations and no longer
depend on --enable-posix.

Update #2514.
Update #3114.

comment:12 Changed on 10/05/17 at 12:36:43 by Sebastian Huber <sebastian.huber@…>

In [changeset:"89fc9345dea5c675f8d93546fa3c723918d3279a/rtems" 89fc9345/rtems]:

posix: Implement self-contained POSIX rwlocks

POSIX rwlocks are now available in all configurations and no longer
depend on --enable-posix.

Update #2514.
Update #3115.

comment:13 Changed on 10/05/17 at 12:36:56 by Sebastian Huber <sebastian.huber@…>

In [changeset:"5222488573e3ba8c2eceffe29f878a73a3a81694/rtems" 5222488/rtems]:

posix: Implement self-contained POSIX condvar

POSIX condition variables are now available in all configurations and no
longer depend on --enable-posix.

Update #2514.
Update #3113.

comment:14 Changed on 10/05/17 at 12:37:09 by Sebastian Huber <sebastian.huber@…>

In [changeset:"de59c065c57cb8526662ee6da28a57ad16fdde66/rtems" de59c065/rtems]:

posix: Implement self-contained POSIX mutex

POSIX mutexes are now available in all configurations and no longer
depend on --enable-posix.

Update #2514.
Update #3112.

comment:15 Changed on 10/10/17 at 05:43:49 by Sebastian Huber <sebastian.huber@…>

In [changeset:"af9115f35cfb3d0adeb3e105fd608883596f2637/rtems" af9115f3/rtems]:

posix: Simplify POSIX_API_Control

Return stack area via pthread_getattr_np().


  • pthread_attr_setaffinity_np(), and
  • pthread_attr_getaffinity_np()

and let the scheduler do the more sophisticated error checks.


  • pthread_setaffinity_np(),
  • pthread_getaffinity_np(),
  • pthread_attr_setaffinity_np(), and
  • pthread_attr_getaffinity_np()

available in all configurations.

Update #2514.
Close #3145.
Close #3168.

comment:16 Changed on 10/10/17 at 05:44:03 by Sebastian Huber <sebastian.huber@…>

In [changeset:"da9f5f113332459444a2a89cbb011c2bbea202da/rtems" da9f5f1/rtems]:

posix: Remove rtems_pthread_attribute_compare()

Update #2514.
Close #3174.

comment:17 Changed on 10/10/17 at 05:44:17 by Sebastian Huber <sebastian.huber@…>

In [changeset:"8c5267a268ae8ce599e61d0e1bdff585e26187c5/rtems" 8c5267a/rtems]:

posix: Simplify pthread_attr_setstack()


  • pthread_attr_setstack(), and
  • pthread_attr_setstacksize().

Update #2514.

comment:18 Changed on 10/10/17 at 05:44:29 by Sebastian Huber <sebastian.huber@…>

In [changeset:"4f9ed26655c2659fcf697a281cb401aa919849bf/rtems" 4f9ed26/rtems]:

posix: Constify default thread processor affinity

Set default thread processor affinity to all processors of the
pre-allocated set. This allows to constify the

Update #2514.

comment:19 Changed on 10/10/17 at 05:44:43 by Sebastian Huber <sebastian.huber@…>

In [changeset:"bd5be58fa6b4f1108fc69c8ff55cf2d20ddde620/rtems" bd5be58f/rtems]:

posix: Unconditional thread attribute support

Update #2514.

comment:20 Changed on 10/11/17 at 05:39:29 by Sebastian Huber <sebastian.huber@…>

In [changeset:"a3ad4afba883e56447aa40f92c1ad08d835d2564/rtems" a3ad4af/rtems]:

posix: Validate affinity sets by the scheduler

Update #2514.

comment:21 Changed on 10/11/17 at 05:39:43 by Sebastian Huber <sebastian.huber@…>

In [changeset:"b2dbb634eccc4132eb839a0ed5ab09c7b3bd992e/rtems" b2dbb634/rtems]:

score: Remove CPU_set_Control

Use Processor_mask instead.

Update #2514.

comment:22 Changed on 10/11/17 at 06:34:14 by Sebastian Huber <sebastian.huber@…>

In [changeset:"16aaf73bbb7c48aebce0e993186318710479e6c0/rtems" 16aaf73b/rtems]:

smpaffinity01: Fix test case

Update #2514.

comment:23 Changed on 10/11/17 at 12:09:24 by Sebastian Huber

Component: unspecifiedposix
Status: newaccepted
Summary: Make POSIX API mandatoryMake POSIX API mandatory (except signals and the sporadic server)

comment:24 Changed on 10/12/17 at 05:20:28 by Sebastian Huber <sebastian.huber@…>

In [changeset:"5850054098b08aa87501fe464a0e4764916a433b/rtems" 58500540/rtems]:

posix: Fix const qualifier warning

Update #2514.
Update #3179.

comment:25 Changed on 10/18/17 at 06:52:20 by Sebastian Huber <sebastian.huber@…>

In [changeset:"2be22d4f6478e80cd7df05b888650d1563d2b504/rtems" 2be22d4/rtems]:

posix: Move POSIX_API_Control::thread

This member is only used by the sporadic server support.

Update #2514.

comment:26 Changed on 10/18/17 at 06:52:32 by Sebastian Huber <sebastian.huber@…>

In [changeset:"3f3f42482daa45aff3647f34afb4e2c4eca242cd/rtems" 3f3f424/rtems]:

posix: Remove POSIX_API_Control::schedparam

Move sporadic server scheduler parameters to
POSIX_API_Control::Sporadic. Remove redundant scheduler priority

Update #2514.

comment:27 Changed on 10/18/17 at 06:52:44 by Sebastian Huber <sebastian.huber@…>

In [changeset:"37eb717f90c04b9a2654ef5c5b247eb50652e54b/rtems" 37eb717/rtems]:

posix: Simplify _POSIX_Threads_Create_extension()

Move unblocked signals initialization to pthread_create().

Update #2514.

comment:28 Changed on 10/18/17 at 07:34:22 by Sebastian Huber <sebastian.huber@…>

In [changeset:"dbb30e2607ac72d9419df3ba96c423a4a8532d5b/rtems" dbb30e26/rtems]:

posix: Fix POSIX disabled build

Update #2514.

comment:29 Changed on 10/23/17 at 05:13:34 by Sebastian Huber <sebastian.huber@…>

In [changeset:"eeb8d8387f7cab370adb4edd0eaccc2c82a6b5f7/rtems" eeb8d83/rtems]:

posix: Fix POSIX disabled build

Update #2514.

comment:30 Changed on 11/02/17 at 10:25:59 by Sebastian Huber <sebastian.huber@…>

In [changeset:"81fd79daf0a48f51c3ca29c953e029d645fd08fb/rtems" 81fd79d/rtems]:

smppsxaffinity02: Fix thread attribute usage

The pthread_getattr_np() returns now the stack address and size. Do not
use this stack for the new threads.

Update #2514.
Update #3145.
Update #3168.

comment:31 Changed on 11/09/17 at 06:27:14 by Sebastian Huber


Milestone renamed

comment:32 Changed on 11/09/17 at 07:13:44 by Sebastian Huber <sebastian.huber@…>

In [changeset:"7147dc43b874271a0d4c14bbbc8ea10d1ed57cef/rtems" 7147dc4/rtems]:

posix: Remove POSIX_API_Control::schedpolicy

Use the thread CPU budget algorithm to determine the scheduler policy.
This fixes also pthread_getschedparam() for Classic tasks.

Update #2514.

comment:33 Changed on 11/09/17 at 07:13:56 by Sebastian Huber <sebastian.huber@…>

In [changeset:"64ba1a9606c86f54d66d1d5cc638fb9aff7338a2/rtems" 64ba1a96/rtems]:

posix: Change created_with_explicit_scheduler

Remove POSIX_API_Control::created_with_explicit_scheduler. Add
Thread_Control::was_created_with_inherited_scheduler. This fixes also
pthread_getattr_np() for Classic tasks.

Update #2514.

comment:34 Changed on 11/21/17 at 07:09:15 by Sebastian Huber <sebastian.huber@…>

In [changeset:"c0d602ea6935bd784c2bb81b0c1efe94c6638faa/rtems" c0d602e/rtems]:

posix: _POSIX_Threads_Get_sched_param_sporadic()

Remove api parameter to simplify the calling functions.

Update #2514.

comment:35 Changed on 06/18/18 at 07:54:07 by Sebastian Huber <sebastian.huber@…>

In [changeset:"49fd910bc271ff76cddc43d3033da18dfa781058/rtems-docs" 49fd910/rtems-docs]:

c-user: Remove obsolete RTEMS_SYSINIT_CPU_SET

Update #2514.

comment:36 Changed on 10/13/18 at 22:41:39 by Joel Sherrill

Sebastian.. since this hasn't been touched in a few months, is this complete?

comment:37 Changed on 10/15/18 at 05:31:34 by Sebastian Huber

Progress on this ticket was blocked by several things. I hope to close it soon.

comment:38 Changed on 10/15/18 at 06:21:45 by Sebastian Huber

Blocked By: 3551 added

comment:39 Changed on 10/23/18 at 14:03:05 by Sebastian Huber <sebastian.huber@…>

In [changeset:"dd804bb16ff3c5541fc998267f3213f96c33bf2c/rtems" dd804bb/rtems]:

posix: Provide cancel state/type by default

Sort POSIX sources lexicographically in

Update #2514.

comment:40 Changed on 10/23/18 at 14:03:09 by Sebastian Huber <sebastian.huber@…>

In [changeset:"0b2808ce0b163a6b4a63a8ebd26c1bb50df331e6/rtems" 0b2808ce/rtems]:

posix: Provide scheduler support by default

Update #2514.

comment:41 Changed on 10/23/18 at 14:03:12 by Sebastian Huber <sebastian.huber@…>

In [changeset:"8d816221c164f817aa44f18342734ffac26b29c8/rtems" 8d81622/rtems]:

posix: Provide non-thread functions by default

Update #2514.

comment:42 Changed on 10/25/18 at 08:06:11 by Sebastian Huber <sebastian.huber@…>

In [changeset:"4a7be22b5a711bf007cd7b77de54eb45fb30e6ee/rtems" 4a7be22/rtems]:

posix: Fix build with POSIX API disabled

Update #2514.

comment:43 Changed on 10/25/18 at 08:06:22 by Sebastian Huber <sebastian.huber@…>

In [changeset:"135cb10efa863e2fe3029655b9c7cb136e64fc48/rtems" 135cb10/rtems]:

posix: Provide more functions by default

Update #2514.

comment:44 Changed on 10/30/18 at 06:11:25 by Sebastian Huber <sebastian.huber@…>

In [changeset:"0dbf67b66e7424730feede962826bf020de96c67/rtems" 0dbf67b/rtems]:

posix: Provide aio_suspend() by default

Update #2514.

comment:45 Changed on 10/30/18 at 06:11:34 by Sebastian Huber <sebastian.huber@…>

In [changeset:"5090a71bf821b31342769ab6c1a451f47a2c2e45/rtems" 5090a71b/rtems]:

score: Remove bogus thread object name support

Update #2514.

comment:46 Changed on 10/30/18 at 06:11:42 by Sebastian Huber <sebastian.huber@…>

In [changeset:"70382718450c6b5d83232188cc71b6c795048a27/rtems" 7038271/rtems]:


Enable support for string objects names unconditionally. Add const
qualifier throughout. Split _Objects_Namespace_remove() into
_Objects_Namespace_remove_u32() and _Objects_Namespace_remove_string()
to avoid an unnecessary dependency on _Workspace_Free().

Update #2514.

comment:47 Changed on 10/30/18 at 06:11:58 by Sebastian Huber <sebastian.huber@…>

In [changeset:"e97806a5ff7673422082edd49ec3c62c5f0f1ccd/rtems" e97806a/rtems]:

posix: Split posix_api_configuration_table

Use separate configuration variables to avoid false dependencies.

Update #2514.

comment:48 Changed on 10/30/18 at 06:12:06 by Sebastian Huber <sebastian.huber@…>

In [changeset:"9318cfb050c0cd15f0bf5b600177b0682583cf18/rtems" 9318cfb0/rtems]:

posix: Provide named semaphores by default

Update #2514.

comment:49 Changed on 10/30/18 at 06:12:14 by Sebastian Huber <sebastian.huber@…>

In [changeset:"701057e0b93fe0afd56f1cce206d6f6137cb57d4/rtems" 701057e0/rtems]:

posix: Provide shared memory objects by default

Update #2514.

comment:50 Changed on 10/30/18 at 06:12:21 by Sebastian Huber <sebastian.huber@…>

In [changeset:"fe7aefd516baf9d44003ce47d9379a310ac4050e/rtems" fe7aefd5/rtems]:

posix: Provide message queues by default

Update #2514.

comment:51 Changed on 10/30/18 at 06:12:29 by Sebastian Huber <sebastian.huber@…>

In [changeset:"033f31c8af6e742d3f56311b09b331ad0b222e3c/rtems" 033f31c8/rtems]:

posix: Hide POSIX_API_Control by default

Update #2514.

comment:52 Changed on 10/30/18 at 06:12:37 by Sebastian Huber <sebastian.huber@…>

In [changeset:"54f35888311f36baaefd90b1f31e4150e3db5465/rtems" 54f35888/rtems]:

posix: Provide threads by default

Update #2514.

comment:53 Changed on 10/30/18 at 06:12:45 by Sebastian Huber <sebastian.huber@…>

In [changeset:"ef16a111c72cbea68213cabebf345cd4f9e40e6c/rtems" ef16a11/rtems]:

posix: Enable psxtmtests tests by default

Update #2514.

comment:54 Changed on 10/30/18 at 06:12:54 by Sebastian Huber <sebastian.huber@…>

In [changeset:"24f3e8fd5bd7e7749cb8e5ed506520126137319e/rtems" 24f3e8f/rtems]:

posix: Enable more smptests tests by default

Update #2514.

comment:55 Changed on 10/30/18 at 06:13:02 by Sebastian Huber <sebastian.huber@…>

In [changeset:"8dc1ed135a27fd0ee0135bb6e9f1a5fd7e709ebb/rtems" 8dc1ed1/rtems]:

posix: Enable more psxtests by default

Update #2514.

comment:56 Changed on 10/30/18 at 06:13:10 by Sebastian Huber <sebastian.huber@…>

In [changeset:"bb3484c9ecdaac27f7889ad87c223a1774fb7564/rtems" bb3484c9/rtems]:

posix: Enable more sptests test cases by default

Update #2514.

comment:57 Changed on 11/05/18 at 06:19:24 by Sebastian Huber <sebastian.huber@…>

Resolution: fixed
Status: acceptedclosed

In [changeset:"dd1c262d2a3b632025d42d5f46e12c8c12fd9c46/rtems-docs" dd1c262/rtems-docs]:

c-user: Update POSIX API configuration

Close ##2514.

comment:58 Changed on 05/18/20 at 07:05:33 by Sebastian Huber <sebastian.huber@…>

In [changeset:"934cbe7d9fa3f1c251eed213e0688a736567ca93/rtems" 934cbe7/rtems]:

posix: Get real priority in pthread_getattr_np()

This is in line with pthread_setschedparam() and

Update #2514.

Note: See TracTickets for help on using tickets.