POSIX (POS)
This appendix contains guidelines for functions that are defined as part of the POSIX family of standards but are not included in the C Standard. These rules and recommendations are not part of the core standard because they do not apply in all C language applications and because they represent an incomplete set. The intent of providing these guidelines is to demonstrate how rules and recommendations for other standards or specific implementations may be integrated with the core C recommendations.
- POS30-C. Use the readlink() function properly
- POS34-C. Do not call putenv() with a pointer to an automatic variable as the argument
- POS35-C. Avoid race conditions while checking for the existence of a symbolic link
- POS36-C. Observe correct revocation order while relinquishing privileges
- POS37-C. Ensure that privilege relinquishment is successful
- POS38-C. Beware of race conditions when using fork and file descriptors
- POS39-C. Use the correct byte ordering when transferring data between systems
- POS44-C. Do not use signals to terminate threads
- POS47-C. Do not use threads that can be canceled asynchronously
- POS48-C. Do not unlock or destroy another POSIX thread's mutex
- POS49-C. When data must be accessed by multiple threads, provide a mutex and guarantee no adjacent data is also accessed
- POS50-C. Declare objects shared between POSIX threads with appropriate storage durations
- POS51-C. Avoid deadlock with POSIX threads by locking in predefined order
- POS52-C. Do not perform operations that can block while holding a POSIX lock
- POS53-C. Do not use more than one mutex for concurrent waiting operations on a condition variable
- POS54-C. Detect and handle POSIX library errors
Information for Editors
In order to have a new guideline automatically listed above be sure to label it pos and rule .
Risk Assessment Summary
| Rule | Severity | Likelihood | Detectable | Repairable | Priority | Level |
|---|---|---|---|---|---|---|
| POS30-C | High | Probable | Yes | Yes | P18 | L1 |
| POS34-C | High | Unlikely | Yes | No | P6 | L2 |
| POS35-C | High | Likely | No | No | P 9 | L2 |
| POS36-C | High | Probable | Yes | Yes | P18 | L1 |
| POS37-C | High | Probable | Yes | Yes | P18 | L1 |
| POS38-C | Medium | Unlikely | No | No | P2 | L3 |
| POS39-C | Medium | Likely | Yes | No | P12 | L1 |
| POS44-C | Low | Probable | No | No | P2 | L3 |
| POS47-C | Medium | Probable | No | No | P4 | L3 |
| POS48-C | Medium | Probable | No | No | P4 | L3 |
| POS49-C | Medium | Probable | No | No | P4 | L3 |
| POS50-C | Medium | Probable | No | No | P4 | L3 |
| POS51-C | Low | Probable | No | No | P2 | L3 |
| POS52-C | Low | Probable | No | No | P2 | L3 |
| POS53-C | Medium | Probable | Yes | No | P8 | L2 |
| POS54-C | High | Likely | Yes | Yes | P27 | L1 |


