universalisos/docs-extracted/posix/posix-conformance.md

103 KiB
Raw Blame History

title source category pages extracted
Posix Conformance docs/posix/posix-conformance.pdf posix 51 2026-07-06T23:05:50.711773

Posix Conformance

Extracted from docs/posix/posix-conformance.pdf (51 pages). Figures, diagrams, and tables may not render accurately in plain text.

POSIX Conformance Document

    Am Pfaffenstein 14, D-55270 Klein-Winternheim

 Notice: The contents of this document are proprietary to
  Portugal Futurista and shall not be disclosed, disseminated,
      copied, or used except for purposes expressly
           authorized in writing by Portugal Futurista.

POSIX Conformance Document UniversalisOS D5.0, Document Version D5.0-147

c 2005 2019 Portugal Futurista GmbH

Portugal Futurista GmbH Email: office@portugalfuturista.org Am Pfaffenstein 14 55270 Klein-Winternheim, Germany http://www.portugalfuturista.org

All rights reserved. UniversalisOS is a trademark of Portugal Futurista GmbH. The designations used to identify other software or hardware products in this publication may be trademarks of their manufacturers or sellers. Contents

I Base Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 3 Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 3.4 Additional File Access Control Mechanism . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 3.5 Appropriate Privileges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 3.97 Clock Tick . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 3.117 CPU Time (Execution Time) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 3.118 File Group Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 3.119 Group Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 3.120 Parent Process ID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 3.121 Read-Only File System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 3.122 System Databases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 3.123 User Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 4 General Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 4.9 Measurement of Execution Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 4.11 Pathname Resolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 4.13 Scheduling Policy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 4.14 Seconds Since the Epoch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 4.18 Treatment of Error Conditions for Mathematical Functions . . . . . . . . . . . . . . . . . . . . 12 4.18.1 Domain Error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 4.18.3 Range Error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 6 Character Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 6.3 C Language Wide-Character Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 6.4 Character Set Description File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 7 Locale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 7.1 General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 7.2 POSIX Locale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 7.3 Locale Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 8 Environment Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 13 Headers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 II System Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 2 General Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 2.3 Error Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 2.4 Signal Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 2.4.1 Signal Generation and Delivery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 2.4.2 Realtime Signal Generation and Delivery . . . . . . . . . . . . . . . . . . . . . . . . . 24

                                                    3

4

2.5   Standard I/O Streams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .        24
      2.5.1 Interaction of File Descriptors and Standard I/O Streams . . . . . . . . . . . . . . . . .        24
      2.5.2 Stream Orientation and Encoding Rules . . . . . . . . . . . . . . . . . . . . . . . . .           24
2.8   Realtime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .      25
      2.8.3 Memory Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .             25
      2.8.4 Process Scheduling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .          25
      2.8.5 Clocks and Timers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .         25
      2.9.4 Thread Scheduling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .         25
2.11  Tracing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .     26

III XSH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 20 System Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 20.1 acos, acosf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 20.2 acosh, acoshf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 20.3 asin, asinf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 20.4 atanh, atanhf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 20.5 calloc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 20.6 chmod . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 20.7 clock_getres . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 20.8 cos, cosf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 20.9 erfc, erfcf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 20.10 exit, _exit, _Exit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 20.11 exp, expf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 20.12 exp2, exp2f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 20.13 fcntl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 20.14 fdim, fdimf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 20.15 fflush . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 20.16 fgetc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 20.17 fgetwc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 20.18 fma, fmaf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 20.19 fmod, fmodf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 20.20 fprintf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 20.21 fputc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 20.22 fputwc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 20.23 freopen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 20.24 fscanf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 20.25 fseek . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 20.26 fsetpos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 20.27 fsync . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 20.28 ftruncate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 20.29 kill . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 20.30 ldexp, ldexpf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 20.31 log, logf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 20.32 log10, log10f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 20.33 log1p, log1pf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 20.34 log2, log2f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 20.35 longjmp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 20.36 lseek . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 20.37 malloc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

                             c Copyright 2005  2019, Portugal Futurista, all rights reserved.
                                                                                                          5

20.38 mkdir . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 20.39 mlock, mlockall, munlock, munlockall . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 20.40 mmap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 20.41 mq_open . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 20.42 mq_receive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 20.43 mq_setattr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 20.44 nan, nanf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 20.45 open . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 20.46 pow, powf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 20.47 pthread_atfork . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 20.48 pthread_attr_destroy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 20.49 pthread_attr_getdetachstate, pthread_attr_setdetachstate . . . . . . . . . . . . . . . . . . . . 36 20.50 pthread_attr_getguardsize, pthread_attr_setguardsize . . . . . . . . . . . . . . . . . . . . . . 36 20.51 pthread_attr_getinheritsched, pthread_attr_setinheritsched . . . . . . . . . . . . . . . . . . . 36 20.52 pthread_attr_getschedparam, pthread_attr_setschedparam . . . . . . . . . . . . . . . . . . . 36 20.53 pthread_attr_getschedpolicy, pthread_attr_setschedpolicy . . . . . . . . . . . . . . . . . . . . 37 20.54 pthread_attr_getscope, pthread_attr_setscope . . . . . . . . . . . . . . . . . . . . . . . . . . 37 20.55 pthread_attr_getstack, pthread_attr_setstack . . . . . . . . . . . . . . . . . . . . . . . . . . 37 20.56 pthread_attr_getstackaddr, pthread_attr_setstackaddr . . . . . . . . . . . . . . . . . . . . . . 37 20.57 pthread_attr_getstacksize, pthread_attr_setstacksize . . . . . . . . . . . . . . . . . . . . . . 37 20.58 pthread_attr_init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 20.59 pthread_cancel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 20.60 pthread_cleanup_pop, pthread_cleanup_push . . . . . . . . . . . . . . . . . . . . . . . . . . 38 20.61 pthread_cond_broadcast, pthread_cond_signal . . . . . . . . . . . . . . . . . . . . . . . . . 38 20.62 pthread_cond_destroy, pthread_cond_init . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 20.63 pthread_cond_timedwait, pthread_cond_wait . . . . . . . . . . . . . . . . . . . . . . . . . . 39 20.64 pthread_condattr_init, pthread_condattr_destroy . . . . . . . . . . . . . . . . . . . . . . . . . 39 20.65 pthread_condattr_getpshared, pthread_condattr_setpshared . . . . . . . . . . . . . . . . . . 39 20.66 pthread_create . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 20.67 pthread_detach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 20.68 pthread_getschedparam, pthread_setschedparam . . . . . . . . . . . . . . . . . . . . . . . . 40 20.69 pthread_getspecific, pthread_setspecific . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 20.70 pthread_join . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 20.71 pthread_key_create, pthread_key_delete . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 20.72 pthread_mutex_destroy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 20.73 pthread_mutex_getprioceiling, pthread_mutex_setprioceiling . . . . . . . . . . . . . . . . . . 41 20.74 pthread_mutex_init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 20.75 pthread_mutex_lock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 20.76 pthread_mutex_timedlock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 20.77 pthread_mutex_trylock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 20.78 pthread_mutex_unlock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 20.79 pthread_mutexattr_destroy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 20.80 pthread_mutexattr_getprioceiling, pthread_mutexattr_setprioceiling . . . . . . . . . . . . . . . 43 20.81 pthread_mutexattr_getprotocol, pthread_mutexattr_setprotocol . . . . . . . . . . . . . . . . . 43 20.82 pthread_mutexattr_getpshared, pthread_mutexattr_setpshared . . . . . . . . . . . . . . . . . 43 20.83 pthread_mutexattr_gettype, pthread_mutexattr_settype . . . . . . . . . . . . . . . . . . . . . 43 20.84 pthread_mutexattr_init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 20.85 pthread_once . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

                         c Copyright 2005  2019, Portugal Futurista, all rights reserved.

6

20.86 pthread_rwlock_destroy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .         44
20.87 pthread_rwlock_init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .        44
20.88 pthread_rwlock_rdlock, pthread_rwlock_tryrdlock . . . . . . . . . . . . . . . . . . . . . . . .          44
20.89 pthread_rwlock_timedrdlock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .         44
20.90 pthread_rwlock_unlock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .        44
20.91 pthread_rwlock_wrlock, pthread_rwlock_trywrlock . . . . . . . . . . . . . . . . . . . . . . . .          45
20.92 pthread_rwlockattr_destroy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .       45
20.93 pthread_rwlockattr_init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .      45
20.94 pthread_setcancelstate, pthread_setcanceltype . . . . . . . . . . . . . . . . . . . . . . . . .          45
20.95 pthread_setschedprio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .         45
20.96 pthread_sigmask . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .        45
20.97 read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .       45
20.98 remainder, remainderf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .        46
20.99 remquo, remquof . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .        46
20.100 scalbln, scalblnf, scalbn, scalbnf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .    46
20.101 sched_yield . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .       46
20.102 sem_open . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .        46
20.103 sem_init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .      46
20.104 sem_destroy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .       46
20.105 sem_getvalue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .        46
20.106 sem_post . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .        47
20.107 sem_wait, sem_trywait . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .       47
20.108 setjmp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .      47
20.109 setlocale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .     47
20.110 shm_open . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .        47
20.111 shm_unlink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .      47
20.112 sigaction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .     47
20.113 sigaddset, sigdelset, sigismember . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .       49
20.114 signal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .      49
20.115 sigprocmask . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .       49
20.116 sigsetjmp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .     50
20.117 sigtimedwait, sigwaitinfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .     50
20.118 sigwait . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .     50
20.119 sin, sinf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   50
20.120 sleep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .     50
20.121 sqrt, sqrtf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   50
20.122 strtod, strtof . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .    50
20.123 tan, tanf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .     51
20.124 tgamma, tgammaf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .         51
20.125 timer_create . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .      51
20.126 tzset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .     51
20.127 uname . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .       51
20.128 write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .     51


                              c Copyright 2005  2019, Portugal Futurista, all rights reserved.
                                                                                                                7

This document states the conformance of the POSIX personality for UniversalisOS with IEEE Std 1003.13-1998 PSE51 and in parts conformance with IEEE Std 1003.1-2001. All heading numbers in this document except those in part three correspond to the heading numbers in IEEE Std 1003.1-2001. The documents focus is on functions relating to thread handling, operating system access, and signal handling. It contains clarifications of the parts defined as implementation defined by the standard and describes system behavior for the parts unspecified by the standard.

Conventions

This implementation uses the _np to identify routines, types, and constants that implement nonportable extensions to the POSIX.1c standard. Example routines:

• pthread_attr_getschequantum_np()

• pthread_attr_setschequantum_np()

• pthread_getschequantum_np()

• pthread_setschequantum_np()

Example structure members:

• sched_eff_priority_np (in struct sched_param)

Function argument checking

Functions of the POSIX.1c and POSIX.1b standard, which get pointers as function argument, either explicitly or implicitly (opaque POSIX.1c objects are mostly interpreted as pointers), do not perform comprehensive pointer value or object validation. In cases where an object pointer is set to the NULL-pointer on object destructions, NULL-pointer checks are performed by functions operating on such an object. If the validation fails, an appropriate error is returned (usually [EINVAL]).

C Library Implementations

In cases where the for the two versions of the C library differ in parts relevant for this document, the behavior of each implementation is mentioned. If no distinction is made herein, both implementations behave the same.

                              c Copyright 2005  2019, Portugal Futurista, all rights reserved.
 Part I

Base Definitions

   8

3 Definitions

3.4 Additional File Access Control Mechanism

Access to files and shared memory objects accessed through the PSSW underlie restrictions and limitations of the PSSW file provider and the VMIT configuration for those objects.

3.5 Appropriate Privileges

This implementation does not support the notion appropriate privileges as defined by IEEE Std 1003.1-2001, thus there are no means to control or obtain process privileges. Operations requiring appropriate privileges will always succeed if implemented.

3.97 Clock Tick

A clock tick is an interval of time; how many of these occur each second is a system configuration parameter. Clock ticks are one of the units that may be used to express a value found in type clock_t. The tuneable parameter sched_tick_duration determines the minimum length of one tick, (1 / sched_tick_duration) is the maximal amount of clock ticks occurring in one second.

3.117 CPU Time (Execution Time)

The UniversalisOS kernel keeps track of execution times of UniversalisOS threads. The UniversalisOS POSIX Personality implemen- tation uses a many to one mapping of application threads to UniversalisOS threads and records the execution time of application threads whenever an application thread scheduling takes place. Process execution time includes the execution time of both application threads and other UniversalisOS threads created by the implementation or application (DDAPI). Process execution time can be accessed through times() or the CLOCK_PROCESS_CPUTIME_ID clock. Thread execution time is an optional feature disabled by default, refer to the UniversalisOS Personality Manual: POSIX for further details. If enabled, thread execution time can be retrieved using pthread_getcputime_np() or the CLOCK_THREAD_CPUTIME_ID clock.

                            c Copyright 2005  2019 Portugal Futurista GmbH, all rights reserved.

10

3.118 File Group Class

In PSE51 mode, the group identification of a process is undefined. A file system provider (FSP) may impose restrictions on file access based on FSP-implementation specific restrictions.

3.119 Group Database

The implementation does not use a group database, groups are only represented by their numerical gid_t value.

3.120 Parent Process ID

The implementation defines a single process environment, the notion of parent process ID is not relevant (getppid() is not implemented).

3.121 Read-Only File System

File Times Update is not implemented for resources managed by the PSSW. In PSE51 mode, access to additional file systems is achieved through a file system provider (FSP). File Times Updates is the responsibility of the FSP.

3.122 System Databases

In PSE51 mode, path name resolution is non-standard. The initial working directory is null, relative path names start at the file system root.

3.123 User Database

In PSE51 mode, the user identification of a process is undefined.

                             c Copyright 2005  2019, Portugal Futurista, all rights reserved.

4 General Concepts

4.9 Measurement of Execution Time

The UniversalisOS kernel keeps track of execution times of UniversalisOS threads. The UniversalisOS POSIX Personality implemen- tation uses a many to one mapping of application threads to UniversalisOS threads and records the execution time of application threads whenever an application thread scheduling takes place. Process execution time includes the execution time of both application threads and other UniversalisOS threads created by the implementation or application (DDAPI). With respect to thread scheduling, execution time of threads is accounted for by the system ticker thread (refer to the UniversalisOS Personality Manual: POSIX for details on the ticker thread) to implement scheduling policies. Refer to section 2.9.4 on page 25 for details on thread scheduling an section 3.97 for details on the clock tick and its configuration.

4.11 Pathname Resolution

In PSE51 mode, the implementation does not provide a POSIX conforming file system interface. Pathnames are constructed of two parts, a provider part and a pathname part. Both parts are separated by slashes and the provider part has to start with a slash. The pathname part is handed transparently (not normalization) to the file system provider (FSP) for further path resolution. The current working directory is stored as a path name which will be prepended to relative path names before performing pathname resolution. Pathnames may have additional restrictions defined by the underlying UniversalisOS file providers. Pathnames are normalized before resolution takes place, consecutive slashes are always collapsed to a single slash.

4.13 Scheduling Policy

This implementation supports three scheduling policies, SCHED_RR, SCHED_FIFO, and SCHED_OTHER. SCHED_RR and SCHED_FIFO are implemented according to IEEE Std 1003.1-2001 and there are no other mech- anisms than those defined by the standard which affect thread scheduling order or thread scheduling policies.

                            c Copyright 2005  2019 Portugal Futurista GmbH, all rights reserved.

12

SCHED_OTHER is a prioritized quantum based scheduler as defined by the standard for SCHED_RR with the only difference that each thread may define its allocated scheduling interval. When the scheduling interval of a thread with scheduling policy SCHED_OTHER is changed, its scheduling state may be affected as follows:

Thread is suspended If the threads remaining time slice which was valid at the time it was suspended is larger than the new time slice, it will be set to the new time slice.

Thread is runnable but not running If the threads remaining time slice which was valid at the time it was pre- empted is larger than the new time slice, it will be set to the new time slice. If the thread was previously preempted because it used up its time slice, it will continue execution with the new time slice. If the thread was previously preempted by a higher priority thread, and its remaining quantum is not larger than the new time slice, its remaining time slice remains unchanged.

Thread is running as current thread The thread becomes the tail of the thread list for its priority and will con- tinue execution with the new time slice value.

4.14 Seconds Since the Epoch

The system has no information on current actual time or relationship of the current time and the Epoch. The system continuously updates a time value in the system ticker thread (refer to the UniversalisOS Personality Manual: POSIX for details on the ticker thread). This value is treated as Epoch and can be read via time() and clock_gettime(CLOCK_REALTIME) and written to using clock_settime(CLOCK_REALTIME).

4.18 Treatment of Error Conditions for Mathematical Functions

The implementation always defines math_errhandling so that (math_errhandling & MATH_ERRNO) is non-zero. On architectures with hardware floating-point support for all computations (math_errhandling & MATH_ER- REXCEPT) is non-zero.

Domain Error

4.18.1 Domain Error

Functions with real floating return values will return a NaN when a domain error is detected.

4.18.3 Range Error

4.18.3.2 Result Underflows

When an underflow occurs during computation and floating point computation is performed in hardware and the hardware supports IEEE-754 compliant behavior, a zero will be delivered for results that underflow. Depending on the architecture, an underflow exception is raised. Underflows do not cause [ERANGE] to be set in errno.

                             c Copyright 2005  2019, Portugal Futurista, all rights reserved.

6 Character Set

6.3 C Language Wide-Character Codes

Wide character functionality is not fully supported and limited to a character width of 1.

6.4 Character Set Description File

There is no support for user provided character set description files.

                             c Copyright 2005  2019 Portugal Futurista GmbH, all rights reserved.

7 Locale

7.1 General

There is no support for any locale beyond the default support from the C language. The implementation does not check the category argument in a call to setlocale().

7.2 POSIX Locale

The implementations default locale is the C locale.

7.3 Locale Definition

There are no additional locale categories supported.

                            c Copyright 2005  2019 Portugal Futurista GmbH, all rights reserved.

8 Environment Variables

The POSIX personality does not support environment variables set from the outside. There is no mechanism for sharing environment variables between personalities. However, environment variables set by setenv() in the current personality and read by getenv() are supported and handled in the way described by the POSIX standard.

                         c Copyright 2005  2019 Portugal Futurista GmbH, all rights reserved.

13 Headers

<float.h> The constants defined by the <float.h> header have different settings depending on the hardware architecture. The following table shows the different values for the supported platforms:

                          c Copyright 2005  2019 Portugal Futurista GmbH, all rights reserved.
                                                                                                       17


       Symbol             PowerPC                             SPARC                       x86 64-Bit


     FLT_RADIX                2                                  2                            2

FLT_EVAL_METHOD 0 0 0 DECIMAL_DIG 17 17 21 FLT_MANT_DIG 24 24 24 FLT_EPSILON 1.19209290E-7F 1.19209290E-7F 1.19209290E-7F FLT_DIG 6 6 6 FLT_MIN_EXP -125 -125 125 FLT_MIN 1.17549435E-38F 1.17549435E-38F 1.17549435E-38F FLT_MIN_10_EXP 37 37 37 FLT_MAX_EXP 128 128 128 FLT_MAX 3.40282347E+38F 3.40282347E+38F 3.40282347E+38F FLT_MAX_10_EXP 38 38 38 DBL_MANT_DIG 53 53 53 DBL_EPSILON 2.2204460492503131E-16 2.2204460492503131E-16 2.2204460492503131E-16 DBL_DIG 15 15 15 DBL_MIN_EXP 1021 1021 1021 DBL_MIN 2.2250738585072014E-308 2.2250738585072014E-308 2.2250738585072014E-308 DBL_MIN_10_EXP 307 307 307 DBL_MAX_EXP 1024 1024 1024 DBL_MAX 1.7976931348623157E+308 1.7976931348623157E+308 1.7976931348623157E+308 DBL_MAX_10_EXP 308 308 308 LDBL_MANT_DIG 53 53 64 LDBL_EPSILON 2.2204460492503131E-16L 2.2204460492503131E-16L 1.0842021724855044340E-19L LDBL_DIG 15 15 18 LDBL_MIN_EXP 1021 1021 16381 LDBL_MIN 2.2250738585072014E-308L 2.2250738585072014E-308L 3.3621031431120935063E-4932L LDBL_MIN_10_EXP 307 307 4931 LDBL_MAX_EXP 1024 1024 16384 LDBL_MAX 1.7976931348623157E+308L 1.7976931348623157E+308L 1.1897314953572317650E+4932L LDBL_MAX_10_EXP 308 308 4932

                       c Copyright 2005  2019, Portugal Futurista, all rights reserved.

18

           Symbol              ARM 32-Bit                                      ARM 64-Bit


      FLT_RADIX                      2                                                 2

FLT_EVAL_METHOD 0 0 DECIMAL_DIG 17 17 FLT_MANT_DIG 24 24 FLT_EPSILON 1.19209290E-7F 1.19209290E-7F FLT_DIG 6 6 FLT_MIN_EXP 125 125 FLT_MIN 1.17549435E-38F 1.17549435E-38F FLT_MIN_10_EXP 37 37 FLT_MAX_EXP 128 128 FLT_MAX 3.40282347E+38F 3.40282347E+38F FLT_MAX_10_EXP 38 38 DBL_MANT_DIG 53 53 DBL_EPSILON 2.2204460492503131E-16 2.2204460492503131E-16 DBL_DIG 15 15 DBL_MIN_EXP 1021 1021 DBL_MIN 2.2250738585072014E-308 2.2250738585072014E-308 DBL_MIN_10_EXP 307 307 DBL_MAX_EXP 1024 1024 DBL_MAX 1.7976931348623157E+308 1.7976931348623157E+308 DBL_MAX_10_EXP 308 308 LDBL_MANT_DIG 53 113 LDBL_EPSILON 2.2204460492503131E-16L 1.925929944387235853055977942584927319E-34L LDBL_DIG 15 33 LDBL_MIN_EXP 1021 16381 LDBL_MIN 2.2250738585072014E-308L 3.362103143112093506262677817321752603E-4932L LDBL_MIN_10_EXP 307 4931 LDBL_MAX_EXP 1024 16384 LDBL_MAX 1.7976931348623157E+308L 1.189731495357231765085759326628007016E+4932L LDBL_MAX_10_EXP 308 4932 <limits.h> The system defines limits as follows:

                             c Copyright 2005  2019, Portugal Futurista, all rights reserved.
                                                                                                                    19

Runtime Invariant Values

Symbol Value

DELAYTIMER_MAX INT_MAX HOST_NAME_MAX _POSIX_HOST_NAME_MAX MQ_OPEN_MAX (undefined) a MQ_PRIO_MAX _POSIX_MQ_PRIO_MAX OPEN_MAX (undefined) b PAGE_SIZE 4096 PAGESIZE PAGE_SIZE PTHREAD_DESTRUCTOR_ITERATIONS _POSIX_THREAD_DESTRUCTOR_ITERATIONS PTHREAD_KEYS_MAX _POSIX_THREAD_KEYS_MAX PTHREAD_STACK_MIN (undefined) c PTHREAD_THREADS_MAX (undefined) d RTSIG_MAX 32 SEM_NSEMS_MAX (undefined) e SEM_VALUE_MAX INT_MAX SIGQUEUE_MAX _POSIX_SIGQUEUE_MAX TIMER_MAX _POSIX_TIMER_MAX TZNAME_MAX _POSIX_TZNAME_MAX

a Indeterminate, depends on configuration parameter and number of available file descriptors. b Indeterminate, depends on configuration parameter. c Indeterminate, limited by configuration parameter. d Indeterminate, either only limited by available memory or limited by configured number of threads. e Indeterminate, only limited by available memory for unnamed semaphores and limited by configured number for named semaphores.

Pathname Variable Values

Symbol Value

NAME_MAX _POSIX_NAME_MAX PATH_MAX _POSIX_PATH_MAX

                                c Copyright 2005  2019, Portugal Futurista, all rights reserved.

20

Numerical Limits

Symbol Value

CHAR_BIT 8 CHAR_MAX 127 CHAR_MIN 0 INT_MAX 2147483647 INT_MIN (-INT_MAX-1) LLONG_MAX 9223372036854775807LL LLONG_MIN (-LLONG_MAX-1) LONG_BIT 32 LONG_MAX 2147483647L LONG_MIN (-LONG_MAX-1) MB_LEN_MAX 6 SCHAR_MAX 127 SCHAR_MIN (-SCHAR_MAX-1) SHRT_MAX 32767 SHRT_MIN (-SHRT_MAX-1) SSIZE_MAX INT_MAX UCHAR_MAX 255 UINT_MAX 4294967295 ULLONG_MAX 18446744073709551615LL ULONG_MAX 4294967295L USHRT_MAX 65535 WORD_BIT 32 <math.h> Types float_t and double_t are defined as follows:

 Type     PowerPC    SPARC       x86 64-Bit    ARM 32-Bit        ARM 64-Bit

float_t float float double float float double_t double double doule double double The compiler used for UniversalisOS development ignores the FP_CONTRACT pragma. The behavior is as if the pragma were set to OFF, except for PPC/OEA where option -mno-fused-madd needs to be passed during compilation. <signal.h> Realtime signal behavior is supported for any signal. For those signals outside the range SIGRTMIN through SIGRTMAX where realtime signal behavior is not the default, a signal action with the SA_SIGINFO flag set has to be installed to enable signal queuing. Signals that can not be caught or ignored are an exception to this, and are never queued. In addition to the signals described by IEEE Std 1003.1-2001 the implementation defines the SIGIO signal. The default signal action for SIGIO is to ignore the signal. This implementation does not support job control, the signals related to job control are not defined.

                               c Copyright 2005  2019, Portugal Futurista, all rights reserved.
                                                                                       21

<stdint.h> The <stdint.h> header defines the following limits for the required data types:

Data type lower limit upper limit

int8_t -128 127 uint8_t 0 255 int_least8_t -128 127 uint_least8_t 0 255 int16_t -32768 32767 uint16_t 0 65535 int_least16_t -32768 32767 uint_least16_t 0 65535 int32_t -2147483648 2147483647 uint32_t 0 4294967295 int_least32_t -2147483648 2147483647 uint_least32_t 0 4294967295 int64_t -9223372036854775808 9223372036854775807 uint64_t 0 18446744073709551615 int_least64_t -9223372036854775808 9223372036854775807 uint_least64_t 0 18446744073709551615 The <stdint.h> header additionally defines the following macros:

#define SIG_ATOMIC_MIN INT32_MIN #define SIG_ATOMIC_MAX INT32_MAX

#define PTRDIFF_MIN INT32_MIN #define PTHDIFF_MAX INT32_MAX

#define SIG_ATOMIC_MIN (-(INT_MAX) - 1) #define SIG_ATOMIC_MAX _(INT_MAX)

#define PTRDIFF_MIN (-(LONG_MAX) - 1L) #define PTHDIFF_MAX _(LONG_MAX)

                             c Copyright 2005  2019, Portugal Futurista, all rights reserved.
  Part II

System Interfaces

    22

2 General Information

2.3 Error Numbers

This implementation adds the following error code besides those defined in IEEE Std 1003.1-2001 Section 2.3:

Error code Description

ENOKMEM Insufficient UniversalisOS kernel memory available to perform operation. UniversalisOS kernel memory is for example re- quired to create native threads (eg DDAPI threads).

2.4 Signal Concepts

2.4.1 Signal Generation and Delivery

Signals for which realtime behavior is not enabled and which are generated for the process, can be delivered or accepted more than once. This situation occurs when the signal is generated again before the thread chosen for signal delivery or acceptance was not yet chosen to run according to its scheduling policy. The system generates the following signals as a notification to the user: SIGALRM on an expiring alarm set by the user These synchronous signals are generated for the thread which caused a processor exception detected by the UniversalisOS kernel: SIGILL on an illegal instruction SIGTRAP on a trap exception SIGFPE on a floating point error SIGBUS on a bus error SIGSEGV on a segmentation fault SIGSYS on a bad system call exception from the UniversalisOS kernel The system does not deliver signals to threads blocked in a call to pthread_join() or waiting on a mutex. Sig- nals generated for those threads by calls to pthread_kill() will remain pending until the thread will eventually be allowed to continue.

                            c Copyright 2005  2019 Portugal Futurista GmbH, all rights reserved.

24

2.4.2 Realtime Signal Generation and Delivery

Realtime signals are supported as specified in the section 2.4.2 of the IEEE Std 1003.1-2001. In addition to signals for which realtime signal behavior is required, signal queuing can be enabled for other signals (except signals than can not be caught or ignored) by setting the SA_SIGINFO flag for the signal. If a queuable signal is generated by a call other than sigqueue() and the queue for that signal is empty, the signal is made pending but no additional information is queued. This forces the system to forge the additional information for the signal handler. The system will set the additional data to 0. If the queueable signal generated by any other call than sigqueue() but there are signals already queued the call has no effect since the signal is already pending. This implementation does not support any additional notification mechanisms other than those specified in section 2.4.2 of the IEEE Std 1003.1-2001. On usage of a notification function called in a dedicated thread (SIGEV_THREAD option) this thread is not allowed to process any signal (i.e. the thread has a completely filled signal mask). Signals are generated exclusively by the functions and events specified in IEEE Std 1003.1-2001 section 2.4.1. No other signal source is supported besides that. The si_code values specified in section 2.4.3 in IEEE Std 1003.1-2001 are supported. No other values are supported. SI_USER for any signal generated by any nonqueuing signal generating function call. SI_QUEUE for a signal generated by a call to sigqueue(). SI_TIMER for a signal caused by the expiration of a timer. SI_MESGQ for a signal generated by an event caused by the changing of states in a message queue. Since the AIO Option is not supported SI_ASYNCIO is not supported and will never be set in signal data.

2.5 Standard I/O Streams

The file position indicator is initially positioned at the end of the file when a file is opened in append mode. The implementation supports unbuffered and fully buffered streams.

2.5.1 Interaction of File Descriptors and Standard I/O Streams

Since this implementation is a single-process environment, there are no special consideration to be taken for I/O operations on a shared file descriptor across the invocation of exec().

2.5.2 Stream Orientation and Encoding Rules

I/O streams can be byte-oriented or wide-oriented. The implementation does not include support file for loadable locales, the use of wide-oriented streams and multibyte functions is discouraged.

                               c Copyright 2005  2019, Portugal Futurista, all rights reserved.
                                                                                                                   25

2.8 Realtime

2.8.3 Memory Management

The implementation does not support demand paging, thus the translation between virtual addresses and physical addresses of the applications text, data, and bss segments is always fixed. The memory locking functions will have no effect on this relation. In dynamic heap mode, heap memory will be allocated on demand from the PSSW, and depending on the memory use pattern of the application, the same virtual addresses may correspond to different physical memory regions during the applications lifetime. The same applies for objects mapped dynamically by the application (e.g. shared memory). The memory locking functions will have no effect on heap memory locations or dynamically mapped objects.

2.8.4 Process Scheduling

Threads with the SCHED_OTHER scheduling policy are treated in the same way as those with the SCHED_RR policy, with the only difference of the different default time slice. For further details on scheduling policies, refer to 4.13.

2.8.5 Clocks and Timers

The resolution for the CLOCK_REALTIME clock is derived from the tick configured for the POSIX application. The clocks value is derived from the UniversalisOS system time. Time services and timers using this clock all have the same resolution.

2.9.4 Thread Scheduling

Threads with SCHED_OTHER scheduling policy have an additional scheduling attribute defining the time slice allocated for the thread. It is stored in the sched_quantum member of a struct sched_param object and can be read and written using functions taking such an object as parameter. The only supported scheduling contention scope is PTHREAD_SCOPE_PROCESS. The implementation uses one kernel entity for application thread code execution. Application threads are multiplexed on this kernel object based on their scheduling policy and thread state (runnable, running, blocked). The kernel object runs at a configurable UniversalisOS priorities which can not be modified during the applications lifetime. POSIX thread priorities have no meaning outside the UniversalisOS process in which the application program runs. However, UniversalisOS native threads created through the DDAPI interface are directly scheduled by the UniversalisOS scheduler and thus underlie UniversalisOS kernel scheduling policies. The implementation assumes an uniprocessor system and supports one allocation domain. The following scheduling policies are supported: SCHED_FIFO First in, first out (FIFO) scheduling policy. SCHED_RR Round robin scheduling policy. SCHED_OTHER Another scheduling policy. The sporadic server scheduling policy (SCHED_SPORADIC) is not supported.

                               c Copyright 2005  2019, Portugal Futurista, all rights reserved.

26

The number of priorities supported by the implementation is a tuneable parameter. The full priority range is supported for all scheduling policies. A thread whose scheduling policy is set to SCHED_OTHER will not be distinguishable in its behavior from any other thread with SCHED_RR policy, except that its quantum (the number of ticks the CPU is assigned to this thread at once) is variable.

2.11 Tracing

Tracing as specified by IEEE Std 1003.1-2001 is not supported.

                             c Copyright 2005  2019, Portugal Futurista, all rights reserved.

Part III

XSH

27 28

This section contains the required clarifications and information on behavior unspecified by the standard. For a detailed description of each function contained in this part refer to the standard. (Section numbers in this part do not relate to the section numbers in the SUSv3 documentation)

                            c Copyright 2005  2019, Portugal Futurista, all rights reserved.

20 System Interfaces

20.1 acos, acosf

If the given argument is not in the range [1, 1] the functions return NaN. If the given argument is +-Inf, the functions return NaN.

20.2 acosh, acoshf

If the given argument is smaller than 1 (x < 1) the return value is NaN. If the given argument is -Inf the return value is NaN.

20.3 asin, asinf

If the given argument is not in the range [1, 1] the functions return NaN. If the given argument is +-Inf, the functions return NaN.

20.4 atanh, atanhf

If |x| is greater than 1 (|x| > 1) the functions return NaN. If the given argument is +-Inf, the functions return NaN.

20.5 calloc

If one of the parameters is zero the function returns the NULL pointer.

                            c Copyright 2005  2019 Portugal Futurista GmbH, all rights reserved.

30

20.6 chmod

20.7 clock getres

By default, the only supported clock is CLOCK_REALTIME. The clocks value is derived from the UniversalisOS system time. Timers based on CLOCK_REALTIME are driven off the POSIX system tick (for further details refer to section 3.97), thus the resolution of the clock is defined as one tick. Additional clock sources can be added by the user (refer to UniversalisOS Personality Manual: POSIX for further details). When a timers associated with an additional clocks is armed, its expiration time is calculated in terms of clock ticks based on this particular clocks resolution (effectively a relative time). When the clocks time is changed with clock_settime() the previously calculated expiration tick count remains unchanged. Armed process timers associated with a clock other than CLOCK_REALTIME are not adjusted when clock_settime() is called for the clock. Calling clock_settime() on any valid clock does not require appropriate privileges.

20.8 cos, cosf

If the given argument is Inf, the function returns NaN.

20.9 erfc, erfcf

If the function result underflows and produces an unrepresentable value, the return value is 0.0.

20.10 exit, exit, Exit

A call to _exit() or _Exit() will cause open streams to be flushed if the underlying file system layer supports this. The implementation defines additional status codes which can be passed as arguments to these functions: Code System behavior

EXIT_SHUTDOWN Halt/shutdown the partition EXIT_SUCCESS same as EXIT_SHUTDOWN EXIT_FAILURE same as EXIT_SHUTDOWN EXIT_REBOOT Restart the partition EXIT_TERMINATE Terminate UniversalisOS task. Note: This leads to a task termination event in the PSSW health monitor.

20.11 exp, expf

If the result underflows and is not representable a range error will occur and the function returns 0.0.

20.12 exp2, exp2f

If the result underflows and is not representable a range error will occur and the function returns 0.0.

                              c Copyright 2005  2019, Portugal Futurista, all rights reserved.
                                                                                                                  31

20.13 fcntl

The only fcntl() commands supported by the implementation are F_GETFL and F_SETFL.

20.14 fdim, fdimf

If the result underflows and is not representable the function returns 0.0, a range error will not occur.

20.15 fflush

If write() fails during the operations performed by fflush(), an [EIO] error may be returned depending on the underlying file system layer.

20.16 fgetc

If read() fails during the operations performed by fgetc(), an [EIO] error may be returned depending on the underlying file system layer.

20.17 fgetwc

If read() fails during the operations performed by fgetwc(), an [EIO] error may be returned depending on the underlying file system layer.

20.18 fma, fmaf

If x times y is an exact infinity, and z is also an infinity but with the opposite sign of x times y, the function return value will be a NaN. If one of x and y is infinite, the other is zero, and z is not a NaN, the function return value will be a NaN.

20.19 fmod, fmodf

If x is infinite, the function return value is a NaN. If y is zero, the function return value is a NaN. If the result underflows no range error occurs.

20.20 fprintf

With the p conversion specifier, pointer values will be converted to a sequence of hexadecimal characters with "0x" prefix (as for "0x%x"). formatted as "inf" or "-inf", depending on the sign. With the f conversion specifier, infinity values will be formatted as "inf" or "-inf", depending on the sign.

                                c Copyright 2005  2019, Portugal Futurista, all rights reserved.

32

With the F conversion specifier, infinity values will be formatted as "INF" or "-INF", depending on the sign. With the f conversion specifier, NaN values will be formatted as "nan". With the F conversion specifier, NaN values will be formatted as "NAN".

20.21 fputc

If write() fails during the operations performed by fputc(), an [EIO] error may be returned depending on the underlying file system layer.

20.22 fputwc

If write() fails during the operations performed by fputwc(), an [EIO] error may be returned depending on the underlying file system layer.

20.23 freopen

Mode change is supported in these cases:

 • Streams originally opened with mode “r” can only be reopened with that same mode.

 • Streams originally opened with mode “a” can be reopened with the same mode, or mode “w”.

 • Streams originally opened with mode “w” can be reopened with the same mode, or mode “a”.

 • Streams originally opened with mode “r+”, “w+”, or “a+” can be reopened with any mode.

20.24 fscanf

In a scanlist, the hyphen character - is special; when placed between two other characters, it adds all intervening characters to the set. To include a hyphen, make it the last character before the final close bracket. For the p conversion specifier numerical digits (0-9) and hexadezimal characters (a-f, A-F) are accepted. The input value is always interpreted as hexadecimal value, the "0x" prefix is not required.

20.25 fseek

If this function is used on a device which does not support seeking, an [EINVAL] error is returned. If the underlying file system layer calls the PSSW function vm_seek(), and the communication with the PSSW function fails, an [EIO] error may be generated.

20.26 fsetpos

If this function is used on a device which does not support seeking, an [EINVAL] error is returned. If the underlying file system layer calls the PSSW function vm_seek(), and the communication with the PSSW function fails, an [EIO] error may be generated.

                             c Copyright 2005  2019, Portugal Futurista, all rights reserved.
                                                                                                            33

20.27 fsync

When fsync() is called, it is dependenp on the underlying file system layer what data is written. When called for file descriptions associated with PSSW resources, fysnc() is ignored.

20.28 ftruncate

The implementation does not support ftruncate() on file descriptors obtained by calls to shm_open(). Shared memory areas always refer to VMIT defined shared memory regions which are predefined by the PSSW and can not be sized at run-time. The size of a shared memory area can be determined using stat() which will store the size in the st_size member of struct stat.

20.29 kill

This is a single-process implementation, the process ID of the current process can be inquired using getpid(). If the process ID passed to this function is zero, -1, or the negative return value of getpid(), the signal will be generated for the current process. There arent any other constraints about signal number and process IDs except those described in IEEE Std 1003.1-2001 and section 2.4 of this document.

20.30 ldexp, ldexpf

In case of an underflow error 0.0 is returned.

20.31 log, logf

If the function argument x is less than zero or x is -Inf, the functions return a NaN.

20.32 log10, log10f

If the function argument x is less than zero or x is -Inf, the functions return a NaN.

20.33 log1p, log1pf

If the function argument x is less than 1 or x is -Inf, the functions return a NaN.

20.34 log2, log2f

If the function argument x is less than zero or -Inf, the functions return a NaN.

                              c Copyright 2005  2019, Portugal Futurista, all rights reserved.

34

20.35 longjmp

If longjmp() is called form a nested signal handler the system will leave all handlers and continue at the provided point by the jmp_buf argument. The longjmp() function does not call thread cancellation cleanup handlers that have been pushed but not popped since the time setjmp() was called. The longjmp() function leaves the signal mask unchanged.

20.36 lseek

If this function is used on a device which does not support seeking, an [EINVAL] error is returned.

20.37 malloc

If the requested size is zero a unique, non-NULL pointer will be returned.

20.38 mkdir

Any additional bits in the mode argument passed in calls to mkdir() are interpreted by the underlying file system implementation.

20.39 mlock, mlockall, munlock, munlockall

This functions is supported formally but not functional. This means it is present in the POSIX personality but the memory will not be locked after a call to this function (refer to section 2.8.3 for further details).

20.40 mmap

This function is only supported for shared memory objects. If the value for addr passed in the call is non-zero, the function always acts as if MAP_FIXED is set. addr is always interpreted as virtual address. Note: This may change in future releases. Shared memory segments are provided by the PSSW and can not be dynamically created. The memory backing the shared memory segments is allocated by the PSSW at system startup time, and will be mapped by the PSSW into the applications address space whenever the user calls mmap() for a segment. The number of shared memory regions is limited by the tuneable parameter num_of_shm. The number of memory mappings is only limited by the size and usage of the shared memory pool (tuneables shm_pool_addr and shm_pool_size).

                             c Copyright 2005  2019, Portugal Futurista, all rights reserved.
                                                                                                              35

20.41 mq open

Message queues are a communication concept for sharing information inside a POSIX personality. This imple- mentation does not support communication over message queues with any other personality or device outside the same instance of the POSIX personality. The name provided by the user must be a valid path name containing no more than PATH_MAX characters. Any component in this path name must not be longer than NAME_MAX characters. Adjacent slashes in the path name argument will be squashed into single slashes by the function. Apart from these restrictions, the message queue name is arbitrary. In particular, there are no forbidden characters and the message queue name need not begin with a slash and need not refer to an existing file. If the flags provided in oflags contain bits not recognized or relevant to this call those bits are ignored. If the call is used to create a message queue and the user does not provide any attributes along with the call the system will use the default values for message queue creation. The default attributes for message size and number of messages are tuneable parameters (mq_max_msg_len, mq_max_msgs). Message queue descriptors are mapped to file descriptors, each successful call to mq_open consumes a file descriptor. Although the message queues do not appear in the file system, at least function fstat() is supported on message queue descriptors. Upon successful return from fstat(), the following members of struct stat are valid:

st_mode Contains the message queue access modes and the S_IFMQ flag to show the descriptor is associated with a message queue. The macro S_TYPEISMQ() is provided to check the S_IFMQ flag.

st_blocks Maximum message count of the message queue.

st_blksize Maximum message size of the message queue.

st_size Current message count in the message queue.

20.42 mq receive

If msg_len is greater than {SSIZE_MAX} the function will not treat this condition as an error and proceed with message reception.

20.43 mq setattr

There are no implementation-defined flags returned in mq_flags.

20.44 nan, nanf

The functions copy n-char sequences into the payload of the returned NaN value. n-char sequences are interpreted as hexadecimal numbers, regardless of the presence of a preceding "0x" or "0X". A n-char sequence is invalid if there are white spaces or special characters (except the terminating null character) in any position. The behavior is undefined if a n-char sequence contains more bits than the NaN payload in the destination format.

                              c Copyright 2005  2019, Portugal Futurista, all rights reserved.

36

20.45 open

Handling of O_TRUNC depends on the underlying file system layer. The O_TRUNC flag is not supported for any of the file system layers used for PSSW access.

20.46 pow, powf

When called with finite values of x that are less than zero and finite non-integer values of y , the functions return a NaN. In case of an underflow error 0.0 is returned.

20.47 pthread atfork

Since this is a single-process implementation, this function is supported as a no-op, it will always return success.

20.48 pthread attr destroy

After the attribute is destroyed the value of attr is set to NULL. pthread_attr_destroy() does detect the [EINVAL] condition, if the value specified by attr does not refer to an initialized thread attribute object.

20.49 pthread attr getdetachstate, pthread attr setdetachstate

The functions do detect the [EINVAL] condition, with respect to the functions attribute object argument.

20.50 pthread attr getguardsize, pthread attr setguardsize

The implementation will round up the stack guardsize to a multiple of {PAGESIZE}. The functions do detect the [EINVAL] condition, with respect to the functions attribute object argument.

20.51 pthread attr getinheritsched, pthread attr setinheritsched

The functions do detect the [EINVAL] condition, with respect to the functions attribute object argument. pthread_attr_setinheritsched() detects the [EINVAL] condition, with respect to the functions inher- itsched argument. pthread_attr_setinheritsched() does not return an [ENOTSUP] error for other values for inheritsched than the supported ones.

20.52 pthread attr getschedparam, pthread attr setschedparam

The functions do detect the [EINVAL] condition, with respect to the functions attribute object argument.

                              c Copyright 2005  2019, Portugal Futurista, all rights reserved.
                                                                                                        37

20.53 pthread attr getschedpolicy, pthread attr setschedpolicy

The functions do detect the [EINVAL] condition, with respect to the functions attribute object argument.

20.54 pthread attr getscope, pthread attr setscope

The functions do detect the [EINVAL] condition, with respect to the functions attribute object argument. pthread_attr_setscope() detects the [EINVAL] condition, with respect to the functions contentionscope argument. pthread_attr_setscope() detects the [ENOTSUP] condition, with respect to the functions contentionscope argument. The implementation does only support the PTHREAD_SCOPE_PROCESS contention scope.

20.55 pthread attr getstack, pthread attr setstack

{PTHREAD_STACK_MIN} is the value of tuneable parameter pthread_stack_min. The functions do detect the [EINVAL] condition, with respect to the functions attribute object argument. The pthread_attr_setstack() function does detect the [EINVAL] condition, with respect to the functions stackaddr argument. The stack base address must be aligned to {PAGESIZE}. The pthread_attr_setstack() function does detect the [EINVAL] condition, with respect to the functions stacksize argument. The stack size must be a multiple of {PAGESIZE}.

20.56 pthread attr getstackaddr, pthread attr setstackaddr

{PTHREAD_STACK_MIN} is the value of tuneable parameter pthread_stack_min. The functions do detect the [EINVAL] condition, with respect to the functions attribute object argument. The pthread_attr_setstackaddr() function fails with an [EINVAL] condition, if the functions stackaddr argument is not {PAGESIZE} aligned.

20.57 pthread attr getstacksize, pthread attr setstacksize

{PTHREAD_STACK_MIN} is the value of tuneable parameter pthread_stack_min. The functions do detect the [EINVAL] condition, with respect to the functions attribute object argument. The pthread_attr_setstack() function fails with an [EINVAL] condition, if the functions stacksize argu- ment is not a multiple of {PAGESIZE}.

20.58 pthread attr init

The default values for a pthread_attr_t object are as follows:

                             c Copyright 2005  2019, Portugal Futurista, all rights reserved.

38

Attribute Default value

thread stack size tuneable parameter pthread_default_stack_size thread stack allocated by the system thread stack guardsize tuneable parameter pthread_default_guard_size inheritsched attribute PTHREAD_INHERIT_SCHED thread priority tuneable parameter pthread_default_priority scheduling policy SCHED_RR scheduling quantum tuneable parameter sched_other_quantum_ticks Note that this value will only be valid if SCHED_OTHER and PTHREAD_EXPLICIT_SCHED will be set for the attribute object detach state PTHREAD_CREATE_JOINABLE contention scope PTHREAD_SCOPE_PROCESS The function does not detect the [EBUSY] condition, with respect to pthread_attr_init() being called for an already initialized attributes object. Ths implementation adds the time slice for threads with SCHED_OTHER scheduling policy as additional thread attribute parameter. The time slice is stored a struct timespec and can be accessed using pthread_attr_getschedquantum_np() and pthread_attr_setschedquantum_np().

#include <pthread.h>

int pthread_attr_getschedquantum_np(const pthread_attr_t *attr, struct timespec *tq); int pthread_attr_setschedquantum_np(pthread_attr_t attr, const struct timespec *tq);

The functions are described in the UniversalisOS Personality Manual: POSIX .

20.59 pthread cancel

The function does detect the [ESRCH] condition, with respect to the functions thread argument.

20.60 pthread cleanup pop, pthread cleanup push

These functions are not implemented as macros. Function pthread_cleanup_push() may fail if insufficient heap memory is available. This condition is not visible to the user, since the call is defined as a void function.

20.61 pthread cond broadcast, pthread cond signal

The pthread_cond_signal() and pthread_cond_broadcast() functions do not detect the [EINVAL] condition.

20.62 pthread cond destroy, pthread cond init

The pthread_cond_init() function does detect the [EINVAL] condition, with respect to the functions attr argument.

                            c Copyright 2005  2019, Portugal Futurista, all rights reserved.
                                                                                                   39

The pthread_cond_init() and pthread_cond_destroy() functions do not detect the [EBUSY] condition, with respect to the functions cond argument. Upon successful return function pthread_cond_destroy() sets the value of cond to NULL. The pthread_cond_destroy() function does not detect the [EINVAL] condition, with respect to the functions cond argument. The pthread_cond_destroy() function does detect the [EBUSY] condition, with respect to the functions cond argument.

20.63 pthread cond timedwait, pthread cond wait

The pthread_cond_wait() and pthread_cond_timedwait() functions do detect the [EPERM] condition, with respect to the functions mutex argument.

20.64 pthread condattr init, pthread condattr destroy

The implementation supports no additional attributes or functions.

20.65 pthread condattr getpshared, pthread condattr setpshared

The implementation does not support the PTHREAD_PROCESS_SHARED attribute. Trying to set the attribute to PTHREAD_PROCESS_SHARED will yield an [ENOTSUP] error. The functions do detect the [EINVAL] condition, with respect to the functions attr argument.

20.66 pthread create

The default thread attributes used when NULL is passed as value for the attr argument are: Attribute Default value

thread stack size tuneable parameter pthread_default_stack_size thread stack allocated by the system thread stack guardsize tuneable parameter pthread_default_guard_size inheritsched attribute PTHREAD_INHERIT_SCHED thread priority inherited from calling thread scheduling policy inherited from calling thread detach state PTHREAD_CREATE_JOINABLE contention scope PTHREAD_SCOPE_PROCESS In this implementation {PTHREAD_THREADS_MAX} is limited only by the memory available to the application process. The function does detect the [EINVAL] condition, with respect to the functions attr argument.

                             c Copyright 2005  2019, Portugal Futurista, all rights reserved.

40

20.67 pthread detach

Multiple pthread_detach() calls for the same thread issued in parallel have no user-visible differences from sequential calls. The function does detect the [ESRCH] condition, with respect to the functions thread argument.

20.68 pthread getschedparam, pthread setschedparam

In the case where the scheduling policy is set to SCHED_OTHER the system behaves like if the SCHED_RR scheduling policy would have been set. The SCHED_OTHER policy additionally allows the quantum to vary for every thread, whilst the SCHED_RR scheduling policy uses the same value and so the same amount of cpu time for every thread. This means all time slices are equal in quantity of time a thread gets the processor assigned where with the SCHED_OTHER policy every thread can have an adapted time slice of its own. The struct sched_param is defined as follows:

struct sched_param { int sched_priority;

 /* Non-POSIX: */
 int sched_eff_priority_np;                          /* Influenced by mutexes held. */

};

Structure Member Description

sched_priority scheduling priority as defined by IEEE Std 1003.1-2001 sched_eff_priority_np effective scheduling priority, will be different from sched_priority when mutexes with PTHREAD_PRIO_PROTECT or PTHREAD_PRIO_INHERIT are held. Ths implementation adds the time slice for threads with SCHED_OTHER scheduling policy as additional thread scheduling parameter. The time slice is represented with a struct timespec and can be accessed using pthread_getschedquantum_np() and pthread_setschedquantum_np(). The functions are described in the UniversalisOS Personality Manual: POSIX . The functions do detect the [ESRCH] condition, with respect to the functions thread argument. Function pthread_setschedparam() detects the [EINVAL] condition, with respect to the functions policy and scheduling parameter (sched_priority) argument.

20.69 pthread getspecific, pthread setspecific

pthread_key_t objects are an index into an array reserved for thread specific data. A key is invalid if its value is larger or equal to {PTHREAD_KEYS_MAX}. Function pthread_getspecific() will return NULL, if it is called with an invalid key value or a key value not obtained from pthread_key_create(). If it is called with a valid key value which has previously been deleted with pthread_key_delete(), it will return the last value stored with the key. Function pthread_getspecific() will return [EINVAL], if it is called with an invalid key value. If it is called with a valid key value, it will return zero, even if it was not obtained from pthread_key_create().

                             c Copyright 2005  2019, Portugal Futurista, all rights reserved.
                                                                                                        41

20.70 pthread join

When multiple simultaneous calls to pthread_join() are blocked waiting for the joinee to exit, all threads will bw unblocked and return the value the joinee passed to pthread_exit(). A thread that has exited but remains unjoined counts against {PTHREAD_THREADS_MAX}. Function pthread_join() detects the [EINVAL] condition, with respect to the functions thread argument. Function pthread_join() detects the [EDEADLK] condition, with respect to the functions thread argument.

20.71 pthread key create, pthread key delete

pthread_key_t objects are an index into an array reserved for thread specific data. Destructors are called in the order of increasing key values. If, after all the destructors have been called for all non-NULL values with associated destructors, there are still some non-NULL values with associated destructors, then the process is repeated for at most {PTHREAD_DESTRUCTOR_ITERATIONS} times. The implementation supports a limited (PTHREAD_KEYS_MAX) number of thread-specific data keys. Thread specific data keys will not be used again once they are deleted with pthread_key_delete().

20.72 pthread mutex destroy

After the mutex is destroyed the value of mutex is set to NULL. pthread_mutex_destroy() does detect the [EBUSY] condition, with respect to the functions mutex argu- ment. pthread_mutex_destroy() does detect the [EINVAL] condition, with respect to the functionss mutex argu- ment.

20.73 pthread mutex getprioceiling, pthread mutex setprioceiling

The calling thread must adhere to the priority protection protocol for function pthread_mutex_setprioceiling() to succeed. If the calling threads priority is higher than the mu- texs current prioceiling value, an error [EINVAL] is returned. The functions do detect the [EINVAL] condition, with respect to the functionss mutex argument. Function pthread_mutex_setprioceiling() detects the [EINVAL] condition, with respect to the functions prioceiling argument. pthread_mutex_setprioceiling() does detect the [EINVAL] condition, with respect to the functionss mutex argument.

20.74 pthread mutex init

The functions do detect the [EINVAL] condition, with respect to the functionss attr argument. The functions does not detect the [EBUSY] condition, with respect to the functionss mutex argument.

                             c Copyright 2005  2019, Portugal Futurista, all rights reserved.

42

20.75 pthread mutex lock

Mutex type PTHREAD_MUTEX_DEFAULT maps to PTHREAD_MUTEX_NORMAL. The function does detect the [EINVAL] condition, if the functions mutex argument refers to an uninitialized mutex. For mutex type PTHREAD_MUTEX_RECURSIVE, the function does detect the [EAGAIN] condition, with respect to the functionss mutex argument.

20.76 pthread mutex timedlock

Mutex type PTHREAD_MUTEX_DEFAULT maps to PTHREAD_MUTEX_NORMAL. The function does detect the [EINVAL] condition, if the functions mutex argument refers to an uninitialized mutex. For mutex types other than PTHREAD_MUTEX_RECURSIVE, the function does detect the [EBUSY] condition, with respect to the functionss mutex argument. For mutex type PTHREAD_MUTEX_RECURSIVE, the function does detect the [EAGAIN] condition, with respect to the functionss mutex argument. For mutex type PTHREAD_MUTEX_ERANGE, the function does detect the [EDEADLK] condition, with respect to the functionss mutex argument.

20.77 pthread mutex trylock

Mutex type PTHREAD_MUTEX_DEFAULT maps to PTHREAD_MUTEX_NORMAL. The function does detect the [EINVAL] condition, if the functions mutex argument refers to an uninitialized mutex. For mutex type PTHREAD_MUTEX_RECURSIVE, the function does detect the [EAGAIN] condition, with respect to the functionss mutex argument.

20.78 pthread mutex unlock

Mutex type PTHREAD_MUTEX_DEFAULT maps to PTHREAD_MUTEX_NORMAL. The function does detect the [EINVAL] condition, if the functions mutex argument refers to an uninitialized mutex. For all mutex types, the function does detect the [EPERM] condition, if the mutex is currently unlocked or locked by another thread.

20.79 pthread mutexattr destroy

After the attribute is destroyed the value of attr is set to NULL. pthread_mutexattr_destroy() does detect the [EINVAL] condition, if the value specified by attr does not refer to an initialized mutex attribute object.

                              c Copyright 2005  2019, Portugal Futurista, all rights reserved.
                                                                                                               43

20.80 pthread mutexattr getprioceiling, pthread mutexattr setprioceiling

The functions do detect the [EINVAL] condition, if the value specified by attr does not refer to an initialized mutex attribute object. Function pthread_mutexattr_setprioceiling() detects the [EINVAL] condition, with respect to the functions prioceiling argument.

20.81 pthread mutexattr getprotocol, pthread mutexattr setprotocol

The implementation supports all three mutex protocols defined by the standard. The functions do detect the [EINVAL] condition, if the value specified by attr does not refer to an initialized mutex attribute object. Function pthread_mutexattr_setprotocol() detects the [EINVAL] condition, with respect to the func- tions protocol argument.

20.82 pthread mutexattr getpshared, pthread mutexattr setpshared

The implementation does not support the PTHREAD_PROCESS_SHARED attribute. Trying to set the attribute to PTHREAD_PROCESS_SHARED will yield an [ENOTSUP] error. The functions do detect the [EINVAL] condition, if the value specified by attr does not refer to an initialized mutex attribute object.

20.83 pthread mutexattr gettype, pthread mutexattr settype

The implementation supports all three mutex types defined by the standard. Mutex type PTHREAD_MUTEX_DEFAULT maps to PTHREAD_MUTEX_NORMAL. The functions do detect the [EINVAL] condition, if the value specified by attr does not refer to an initialized mutex attribute object.

20.84 pthread mutexattr init

The default values for a pthread_mutexattr_t object are as follows: Attribute Default value

type PTHREAD_MUTEX_DEFAULT protocol PTHREAD_PRIO_NONE Calling pthread_mutexattr_init() with an already initialized mutex attribute object as function argument will cause a memory leak but not necessarily an error return.

                                c Copyright 2005  2019, Portugal Futurista, all rights reserved.

44

20.85 pthread once

The function does not detect the [EINVAL] condition, with respect to the functions once_control or init_routine arguments.

20.86 pthread rwlock destroy

The function detects the [EINVAL] condition, with respect to the functions read-write lock argument. The function detects the [EBUSY] condition, with respect to the functions read-write lock argument.

20.87 pthread rwlock init

The function does detect the [EINVAL] condition, with respect to the functionss attr argument. The function does not detect the [EBUSY] condition, with respect to pthread_rwlock_init() being called for an already initialized read-write lock object. The implementation additionally supports a macro PTHREAD_RWLOCK_INITIALIZER which can be used for static initialization of read-write lock objects.

20.88 pthread rwlock rdlock, pthread rwlock tryrdlock

The system supports up to INT_MAX read locks applied to one read-write lock. The functions detect the [EINVAL] condition, with respect to the functions read-write lock object argument. The functions detect the [EAGAIN] condition, with respect to the functions read-write lock object argument. The function detects the [EDEADLK] condition, if the current thread already owns the read-write lock object for writing. The function detects the [EBUSY] condition, if the read-write lock could not be acquired for reading because a writer with the appropriate priority was blocked on it. The behavior defined by the standard for the [TPS] option is not limited to threads with scheduling policies SCHED_FIFO and SCHED_RR but rather applies to all threads.

20.89 pthread rwlock timedrdlock

The behavior defined for pthread_rwlock_rdlock() by the standard for the [TPS] option is implemented for pthread_rwlock_timedrdlock() as well.

20.90 pthread rwlock unlock

When the read-write lock becomes available as a result of this call and there are both reader and writer waiting for the lock, then write locks take precedence over read locks. The function detects the [EINVAL] condition, with respect to the functions read-write lock argument. The function detects the [EPERM] condition, with respect to the functions read-write lock argument.

                             c Copyright 2005  2019, Portugal Futurista, all rights reserved.
                                                                                                                  45

20.91 pthread rwlock wrlock, pthread rwlock trywrlock

Function pthread_rwlock_wrlock() will cause a deadlock if the calling thread owns the read-write lock for reading. The function detects the [EINVAL] condition, with respect to the functions read-write lock argument. The function detects the [EDEADLK] condition, if the current thread already owns the read-write lock for writing.

20.92 pthread rwlockattr destroy

After the attribute is destroyed the value of attr is set to NULL. pthread_rwlockattr_destroy() does detect the [EINVAL] condition, if the value specified by attr does not refer to an initialized read-write lock attribute object.

20.93 pthread rwlockattr init

The implementation supports no additional attributes or functions.

20.94 pthread setcancelstate, pthread setcanceltype

The pthread_setcancelstate() function does detect the [EINVAL] condition. The pthread_setcanceltype() function does detect the [EINVAL] condition.

20.95 pthread setschedprio

The function does detect the [EINVAL] condition, with respect to the functions prio argument. The function does detect the [ESRCH] condition, with respect to the functions thread argument.

20.96 pthread sigmask

Synchronous signals generated by the exception handler (SIGFPE, SIGILL, SIGSEGV, or SIGBUS) are always delivered to the faulting thread, regardless of its thread signal mask.

20.97 read

The file system layer for device special files does not update the file position; it is up to the driver writer to update the file position and handle end-of-file conditions. If nbyte is greater than {SSIZE_MAX} an [EINVAL] error is returned. If the underlying file system layer calls the PSSW function vm_read(), and the communication with the PSSW function fails, an [EIO] error may be generated.

                                c Copyright 2005  2019, Portugal Futurista, all rights reserved.

46

20.98 remainder, remainderf

If x is infinite or y is zero and the other is non-NaN, the functions return NaN.

20.99 remquo, remquof

In this implementation n is an implementation-defined integer set to 0x7f .

20.100 scalbln, scalblnf, scalbn, scalbnf

In case of underflow the functions return the smallest representable number in the range requested (float or double) with the sign of x.

20.101 sched yield

The function never returns an error.

20.102 sem open

The name provided by the user must be a valid path name containing no more than PATH_MAX characters. Any component in this path name must not be longer than NAME_MAX characters. Adjacent slashes in the path name argument will be squashed into single slashes by the function. Apart from these restrictions, the semaphore name is arbitrary. In particular, there are no forbidden characters and the semaphore name need not begin with a slash and need not refer to an existing file. If the flags provided in oflags contain bits not recognized or relevant to this call those bits are ignored. Named semaphores are internally mapped to file descriptors. One open named semaphore consumes one file descriptor (no matter how often the semaphore was opened). The file descriptor value is not exposed to the caller.

20.103 sem init

This implementation does not support process shared semaphores. If the value of the pshared function argument is non-zero, the function will fail with an [EINVAL] condition.

20.104 sem destroy

The function detects the [EINVAL] condition, with respect to the functions sem argument. The function does not detect the [EBUSY] condition, with respect to the functions sem argument. Calling sem_destroy() upon which other threads are currentlu blocked will result in those threads to never unblock.

20.105 sem getvalue

If sem is locked, then the object to which sval points is set to zero.

                               c Copyright 2005  2019, Portugal Futurista, all rights reserved.
                                                                                                            47

The function detects the [EINVAL] condition, with respect to the functions sem argument.

20.106 sem post

The function detects the [EINVAL] condition, with respect to the functions sem argument. The function fails with an [EAGAIN] condition, if the call would increment the semaphore value past SEM_VALUE_MAX.

20.107 sem wait, sem trywait

The functions detect the [EINVAL] condition, with respect to the functions sem argument.

20.108 setjmp

The use of this function in a signal handler causes the application to halt with a fatal error.

20.109 setlocale

Supported values for the locale argument are "C" and "". The default native environment welected when locale is set to "" is "C".

20.110 shm open

Shared memory segments can not be created dynamically, in fact function shm_open() exclusively provides access to PSSW shared memory segments defined in the VMIT. The provided name is the name of the PSSW shared memory segment defined in the VMIT (i.e. without shm: prefix). The function fails with a [EINVAL] condition, if the O_CREAT or O_TRUNC bits are set in oflags. The maximum pathname length is limited by the PSSW constant VM_NAME_LEN.

20.111 shm unlink

This function always fails with an [EACCES] condition.

20.112 sigaction

If SA_SIGINFO is not set for a signal, subsequent occurrences of the signal when it is already pending are ignored. An attempt to set the action for a signal that cannot be caught or ignored to SIG_DFL causes an error to be returned with errno set to [EINVAL]. The third argument passed to a signal action (sa_sigaction) when SA_SIGINFO is set, is a pointer to the inter- rupted threads machine state defined in <ucontext.h> as follows:

                               c Copyright 2005  2019, Portugal Futurista, all rights reserved.

48

typedef unsigned int cpureg_t; typedef cpureg_t cpuregset_t[UC_NREGS];

/* Context to describe modifiable processor state. */ typedef struct { cpuregset_t regs; } mcontext_t;

/* Userlevel context. / typedef struct ucontext { / Pointer to the context that is resumed when this context * returns (unused on UniversalisOS). */ struct ucontext uc_link; / The set of signals that are blocked. / sigset_t uc_sigmask; / The stack used by this context. / stack_t uc_stack; / Misc. flag bits. / int uc_flags; #define UCF_READONLY (1<<0) / Machine-specific representation of the saved context. */ mcontext_t uc_mcontext; } ucontext_t;

The machine-specific context is only filled completely for synchronous signals generated as result of a processor exception (e.g. SIGSEGV, SIGILL, etc.). The context uc_mcontext is modifiable by the signal handler if uc_flags does not have the UCF_READONLY flag set. On the PowerPC architecture the following definitions can be used to access registers in the CPU register set:

Definition Register Definition Register UC_REG_PC Program counter (PC) UC_REG_R21 GPR21 UC_REG_SP Stack pointer (R1) UC_REG_R22 GPR22 UC_REG_LR Link register UC_REG_R23 GPR23 UC_REG_CR Condition register UC_REG_R24 GPR24 UC_REG_R14 GPR14 UC_REG_R25 GPR25 UC_REG_R15 GPR15 UC_REG_R26 GPR26 UC_REG_R16 GPR16 UC_REG_R27 GPR27 UC_REG_R17 GPR17 UC_REG_R28 GPR28 UC_REG_R18 GPR18 UC_REG_R29 GPR29 UC_REG_R19 GPR19 UC_REG_R30 GPR30 UC_REG_R20 GPR20 UC_REG_R31 GPR31

On the x86 architecture the following definitions can be used to access registers in the CPU register set:

                             c Copyright 2005  2019, Portugal Futurista, all rights reserved.
                                                                                                                  49

Definition Register Definition Register UC_REG_PC Program counter (EIP) UC_REG_GS Segment register GS UC_REG_SP Stack pointer (ESP) UC_REG_FS Segment register FS UC_REG_EAX GPR EAX UC_REG_ES Segment register ES UC_REG_EBX GPR EBX UC_REG_DS Segment register DS UC_REG_ECX GPR ECX UC_REG_CS Segment register CS UC_REG_EDX GPR EDX UC_REG_SS Segment register SS UC_REG_EBP GPR EBP UC_REG_EIP Instruction pointer EIP UC_REG_ESP GPR ESP (alias for UC_REG_PC) (alias for UC_REG_SP) UC_REG_EFLAGS Status and control register UC_REG_ESI GPR ESI UC_REG_EDI GPR EDI

On all other architecture the following definitions can be used to access registers in the CPU register set:

Definition Register UC_REG_PC Program counter UC_REG_SP Stack pointer

The function fails with an [EINVAL] condition, if an attempt was made to set the action to SIG_DFL for a signal that cannot be caught or ignored (or both).

20.113 sigaddset, sigdelset, sigismember

These functions do detect the [EINVAL] condition, with respect to the functions signo argument.

20.114 signal

When func points to a function and signal sig occurs, the system calls the installed signal handler and blocks the current signal until the handler returns. The signal action remains unchanged during the time the handler is executing. No additional signals are blocked if the handler is installed with signal(). The breakpoint instruction defined for the UniversalisOS architecture will cause a SIGTRAP signal to be generated for the current thread, unless the debugger enabled library version is used and the signal is routed to the debugger. An illegal UniversalisOS system call will cause a SIGSYS signal to be generated for the current thread. An arithmetic exception (e.g. integer division by zero), if detected by the architecture, will cause a SIGFPE signal to be generated for the current thread. A bus error, if detected by the architecture (UniversalisOS trap code P4_TRAP_BUS), will cause a SIGBUS signal to be generated for the current thread.

20.115 sigprocmask

Calling this function has the same effect as calling pthread_sigmask().

                              c Copyright 2005  2019, Portugal Futurista, all rights reserved.

50

20.116 sigsetjmp

The use of this function in a signal handler causes the application to halt with a fatal error.

20.117 sigtimedwait, sigwaitinfo

If a NULL pointer is provided as timeout, function sigtimedwait() will behave like sigwait(), i.e. wait with an infinite timeout and return when one of the signals in set becomes pending. If both realtime and non-realtime signals are pending, non-realtime signals are selected first. Note: This may change in future releases. Function sigtimedwait() does detect the [EINVAL] condition, with respect to the functions timeout argument.

20.118 sigwait

If there are multiple instances of the signal pending prior to the call to sigwait() only one instance will be processed and the rest will still be pending after the call returns. If both realtime and non-realtime signals are pending, non-realtime signals are selected first. Note: This may change in future releases. The function does not detect the [EINVAL] condition, with respect to the functions set argument.

20.119 sin, sinf

If the given argument is +-Inf, the functions return NaN.

20.120 sleep

The functions imlementation does not use the SIGALARM signal and is also independent of usleep().

20.121 sqrt, sqrtf

If x is less than zero or x is -Inf, the functions return NaN.

20.122 strtod, strtof

In the case of recognition of NaN, the functions copy n-char sequences into the payload of the returned NaN value. n-char sequences are interpreted as hexadecimal numbers, regardless of the presence of a preceding "0x" or "0X". A n-char sequence is invalid if there are white spaces or special characters (except the terminating null character) in any position. The behavior is undefined if a n-char sequence contains more bits than the NaN payload in the destination format. The functions return an [EINVAL] error if no conversion could be performed.

                               c Copyright 2005  2019, Portugal Futurista, all rights reserved.
                                                                                                      51

20.123 tan, tanf

If the function result underflows and produces an unrepresentable value, the return value is 0.0. If the given argument is +-Inf, the functions return NaN.

20.124 tgamma, tgammaf

If the given argument is -Inf, the functions return NaN.

20.125 timer create

Valid values for clock_id are CLOCK_REALTIME and values in the range [1,DD_NCLOCKS-1] for which a clock was successfully installed with dd_install_clock().

20.126 tzset

The default timezone used by the implementation if tzset() was not called and the TZ environment variable has not been set is GMT.

20.127 uname

The structure utsname is defined as follows:

struct utsname { char sysname[SYS_NMLEN]; /* Name of this OS. / char nodename[SYS_NMLEN]; / Name of this network node. / char release[SYS_NMLEN]; / Release level. / char version[SYS_NMLEN]; / Version level. / char machine[SYS_NMLEN]; / Hardware type. */

 /* Non-POSIX. */
 char p4_kernel_id[P_NMLEN]; /* UniversalisOS Kernel ID string. */
 char p4_asp_id[P_NMLEN];   /* UniversalisOS ASP ID string. */
 char p4_psp_id[P_NMLEN];   /* UniversalisOS ASP ID string. */
 unsigned int p4_version;   /* UniversalisOS Kernel version number. */

};

20.128 write

If nbyte is greater than {SSIZE_MAX} an [EINVAL] error is returned. If the underlying file system layer calls the PSSW function vm_write(), and the communication with the PSSW function fails, an [EIO] error may be generated.

                             c Copyright 2005  2019, Portugal Futurista, all rights reserved.