Skip to content

Missing POSIX APIs

While Redox's aim is not full POSIX compatibility, there are lots of missing APIs that generally only come with benefits.

Non-exhaustive list:

https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/sys_mman.h.html

  • some sys/mman.h defs (#73)

https://pubs.opengroup.org/onlinepubs/009604499/functions/wcswcs.html

  • wcswcs considered legacy, calls wcsstr

https://pubs.opengroup.org/onlinepubs/9799919799/functions/wcsstr.html

https://pubs.opengroup.org/onlinepubs/9799919799/functions/wcsxfrm.html

  • wcsxfrm
  • wcsxfrm_l

https://pubs.opengroup.org/onlinepubs/9799919799/functions/wcsftime.html

  • wcsftime

https://pubs.opengroup.org/onlinepubs/9799919799/functions/mknod.html

https://pubs.opengroup.org/onlinepubs/9799919799/functions/wctrans.html

https://pubs.opengroup.org/onlinepubs/9799919799/functions/towctrans.html

https://pubs.opengroup.org/onlinepubs/9799919799/functions/ungetwc.html

https://pubs.opengroup.org/onlinepubs/9799919799/functions/wcsrtombs.html

https://pubs.opengroup.org/onlinepubs/9799919799/functions/fwprintf.html

  • wprintf (!352 (merged))
  • swprintf calls vswprintf?
  • fwprintf calls vfwprintf

https://pubs.opengroup.org/onlinepubs/9799919799/functions/vfwprintf.html

https://pubs.opengroup.org/onlinepubs/9799919799/functions/fwscanf.html

https://pubs.opengroup.org/onlinepubs/9799919799/functions/vfwscanf.html

https://pubs.opengroup.org/onlinepubs/9799919799/functions/alarm.html

  • alarm calls setitimer which is depreciated (#210)

https://pubs.opengroup.org/onlinepubs/9799919799/functions/timer_create.html

  • timer_create

https://pubs.opengroup.org/onlinepubs/9799919799/functions/confstr.html

https://pubs.opengroup.org/onlinepubs/9799919799/functions/waitid.html

https://pubs.opengroup.org/onlinepubs/9799919799/functions/posix_spawn.html

  • posix_spawn (#192)
  • posix_spawnp

https://pubs.opengroup.org/onlinepubs/9799919799/functions/shm_open.html

https://pubs.opengroup.org/onlinepubs/9799919799/functions/fcntl.html

https://pubs.opengroup.org/onlinepubs/9799919799/functions/mkdir.html

  • mkdir
  • mkdirat (#103)

https://pubs.opengroup.org/onlinepubs/9799919799/functions/getgroups.html

  • getgroups

https://pubs.opengroup.org/onlinepubs/9799919799/functions/getrlimit.html

  • getrlimit
  • setrlimit

https://pubs.opengroup.org/onlinepubs/9799919799/functions/getrusage.html

  • getrusage

https://pubs.opengroup.org/onlinepubs/9799919799/functions/getpriority.html

  • getpriority
  • setpriority

https://pubs.opengroup.org/onlinepubs/9799919799/functions/clock_getres.html

https://pubs.opengroup.org/onlinepubs/9799919799/functions/posix_madvise.html

https://pubs.opengroup.org/onlinepubs/9799919799/functions/msync.html

https://pubs.opengroup.org/onlinepubs/9799919799/functions/open.html

  • open
  • openat (!668)

https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/utmpx.h.html

https://pubs.opengroup.org/onlinepubs/9799919799/functions/fstatat.html

https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/dirent.h.html

  • finish implementation (#220)

https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/fcntl.h.html

  • finish implementation (#221)

Crates that need fixing

Non POSIX

  • wait3 BSD extension to POSIX waitpid (#170)
  • malloc.h Non standard, platform specific. Should use POSIX stdlib.h instead. (#136)

Not all POSIX APIs are available as stubs, but those that are, can be found by looking for commented-out #[no_mangle], e.g. via rg '^.*//.*#\[no_mangle\]'.

There are some POSIX requirements that will be much harder to fix. First, the current context=process=thread assumption must be dealt with. Second, POSIX appears to allow all characters but NUL and '/', which conflicts with how schemes work (even returning an error due to lack of support for : in the filesystem, doesn't apply, as it will work but the behavior will be different).

Reference

Almost all POSIX functions are well-documented on the following links:

Edited by Mathew John Roberts