Commit graph

429 commits

Author SHA1 Message Date
Chris Friedt
b3e36ad6e8 posix: eventfd: remove deprecated eventfd macros
Remove the EFD_IN_USE and EFD_FLAGS_SET macros as they were not
part of the public API.

Rename the internal versions, accordingly.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-04 16:27:12 -05:00
Chris Friedt
3949e89330 posix: net: update for POSIX_NETWORKING
Add a link to the Kconfig option CONFIG_POSIX_NETWORKING in
the documentation.

Additionally, add Kconfig options for other Network
dependencies in an effort to make POSIX Kconfig options
consistent with the specification.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-04 16:27:12 -05:00
Chris Friedt
b051bcee25 posix: move getpid() to Kconfig.procN and doc MULTI_PROCESS
Create a Kconfig option for POSIX_MULTI_PROCESS Option Group
and mark it as experimental.

Currently, Zephyr has two functions that belong to this
Option Group:
- sleep()
- getpid()

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-04 16:27:12 -05:00
Chris Friedt
2e429f1b9d posix: reword aio and sched options. add experimental
The asynchronous I/O and (process) scheduling options needed
minor rewording.

Additionally, add the experimental flag to each of them since
they are not yet supported.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-04 16:27:12 -05:00
Chris Friedt
3f29b17bd1 posix: deprecate POSIX_SIGNAL in favour of POSIX_SIGNALS
This change deprecates CONFIG_POSIX_SIGNAL in favour of
the plural CONFIG_POSIX_SIGNALS, which maps directly to the
name of the standard POSIX Option Group POSIX_SIGNALS.

Additionally, mark signals as experimental.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-04 16:27:12 -05:00
Chris Friedt
2642eaa4e9 posix: relocate Kconfig.eventfd to Kconfig.compat
While event file descriptors (eventfd) are extremely useful, the
API has still not been formalized as part of the POSIX
specification.

Therefore, move this to a separate Kconfig menu for "compat"
(compatibility) features.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-04 16:27:12 -05:00
Chris Friedt
fcebe60090 posix: deprecate PTHREAD_IPC _MUTEX _COND and _KEY
Zephyr's POSIX API is moving toward using the standard
nomenclature from IEEE 1003.1-2017 for as much as possible. In
particular, we want to have consistent naming between Zephyr's
POSIX API Kconfig options and the naming for POSIX Options and
Option Groups.

The Kconfig option CONFIG_PTHREAD_IPC has been (ab)used for a
very long time for a variety of different purposes. However,
the standard Option / feature test macro for POSIX Threads is,
intuitively _POSIX_THREADS. There is a corresponding sysconf()
key named _SC_POSIX_THREADS.

Annoyingly, the POSIX Option Group that corresponds to the
Option is POSIX_THREADS_BASE, which is a minor inconsistency
in the standard.

The _POSIX_THREADS Option already includes mutexes, condition
variables, and thread-specific storage (keys). So with this
change, we also deprecate the redundant Kconfig variables that
do not have a corresponding match in the standard.

- CONFIG_PTHREAD_IPC
- CONFIG_PTHREAD
- CONFIG_PTHREAD_COND
- CONFIG_PTHREAD_MUTEX
- CONFIG_PTHREAD_KEY

Additionally, create Kconfig variables for those configurables
which we are lacking:

- CONFIG_POSIX_THREADS_EXT
- CONFIG_POSIX_THREAD_ATTR_STACKSIZE
- CONFIG_POSIX_THREAD_ATTR_STACKADDR
- CONFIG_POSIX_THREAD_PRIORITY_SCHEDULING
- CONFIG_POSIX_THREAD_PRIO_INHERIT
- CONFIG_POSIX_THREAD_PRIO_PROTECT
- CONFIG_POSIX_THREAD_SAFE_FUNCTIONS

Some Kconfig variables were renamed to more properly match the spec:

- CONFIG_MAX_PTHREAD_COUNT -> CONFIG_POSIX_THREAD_THREADS_MAX
- CONFIG_MAX_PTHREAD_KEY_COUNT -> CONFIG_POSIX_THREAD_KEYS_MAX

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-04 16:27:12 -05:00
Chris Friedt
2f2cad742e posix: deprecate POSIX_PUTMSG for XOPEN_STREAMS
This change deprecates CONFIG_POSIX_PUTMSG and introduces a new
Kconfig option CONFIG_XOPEN_STREAMS which maps directly to the
standard POSIX Option, _XOPEN_STREAMS.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-04 16:27:12 -05:00
Chris Friedt
0711d603f7 posix: deprecate POSIX_SYSLOG for XSI_SYSTEM_LOGGING
This change deprecates the CONFIG_POSIX_SYSLOG Kconfig
variable for CONFIG_XSI_SYSTEM_LOGGING, which has a
direct mapping to the POSIX Option Group XSI_SYSTEM_LOGGING.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-04 16:27:12 -05:00
Chris Friedt
842a7b7ba1 posix: deprecate SEM_VALUE_MAX and SEM_NAMELEN_MAX
This change deprecates CONFIG_SEM_VALUE_MAX in favour of
CONFIG_POSIX_SEM_VALUE_MAX which maps directly to
_POSIX_SEM_VALUE_MAX.

Additionally, we add the Kconfig option
CONFIG_POSIX_SEMAPHORES which maps directly to the
POSIX Option _POSIX_SEMAPHORES.

For consistence, deprecate CONFIG_SEM_NAMELEN_MAX
in favour of CONFIG_POSIX_SEM_NAMELEN_MAX.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-04 16:27:12 -05:00
Chris Friedt
9f6590c7b7 posix: deprecate POSIX_FS for POSIX_FILE_SYSTEM
This change deprecates CONFIG_POSIX_FS in favour of
CONFIG_POSIX_FILE_SYSTEM, which maps directly to the name of the
standard POSIX Option Group.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-04 16:27:12 -05:00
Chris Friedt
2bc722a97e posix: deprecate POSIX_FNMATCH GETOPT GETENTROPY
The functions fnmatch(), getopt(), getentropy()
and others are grouped into the standard Option Group
POSIX_C_LIB_EXT.

The getentropy() function is currently in-draft for
Issue 8 as of 2021.

https://www.opengroup.org/austin/docs/austin_1110.pdf

Not surprisingly, the POSIX_C_LIB_EXT Option Group
also includes the highly debated strnlen() function.

Moving that function will be deferred until later.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-04 16:27:12 -05:00
Chris Friedt
70e2b02c8e posix: deprecate PTHREAD_RWLOCK for POSIX_READER_WRITER_LOCKS
This change deprecates CONFIG_PTHREAD_RWLOCK in favour of
CONFIG_POSIX_READER_WRITER_LOCKS, which maps directly to the
name of the standard POSIX Option.

Annoyingly, the POSIX_RW_LOCKS Option Group is inconsistently
named. However, it is more convenient for us to use the Option
name since it is also the format used by the sysconf() variable
(_SC_READER_WRITER_LOCKS).

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-04 16:27:12 -05:00
Chris Friedt
f270de7362 posix: deprecate POSIX_MQUEUE in favour of POSIX_MESSAGE_PASSING
This change deprecates CONFIG_POSIX_MQUEUE in favour of
CONFIG_POSIX_MESSAGE_PASSING, which maps directly to the name of the
standard POSIX Option.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-04 16:27:12 -05:00
Chris Friedt
4e181f7031 posix: deprecate PTHREAD_SPINLOCK for POSIX_SPIN_LOCKS
This change deprecates CONFIG_PTHREAD_SPINLOCK in favour of
CONFIG_POSIX_SPIN_LOCKS, which maps directly to the name of the
standard POSIX Option Group.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-04 16:27:12 -05:00
Chris Friedt
2fe9d6cd68 posix: deprecate POSIX_ENV _CONFSTR _SYSCONF and _UNAME
This change deprecates the following Kconfig options
* CONFIG_POSIX_ENV
* CONFIG_POSIX_CONFSTR
* CONFIG_POSIX_SYSCONF
* CONFIG_POSIX_UNAME

and instead groups them into a single Kconfig option that maps
directly to the standard. Namely, CONFIG_POSIX_SINGLE_PROCESS.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-04 16:27:12 -05:00
Chris Friedt
b639604833 posix: deprecate PTHREAD_BARRIER for POSIX_BARRIERS
The standard specifies _POSIX_BARRIERS as an Option so let's
use CONFIG_POSIX_BARRIERS for consistence.

This change deprecates CONFIG_PTHREAD_BARRIER. Users should
instead choose CONFIG_POSIX_BARRIERS.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-04 16:27:12 -05:00
Chris Friedt
bc4374b5fe posix: deprecate POSIX_MAX_FDS and add POSIX_DEVICE_IO
The POSIX_MAX_FDS option does not correspond to any standard
POSIX option. It was used to define the size of the file
descriptor table, which is by no means exclusively used by
POSIX (also net, fs, ...).

POSIX_MAX_FDS is being deprecated in order to ensure that
Zephyr's POSIX Kconfig variables correspond to those defined in
the specification, as of IEEE 1003.1-2017. Namely,
POSIX_OPEN_MAX. CONFIG_POSIX_MAX_OPEN_FILES is being deprecated
for the same reason.

To mitigate any possible layering violations, that option is
not user selectable. It tracks the newly added
CONFIG_ZVFS_OPEN_MAX option, which is native to Zephyr.

With this deprecation, we introduce the following Kconfig
options that map directly to standard POSIX Option Groups by
simply removing "CONFIG_":

* CONFIG_POSIX_DEVICE_IO

Similarly, with this deprecation, we introduce the following
Kconfig options that map directly to standard POSIX Options by
simply removing "CONFIG":

* CONFIG_POSIX_OPEN_MAX

In order to maintain parity with the current feature set, we
introduce the following Kconfig options.

* CONFIG_POSIX_DEVICE_IO_ALIAS_CLOSE
* CONFIG_POSIX_DEVICE_IO_ALIAS_OPEN
* CONFIG_POSIX_DEVICE_IO_ALIAS_READ
* CONFIG_POSIX_DEVICE_IO_ALIAS_WRITE

Gate open(), close(), read(), and write() via the
CONFIG_POSIX_DEVICE_IO Kconfig option and move
implementations into device_io.c, to be conformant with the
spec.

Lastly, stage function names for upcoming ZVFS work, to be
completed as part of the LTSv3 Roadmap (e.g. zvfs_open(), ..).

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-04 16:27:12 -05:00
Chris Friedt
3f469665f4 posix: fd_mgmt: add fd_mgmt option group
With this change, we collect implementations of functions that are
part of the POSIX_FD_MGMT Option Group into one compilation unit
(fd_mgmt.c) and provide a matching Kconfig symbol that is
reflective of the standard.

Additionally, provide Kconfig options for aliases of those functions
since Newlib-based toolchains internally use an underscore-prefixed
alias for many POSIX functions (in this case _lseek).

Prefix Zephyr-native implementations with zvfs_ to prepare for the
up-coming changes in that area.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-04 16:27:12 -05:00
Chris Friedt
4a5c4e5f73 posix: timers: deprecate CONFIG_POSIX_CLOCK and TIMER
The POSIX_CLOCK option does not correspond to any standard
option. It was used to active features of several distinct
POSIX Options and Option Groups, which complicated API and
application configuration as a result.

POSIX_CLOCK is being deprecated in order to ensure that Zephyr's
POSIX Kconfig variables correspond to those defined in the
specification, as of IEEE 1003.1-2017.

Additionally, CONFIG_TIMER is being deprecated because it does
not match the corresponding POSIX Option (_POSIX_TIMERS).

With this deprecation, we introduce the following Kconfig
options that map directly to standard POSIX Option Groups by
simply removing "CONFIG_":

* CONFIG_POSIX_TIMERS

Similarly, we introduce the following Kconfig options that
map directly to standard POSIX Options by simply removing
"CONFIG":

* CONFIG_POSIX_CLOCK_SELECTION
* CONFIG_POSIX_CPUTIME
* CONFIG_POSIX_DELAYTIMER_MAX
* CONFIG_POSIX_MONOTONIC_CLOCK
* CONFIG_POSIX_TIMEOUTS
* CONFIG_POSIX_TIMER_MAX

In order to maintain parity with the current feature set, we
introduce the following Kconfig options that map directly to
standard POSIX Option Groups by simply removing "CONFIG_":

* CONFIG_POSIX_MULTI_PROCESS - sleep()

Similarly, in order to maintain parity with the current feature
set, we introduce the following additional Kconfig options that
map directly to standard POSIX Options by simply removing
"CONFIG":

* CONFIG_XSI_SINGLE_PROCESS - gettimeofday()

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-04 16:27:12 -05:00
Chris Friedt
e2fc78af23 posix: signals: deprecate CONFIG_POSIX_LIMITS_RTSIG_MAX
There were two Kconfig constants defined for (effectively) the
same thing in Zephyr. Namely, RTSIG_MAX - the highest valued
real-time signal.

Deprecate CONFIG_POSIX_LIMITS_RTSIG_MAX in favour of
CONFIG_POSIX_RTSIG_MAX since the latter more closely matches
convention.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-04 16:27:12 -05:00
Chris Friedt
feb841a0f7 posix: add Kconfig.deprecated
There will be some POSIX Kconfig symbols that will be deprecated
in favour of Kconfig symbols that are exact matches for those in
the POSIX specification (1003.1-2017).

Create the empty Kconfig file now, and then incrementally add to
it as non-standard POSIX Kconfig options are replaced with
standard-like POSIX Kconfig options.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-04 16:27:12 -05:00
Chris Friedt
aa6a472355 posix: sysconf: define z sysconf macros with COND_CODE_1
It's sort of more conventient to do the opposite of what was
done with the __z_sysconf_ macros, and use them for both the
full implementation and the macro implementation.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-04 16:27:12 -05:00
Yong Cong Sin
bbe5e1e6eb build: namespace the generated headers with zephyr/
Namespaced the generated headers with `zephyr` to prevent
potential conflict with other headers.

Introduce a temporary Kconfig `LEGACY_GENERATED_INCLUDE_PATH`
that is enabled by default. This allows the developers to
continue the use of the old include paths for the time being
until it is deprecated and eventually removed. The Kconfig will
generate a build-time warning message, similar to the
`CONFIG_TIMER_RANDOM_GENERATOR`.

Updated the includes path of in-tree sources accordingly.

Most of the changes here are scripted, check the PR for more
info.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-28 22:03:55 +02:00
Pisit Sawangvonganan
557ad8e45c shell: devmem: address cmd_dump multiple call problem
Call `getopt_init()` to reset `state->optind` instead of directly setting
`optind = 1`. The `getopt()` function uses `getopt_state` from
`getopt_state_get` for state handling, so `getopt_init()` should be called
to correctly run the command again.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-05-15 10:13:23 +02:00
Alberto Escolar Piedras
7c8d538982 posix: env: Fix 2 build warnings
Fix 2 build warnings in posix/options/env:
The maximum length given to strncpy() matches the input
string length, which makes the call equivalent to strcpy().
As the destination buffer size has been ensured sufficient
(in the first case by chechking just before,
in the second case by allocating it big enough),
let's just use strcpy() instead.

lib/posix/options/env.c: In function 'getenv_r':
lib/posix/options/env.c:109:17: error: 'strncpy' specified bound
depends on the length of the source argument
[-Werror=stringop-truncation]
  109 |                 strncpy(buf, val, vsize);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~
lib/posix/options/env.c:104:25: note: length computed here
  104 |                 vsize = strlen(val) + 1;
      |                         ^~~~~~~~~~~
lib/posix/options/env.c: In function 'setenv':
lib/posix/options/env.c:191:17: error: 'strncpy' output truncated
before terminating nul copying as many bytes from a string as its
length [-Werror=stringop-truncation]
  191 |                 strncpy(environ[ret], name, nsize);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/posix/options/env.c:128:51: note: length computed here
  128 |         const size_t nsize = (name == NULL) ? 0 : strlen(name);
      |                                                   ^~~~~~~~~~~~

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-05-14 13:25:33 +02:00
Chris Friedt
b1e2e4ac2c posix: fs: create a separate Kconfig option for fsync
Create CONFIG_POSIX_FSYNC to match the spec.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-05-07 21:22:56 -04:00
Yong Cong Sin
4363a787b1 posix: uname: increase version name length
to 70 to prevent overflowing the char array.

Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-04-29 17:40:16 +01:00
Patryk Duda
ef258166ba posix: Introduce getentropy() function
The function writes random data to the provided buffer. Maximum
permitted buffer size is 256 bytes. On success the function returns 0,
otherwise it returns -1 and sets errno to appropriate value.

Signed-off-by: Patryk Duda <patrykd@google.com>
2024-04-29 11:46:06 +01:00
Chris Friedt
cdb1193f3e posix: add stubs for asynchronous io
Add stubs for POSIX asynchronous io that return -1 and set
errno to ENOTSUP.

The functions and structures in aio.h are required by the
_POSIX_ASYNCHRONOUS_IO Option as detailed in Section E.1 of
IEEE-1003.1-2017.

The _POSIX_ASYNCHRONOUS_IO interface is required for PSE51,
PSE52, PSE53, and PSE54 conformance, and is otherwise mandatory
for any POSIX conforming system as per Section A.2.1.3 of
IEEE-1003-1.2017.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-04-29 11:02:11 +02:00
Alberto Escolar Piedras
60d5ce452e libC kconfig: Introduce a new option to avoid the native libC
Let's introduce a new option so components which cannot
be used with the native libC can select it.
And at this point let's already have POSIX_API select it
instead of being used in the libC choice default.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-04-24 09:53:36 +02:00
Alberto Escolar Piedras
84e7107b32 Revert "posix: use sys_sem instead of k_spinlock for pool synch"
This reverts commit 6e66aa1f7c.

And fixes an indentation issue in the original code,
which triggers checkpatch.

This PR:
https://github.com/zephyrproject-rtos/zephyr/pull/71718
introduced a regression breaking CI:
https://github.com/zephyrproject-rtos/zephyr/issues/71814
Let's just revert it until a better fix is done.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-04-23 11:51:44 -04:00
Chris Friedt
6e66aa1f7c posix: use sys_sem instead of k_spinlock for pool synch
Based on Andy's talk at eoss 2024, use the sys/sem.h api instead
of the spinlock.h api to synchronize pooled elements since it
has minimal overhead like semaphores but also works from
userspace.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-04-23 07:01:25 -04:00
Karthikeyan Krishnasamy
cc06c2b21f lib: posix: fs: fix errno handling
ftruncate should return -1 on errors and it needs to
set appropriate error values in errno

Signed-off-by: Karthikeyan Krishnasamy <karthikeyan@linumiz.com>
2024-04-22 04:33:16 -07:00
Karthikeyan Krishnasamy
cd1ed1cdbf lib: posix: fs: add ftruncate support
Add support for ftruncate in posix implementation

Signed-off-by: Karthikeyan Krishnasamy <karthikeyan@linumiz.com>
2024-04-15 13:23:37 -04:00
Karthikeyan Krishnasamy
65ad32b3ca lib: os: fdtable: add support for fsync
Add support for fsync in existing posix ioctl call

Signed-off-by: Karthikeyan Krishnasamy <karthikeyan@linumiz.com>
2024-04-15 13:23:37 -04:00
Gaetan Perrot
51439f012a posix: Implement isastream
`isastream()` is required as part of _XOPEN_STREAMS Option Group.

signed-off-by: Gaetan Perrot <gaetanperrotpro@gmail.com>
2024-04-13 20:23:34 -04:00
Celina Sophie Kalus
5bd86eaddb posix: eventfd: Fix unsetting internal flags in ioctl
Commit e6eb0a705b ("posix: eventfd: revise locking, signaling, and
allocation") introduced a regression where the internal flags of an
event file descriptor would be erased when calling the F_SETFL ioctl
operation.

This includes the flag EFD_IN_USE_INTERNAL which determines whether
this file descriptor has been opened, thus effectively closing the
eventfd whenever one tries to change a flag.

Signed-off-by: Celina Sophie Kalus <hello@celinakalus.de>
2024-04-13 06:00:08 -04:00
Yong Cong Sin
cd2c7874b9 posix: uname: use BUILD_VERSION only if not empty
The `BUILD_VERSION` can be defined but empty when built
without git, causing version to be missing from the uname
version string:

```
*** Booting Zephyr OS build 3.5.0 ***

Printing everything in utsname...
sysname[7]: Zephyr
nodename[7]: zephyr
release[13]: 3.5.0
version[61]:  Apr  1 2024 23:48:30
machine[8]: riscv64

uart:~$
```

Let's check if it is empty before using it, so that
`KERNEL_VERSION_STRING`, which is generated independently
with cmake can be used as a fallback:

```
*** Booting Zephyr OS build 3.5.0 ***

Printing everything in utsname...
sysname[7]: Zephyr
nodename[7]: zephyr
release[13]: 3.5.0
version[61]: 3.5.0 Apr  1 2024 23:53:48
machine[8]: riscv64

uart:~$
```

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-04-04 23:47:33 +02:00
Gaetan Perrot
228d932967 posix: implement pthread_setschedprio
Implement posix pthread_setschedprio()

Signed-off-by: Gaetan Perrot <gaetanperrotpro@gmail.com>
2024-04-04 10:25:53 -04:00
Chris Friedt
5ab984a834 posix: convert static inline functions to library functions
With CONFIG_NET_POSIX_NAMES being deprecated, convert static
inlines in headers to prototypes, and move implementations
to lib/posix/options/net.c .

Since select and poll should technically also operate on
non-socket file descriptors, these may be relocated in the
future.

Below are some reasons for this change.
1. So posix calls are regular symbols and not directly inlined
   as syscalls. This is also the most portable linkage type.
2. Many posix calls are cancellation points and additional
   checks are necessary within the implementation.
3. The more we add to an inline call, the less sense it makes
   for that call to be inline.
4. When the implementation of a posix function changes, the
   interface for it should still remain consistent.

Note: the same principles have been applied in Zephyr's
posix implementation already, e.g. clock_gettime(), so this
is nothing new.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-04-02 21:01:33 -04:00
Gaetan Perrot
d61a7b2777 posix: Implement set and get inheritsched APIs for pthread attr
Implement `pthread_attr_setinheritsched()` and
`pthread_attr_getinheritsched()`are required
as part of _POSIX_THREAD_PRIORITY_SCHEDULING Option Group.

signed-off-by: Gaetan Perrot <gaetanperrotpro@gmail.com>
2024-04-01 11:04:35 +01:00
Chris Friedt
494493a3b8 posix: net: add a trivial implementation of sockatmark()
Add a trivial implementation of sockatmark().

Signed-off-by: Chris Friedt <chrisfriedt@gmail.com>
2024-03-27 07:36:18 -04:00
Chris Friedt
62031f5daa posix: net: add trivial netdb function implementations
Add trivial function implementations for those declared in
netdb.h .

Signed-off-by: Chris Friedt <chrisfriedt@gmail.com>
2024-03-27 07:36:18 -04:00
Chris Friedt
a00eeb638a posix: net: implement if_nameindex() et al
Implement if_indextoname(), if_freenameindex(), if_nameindex(),
and if_nametoindex() by wrapping around networking subystem
calls.

Signed-off-by: Chris Friedt <chrisfriedt@gmail.com>
2024-03-27 07:36:18 -04:00
Chris Friedt
7a397a08b7 posix: net: implement inet_ntoa()
Add an implementation of inet_ntoa().

Signed-off-by: Chris Friedt <chrisfriedt@gmail.com>
2024-03-27 07:36:18 -04:00
Chris Friedt
4edb9017c2 posix: net: add kconfig option and inet_addr()
Add a Kconfig option for POSIX_NETWORKING and implement
inet_addr().

Signed-off-by: Chris Friedt <chrisfriedt@gmail.com>
2024-03-27 07:36:18 -04:00
Christopher Friedt
1847280fb4 posix: rwlock: implement pthread_rwlockattr_setpshared
Implement pthread_rwlockattr_setpshared() and
pthread_rwlockattr_getpshared().

Both functions are required by the _POSIX_READER_WRITER_LOCKS
Option as detailed in Section E.1 of IEEE-1003.1-2017.

The _POSIX_READER_WRITER_LOCKS Option is required for PSE51,
PSE52, PSE53, and PSE54 conformance, and is otherwise mandatory
for any POSIX conforming system as per Section A.2.1.3 of
IEEE-1003-1.2017.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-03-22 16:19:57 -04:00
Christopher Friedt
61c4139925 posix: rwlock: pthread_rwlockattr_init / destroy in lib
Move the implementation of the following functions into
the posix library rather than having themn as static
inline functions.

* pthread_rwlockattr_init()
* pthread_rwlockattr_destroy()

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-03-22 16:19:57 -04:00
Christopher Friedt
d36dd8097e posix: clock: implement clock_getres()
clock_getres() is required by the POSIX_TIMERS Option Group
as detailed in Section E.1 of IEEE-1003.1-2017.

The POSIX_TIMERS Option Group is required for PSE51, PSE52,
PSE53, and PSE54 conformance, and is otherwise mandatory for
any POSIX conforming system as per Section A.2.1.3 of
IEEE-1003-1.2017.

With this, we have complete support for the POSIX_TIMERS
Option Group.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-03-22 16:19:27 -04:00
Christopher Friedt
c9edda0fbf posix: unistd: support for confstr()
Support querying POSIX string configuration values (similar to
sysconf()).

confstr() is required by the POSIX_SINGLE_PROCESS Option
Group as detailed in Section E.1 of IEEE-1003.1-2017 and has
been part of the specification since POSIX-2.

The POSIX_SINGLE_PROCESS Option Group is required for PSE51,
PSE52, PSE53, and PSE54 conformance, and is otherwise mandatory
for any POSIX conforming system as per Section A.2.1.3 of
IEEE-1003-1.2017.

With this, we have complete support for the POSIX_SINGLE_PROCESS
Option Group.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-03-22 08:57:44 +01:00
Gaetan Perrot
669edc0d5e posix: Implement set and get scope APIs for pthread attr
Implement `pthread_attr_setscope()` and `pthread_attr_getscope()`
are required as part of _POSIX_THREAD_PRIORITY_SCHEDULING Option Group.

signed-off-by: Gaetan Perrot <gaetanperrotpro@gmail.com>
2024-03-18 10:15:53 +01:00
Matthias Alleman
b0f9f16f14 lib: posix: shell: Fix compiler warning of lib__posix__shell
This PR fixes the following compiler warning:
No SOURCES given to Zephyr library: lib__posix__shell

Signed-off-by: Matthias Alleman <matthias.alleman@basalte.be>
2024-03-15 06:30:31 -04:00
Christopher Friedt
cdc36d090c posix: sysconf: add a "small" implementation option
Previously, sysconf() was only available as a macro (i.e. the
"extra-small" option).

This has the advantage of being compile-time constant, and
optimized for both space and speed. One disadvantage is that
querying an `_SC_` value that was invalid or unsupported
would result in a compile error.

Provide a "small" implementation of sysconf() (via Kconfig
choice) as a normal addressable function.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-03-12 17:57:11 +00:00
Gaetan Perrot
6badcad883 posix: Implement getmsg and getpmsg
`getmsg()` and `getpmsg()` are required
as part of _XOPEN_STREAMS Option Group.

signed-off-by: Gaetan Perrot <gaetanperrotpro@gmail.com>
2024-03-11 14:25:26 +01:00
Jukka Rissanen
71fd9b2e07 posix: syslog: Fix uninitialized variable error
Seen this in compiler

lib/posix/options/syslog.c: In function 'setlogmask':
lib/posix/options/syslog.c:66:16: error: 'oldpri' may be used uninitialized
   66 |         return oldpri;
      |                ^~~~~~
lib/posix/options/syslog.c:59:13: note: 'oldpri' was declared here
   59 |         int oldpri;
      |             ^~~~~~
lib/posix/options/syslog.c: In function 'vsyslog':
lib/posix/options/syslog.c:83:33: error: 'mask' may be used uninitialized
   83 |         if ((BIT(level) & mask) == 0) {
      |             ~~~~~~~~~~~~~~~~~~~~^~~~
lib/posix/options/syslog.c:71:17: note: 'mask' was declared here
   71 |         uint8_t mask;
      |                 ^~~~

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-03-10 07:44:03 -04:00
Christopher Friedt
529023e6f8 posix: manually define _POSIX_C_SOURCE in lib/posix
This PR adds declarations for the application conformance
feature test macro _POSIX_C_SOURCE.

It needs to be defined to value greater than or equal to 200112L
by the appplication.

However, Zephyr currently does not have a simple and consistent
means of specifying this value for POSIX samples, tests,
applications, and other libraries.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-03-08 04:28:47 -05:00
Christopher Friedt
447fc24352 posix: shell: add an environment variable shell command
This service is used to get, set, and unset system
environment variables.

Note: shell parameter expansion is not supported
at this time.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-03-08 04:28:47 -05:00
Christopher Friedt
0f23818153 posix: env: support for environ, getenv(), setenv(), unsetenv()
Support getting and setting POSIX environment variables.

Additionally, the thread-safe BSD variant getenv_r() is
provided.

environ, getenv(), setenv(), and unsetenv() are required by
the POSIX_SINGLE_PROCESS Option Group as detailed in
Section E.1 of IEEE-1003.1-2017.

The POSIX_SINGLE_PROCESS Option Group is required for PSE51,
PSE52, PSE53, and PSE54 conformance, and is otherwise mandatory
for any POSIX conforming system as per Section A.2.1.3 of
IEEE-1003-1.2017.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-03-08 04:28:47 -05:00
Christopher Friedt
3593720080 posix: syslog: add support for syslog
This is just a simple wrapper around Zephyr's native log api.

Note: the standard LOG_ERR syslog priority does conflict with
Zephyr's LOG_ERR() macro. This will need to be worked-around on
a case-by-case basis.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-02-29 02:45:01 -05:00
Christopher Friedt
ec27e8875d posix: mutexattr: improvements for pthread_mutexattr_t
Previously, pthread_mutexattr_gettype() and
pthread_mutexattr_settype() were non-conformant and also
less safe, as they would not check whether a pthread_mutexattr_t
had been initialized prior to manipulating them. Furthermore,
they would potentially dereference NULL pointers.

Additionally, move the pthread_mutexattr_init() and
pthread_mutexattr_destroy() functions to the library, and add
some level of checking to them so that they are more than simply
static inline / no-op calls.

Lastly, reduce the size of struct pthread_mutexattr to only
what is necessary (one byte should suffice).

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-02-27 06:11:03 -05:00
Christopher Friedt
1a3bb3fd5c posix: mqmeue: do not return NULL after pthread_exit()
pthread_exit() does not return and therefore it does not make
sense to return NULL after it in mq_notify_thread(), and that
would constitute dead code.

Rather than explicitly exiting the thread, simply return
gracefully from the thread function, and allow the pthread to
terminate in the usual way.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-02-26 08:12:29 -05:00
Gaetan Perrot
cd060f6cd3 posix: Implement fdetach and fattach
`fdetach()` and `fattach()` are required
as part of _XOPEN_STREAMS Option Group.

signed-off-by: Gaetan Perrot <gaetanperrotpro@gmail.com>
2024-02-26 11:36:04 +00:00
Christopher Friedt
f3709e20b8 posix: convert all error logs to debug logs
In Zephyr, things are often optimized for size first. That's how
we fit into such tight parking spaces.

This change gives more control to the user about whether the
POSIX API does any logging at all, simultaneously shrinking binary
size while improving speed.

No bytes / cycles left behind!

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-02-24 10:34:05 -05:00
Christopher Friedt
ba639ed6a8 posix: semaphore: check return value of k_mutex_lock()
This fixes CID 340851.

This should never fail, but it's also something that can be
easily verified.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-02-06 17:51:56 -06:00
Christopher Friedt
4174ff119d posix: cmake: allow empty library
This change mitigates the following cmake warning

No SOURCES given to Zephyr library: lib__posix__options

without needing to have a separate interface library
(as we do not need private headers exposed).

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-02-05 15:35:09 +01:00
Gaetan Perrot
a897c1c7d9 posix: sched: Implement sched_rr_get_interval
Implement `sched_rr_get_interval()` POSIX APIs
as a part of PSE53 `_POSIX_PRIORITY_SCHEDULING` option group.
Functions is actually placeholders and just return `ENOSYS`
since Zephyr does not yet support processes or process scheduling.

signed-off-by: Gaetan Perrot <gaetanperrotpro@gmail.com>
2024-02-02 12:42:50 +01:00
Gaetan Perrot
9cd7564ab0 posix: pthread_testcancel zephyrproject-rtos#59946
Implement posix pthread_testcancel()

signed-off-by: Gaetan Perrot <gaetanperrotpro@gmail.com>
2024-02-01 15:14:28 +01:00
Christopher Friedt
e8b178411c posix: remove unneeded option to link with posix subsys
The CONFIG_APP_LINK_WITH_POSIX_SUBSYS option was originally
present so that internal POSIX implementation headers would be
on the include path.

There is no implicit need for any app or library to include
private POSIX headers. Instead, the standard POSIX API should
be used.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-02-01 05:26:24 -05:00
Christopher Friedt
855b8bc6ca posix: separate shell utilities and posix api implementation
Previously, the POSIX shell utilities were intermixed with the
POSIX API implementation.

The POSIX shell utilities only depend on the public POSIX API,
so it makes sense to keep them in a separate subdirectory.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-02-01 05:26:24 -05:00
Gaetan Perrot
8a6c745e9f posix: sched: Implement set APIs for scheduling parameters
Implement `sched_setparam()` and `sched_setscheduler()` POSIX APIs
as a part of PSE53 `_POSIX_PRIORITY_SCHEDULING` option group.
Both functions are actually placeholders and just return `ENOSYS`
since Zephyr does not yet support processes or process scheduling.

signed-off-by: Gaetan Perrot <gaetanperrotpro@gmail.com>
2024-01-31 11:16:26 +01:00
Abhinav Srivastava
52485876f0 posix: Add tests for stropts
Add tests, Fix config issues, Re-add Timer

Signed-off-by: Abhinav Srivastava <atg271@gmail.com>
2024-01-31 09:05:50 +01:00
Abhinav Srivastava
93e9491dd9 posix: putmsg implementation and configurations
Add needed KConfig, CMakeList and Stropts.c

Signed-off-by: Abhinav Srivastava <atg271@gmail.com>
2024-01-31 09:05:50 +01:00
Adam Wojasinski
6f5626d1cf posix: Add basic sysconf() function implementation
The patch introduces basic implementation of sysconf() function.
It's based on macro - that means that every function call is resolved
at compile time - and is not fully complient with POSIX standard
(the errno value is not handled and passing invalid name argument
results in compilation error). Treat this commit as a starting point
for proper sysconf() implementation. The one introduced in the patch
could stay as a defult implementation.

sysconf() documentation:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/sysconf.html
https://man7.org/linux/man-pages/man3/sysconf.3.html

Fixes #56670

Signed-off-by: Adam Wojasinski <awojasinski@baylibre.com>
2024-01-30 18:01:18 +01:00
Christopher Friedt
b600e8a870 posix: timer: build timer.c using the correct kconfig option
Previously timer.c was only built with CONFIG_POSIX_CLOCK=y even
though it has had its own Kconfig symbol (CONFIG_TIMER) for a
very long time.

Make POSIX_CLOCK imply TIMER rather than control whether it is
built, and adjust Kconfig / CMake as necessary.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-01-29 10:28:10 +01:00
Christopher Friedt
e357ba835d posix: internal: make priority / policy transforms available
Two functions can be used with relative ease to convert between
Zephyr and POSIX priorities and policies. Namely,

uint32_t zephyr_to_posix_priority(int32_t z_prio, int *policy)
int32_t posix_to_zephyr_priority(uint32_t priority, int policy)

These are not necessarily public API, but they helped with the
POSIX Philosophers Sample, which is in a subsequent commit.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-01-28 13:01:36 -05:00
Christopher Friedt
fc26fd5a15 posix: pthread: initialize t and c pointers to NULL
* initialize posix_thread and __pthread_cleanup ptrs to NULL
* check ret is zero before finalizing a thread in pthread_cancel()

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-01-26 10:12:21 -05:00
Christopher Friedt
23016f4589 posix: pthread: posix_thread_q_set() and posix_thread_q_get()
Create getter and setter functions for setting internal pthread
states to READY, RUN, or DONE queues.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-01-26 06:50:11 -05:00
Christopher Friedt
81f3777be1 posix: pthread: hold pool lock when calling to_posix_thread()
There may be race conditions when calling to_posix_thread()
from multiple threads.

Ensuing that the pthread pool lock is held when
to_posix_thread() is called will prevent those races.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-01-26 06:50:11 -05:00
Christopher Friedt
77135fcbc6 posix: pthread: embed posix_thread_attr inside of posix_thread
Rather than shadowing most of the fields from pthread_attr_t
(struct posix_thread_attr) inside of struct posix_thread, just
embed the structure itself.

Additionally, use pthread_attr_init() to allocate a thread
stack and pthread_attr_destroy() to destroy a thread stack,
dramatically simplifying pthread_create().

A fair bit of rework was needed already to mitigate bitrot
issues in the testsuite. More should probably be done later.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-01-26 06:50:11 -05:00
Christopher Friedt
dbcba2f46c posix: pthread: check canceltype before async cancel
The default pthread cancellation type is deferred.

Check that the canceltype is asynchronous (with
respect to cancellation points) before cancelling
a thread.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-01-26 06:50:11 -05:00
Christopher Friedt
301581a892 posix: pthread: wrapper to check attribute initialization
Add a small wrapper to check if a pthread_attr_t has been
properly initialized (i.e. ready to pass to
pthread_create()).

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-01-26 06:50:11 -05:00
Adam Wojasinski
c1643f9701 posix: Add implementation of mq_notify() function
The function was the last missing piece of the `_POSIX_MESSAGE_PASSING`
option group. Due to lack of signal subsystem in the Zephyr RTOS
the `sigev_notify` member of the `sigevent` structure that describes
the notification cannot be set to `SIGEV_SIGNAL` - this notification
type is not implemented, the function will return -1 and set `errno`
to `ENOSYS`.

`mq_notify` documentation:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/mq_notify.html

Fixes #66958

Signed-off-by: Adam Wojasinski <awojasinski@baylibre.com>
2024-01-25 19:47:37 +01:00
Christopher Friedt
57057b141c posix: add a top-level menu
Add a top-level menu to prevent POSIX API options from
cluttering the menuconfig view under
"Additional libraries".

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-01-25 05:54:06 -05:00
Christopher Friedt
3ff7c04f30 posix: timer: use async pthread cancellation
Previously, Zephyr's POSIX API did not differentiate between
deferred and asynchronous pthread cancellation. In fact all
pthread cancellation was asynchronous. According to the spec,
all pthreads should be created with deferred cancellation by
default.

Note: PTHREAD_CANCEL_ASYNCHRONOUS means cancel asynchronously
with respect to cancellation points (but synchronously with
respect to the thread that callse pthread_cancel(), which is
perhaps unintuitive).

The POSIX timer relied on this non-standard convention.

Oddly, this change prevents what would have otherwise been a
regression that would have been caused by fixing pthread
behaviour (in a separate commit).

We are effectively uncovering bugs which were probably always
present in the pthread.c and timer.c implementations going
back quite a few years.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-01-22 06:48:55 -05:00
Christopher Friedt
689dc4a45b posix: timer: support other clocks
There is no requirement that says e.g. CLOCK_REALTIME cannot be
used for timer_create(). In fact, the spec explicitly requires
it. It might not be ideal, but users should still be able to
use it.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-01-22 06:48:55 -05:00
Christopher Friedt
b0a83a9177 posix: rwlock: make pthread_rwlock_t a pooled ipc type
Like mutex, barrier, cond, spinlock, etc, make
pthread_rwlock_t a pooled ipc type.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-01-18 09:22:35 -05:00
Yong Cong Sin
7c42c01f10 posix: pthread: use is_posix_policy_prio_valid to check POSIX priority
Use the existing `is_posix_policy_prio_valid()` function to
verify the POSIX's priority in the conversion functions.

Changed the `priority` arg of `is_posix_policy_prio_valid` to
`int` since that is the output of `sched_get_priority_min` &
`sched_get_priority_max`.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-01-18 10:54:47 +01:00
Yong Cong Sin
c3cc2e4e6d posix: pthread: test the priority conversion functions
Made the conversion functions non-static and added ztests for
them to make sure that they work across the full range of
Zephyr priorities.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-01-18 10:54:47 +01:00
Yong Cong Sin
5ad7f4b314 posix: pthread: priority should be of int type
Changed the variable type of the priority in the args and the
return type of the conversion functions to `int`, as both
Zephyr's priority & POSIX's `sched_priority` has type `int`.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-01-18 10:54:47 +01:00
Yong Cong Sin
b2caec8601 posix: pthread: fix typos
- 'piority' should be 'priority'
- COOP should start from `-CONFIG_NUM_COOP_PRIORITIES`

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-01-18 10:54:47 +01:00
Yong Cong Sin
66fdd39ec5 posix: pthread: fix zephyr_to_posix_priority assert test
If `z_prio` is negative and we want to make sure that it is
within `[-CONFIG_NUM_COOP_PRIORITIES, -1]`, we should invert
its sign and make sure that it is `<=`
`CONFIG_NUM_COOP_PRIORITIES` instead of `<`.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-01-18 10:54:47 +01:00
Yong Cong Sin
45c554d082 posix: shell: introduce top level posix command
Added a top level `posix` shell command for other POSIX
commands. Currently only `uname` is supported.

New POSIX commands can be added by including the
`posix_shell.h` header and use the `POSIX_CMD_ADD` helper
macro.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-01-18 10:54:32 +01:00
Yong Cong Sin
635dabf07a posix: uname: shell: update help message with more information
Populate the help message with more information when an error
occurs.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-01-18 10:54:32 +01:00
Yong Cong Sin
48c16f9052 posix: uname: move uname shell from sample
Relocate the `uname` shell implementation from uname sample, so
that it can be reused by other application and the uname sample
only uses POSIX APIs.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-01-18 10:54:32 +01:00
Yong Cong Sin
98a631b5bc posix: pthread: allow oldstate & oldtype to be NULL
The POSIX standard doesn't specify if the argument to store
previous state/type in
`pthread_setcancelstate`/`pthread_setcancelstate` can be
`NULL`, but threading implementations in Linux & Apache NuttX
permit the arguments to be `NULL`.

This commit changes Zephyr's implementation to mimic that of
Linux & NuttX, so that user do not get caught off-guard by
NULL pointer dereferencing when porting code over from those
OSes.

Updated test accordingly.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-01-17 14:42:50 +01:00
Yong Cong Sin
73e20a8967 posix: clock: add ztest rule to reset clock base
Make sure that the POSIX clock base is reset after every
testsuite so that the initial time is the same for every test.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-01-17 05:41:37 -05:00
Christopher Friedt
a6dab1a85e posix: pthread: additional null checks on parameters
Instead of relying on a fault occurring when NULL
parameters are passed in, explicitly check and return
EINVAL.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-01-16 00:35:45 -05:00
Dmitrii Golovanov
68d1a52417 posix: sched: Implement get APIs for scheduling parameters
Initial implementation of `sched_getparam()` and `sched_getscheduler()`
POSIX APIs as a part of PSE53 `_POSIX_PRIORITY_SCHEDULING` option group.
Both functions are actually placeholders and just return `ENOSYS`
since Zephyr does not yet support processes or process scheduling.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2024-01-15 09:57:44 +01:00
Dmitrii Golovanov
b184fc3a62 posix: sched: Add CONFIG_POSIX_PRIORITY_SCHEDULING
Add `CONFIG_POSIX_PRIORITY_SCHEDULING` Kconfig option to select
APIs from PSE53 `_POSIX_PRIORITY_SCHEDULING` option group.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2024-01-15 09:57:44 +01:00