-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
doc: add missing ctype.h, sys/stat.h, stdlib.h descriptions
JIRA: CI-269
- Loading branch information
Showing
22 changed files
with
801 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Synopsis | ||
|
||
`#include <stdlib.h>` | ||
|
||
`void free(void *ptr);` | ||
|
||
## Description | ||
|
||
The `free()` function shall cause the space pointed to by _ptr_ to be deallocated; that is, made available for further | ||
allocation. | ||
If _ptr_ is a null pointer, no action shall occur. Otherwise, if the argument does not match a pointer earlier returned | ||
by a function in `POSIX.1-2017` that allocates memory as if by `malloc()`, or if the space has been deallocated by a | ||
call to `free()` or `realloc()`, the behavior is undefined. | ||
|
||
Any use of a pointer that refers to freed space results in undefined behavior. | ||
|
||
## Return value | ||
|
||
The `free()` function shall not return a value. | ||
|
||
## Errors | ||
|
||
No errors are defined. | ||
|
||
## Tests | ||
|
||
Tested | ||
|
||
## Known bugs | ||
|
||
None | ||
|
||
## See Also | ||
|
||
1. [Standard library functions](../README.md) | ||
2. [Table of Contents](../../../README.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# Synopsis | ||
|
||
`#include <sys/stat.h>` | ||
|
||
`int fstat(int fildes, struct stat *buf);` | ||
|
||
## Description | ||
|
||
The `fstat()` function shall obtain information about an open file associated with the file descriptor _fildes_, and | ||
shall write it to the area pointed to by _buf_. | ||
|
||
If _fildes_ references a shared memory object, the implementation shall update in the _stat_ structure pointed to by the | ||
_buf_ argument the `st_uid`, `st_gid`, `st_size`, and `st_mode` fields, and only the `S_IRUSR`, `S_IWUSR`, `S_IRGRP`, | ||
`S_IWGRP`, `S_IROTH`, and `S_IWOTH` file permission bits need be valid. The implementation may update other fields | ||
and flags. | ||
|
||
If _fildes_ references a typed memory object, the implementation shall update in the stat structure pointed to by the | ||
_buf_ argument the `st_uid`, `st_gid`, `st_size`, and `st_mode` fields, and only the `S_IRUSR`, `S_IWUSR`, `S_IRGRP`, | ||
`S_IWGRP`, `S_IROTH`, and `S_IWOTH` file permission bits need be valid. The implementation may update other fields and | ||
flags. | ||
|
||
The _buf_ argument is a pointer to a _stat_ structure, as defined in `<sys/stat.h>`, into which information is placed | ||
concerning the file. | ||
|
||
For all other file types defined in this volume of `POSIX.1-2017`, the structure members `st_mode`, `st_ino`, `st_dev`, | ||
`st_uid`, `st_gid`, `st_atim`, `st_ctim`, and `st_mtim` shall have meaningful values and the value of the `st_nlink` | ||
member shall be set to the number of links to the file. | ||
|
||
An implementation that provides additional or alternative file access control mechanisms may, under | ||
implementation-defined conditions, cause `fstat()` to fail. | ||
|
||
The `fstat()` function shall update any time-related fields, before writing into the _stat_ structure. | ||
|
||
## Return value | ||
|
||
Upon successful completion, `0` shall be returned. Otherwise, `-1` shall be returned and _errno_ set to indicate the | ||
error. | ||
|
||
## Errors | ||
|
||
The `fstat()` function shall fail if: | ||
|
||
- `[EBADF]` - The _fildes_ argument is not a valid file descriptor. | ||
|
||
- `[EIO]` - An _I/O_ error occurred while reading from the file system. | ||
|
||
- `[EOVERFLOW]` - The file size in bytes or the number of blocks allocated to the file or the file serial number cannot | ||
be represented correctly in the structure pointed to by _buf_. | ||
|
||
The `fstat()` function may fail if: | ||
|
||
- `[EOVERFLOW]`- One of the values is too large to store into the structure pointed to by the _buf_ argument. | ||
|
||
## Tests | ||
|
||
Tested | ||
|
||
## Known bugs | ||
|
||
None | ||
|
||
## See Also | ||
|
||
1. [Standard library functions](../README.md) | ||
2. [Table of Contents](../../../README.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Synopsis | ||
|
||
`#include <ctype.h>` | ||
|
||
`int isalnum(int c);` | ||
|
||
## Description | ||
|
||
The `isalnum()` function shall test whether _c_ is a character of class _alpha_ or _digit_ in the current locale. | ||
|
||
The _c_ argument is an `int`, the value of which the application shall ensure is representable as an `unsigned char` or | ||
equal to the value of the macro `EOF`. If the argument has any other value, the behavior is undefined. | ||
|
||
## Return value | ||
|
||
The `isalnum()` function shall return non-zero if _c_ is an alphanumeric character, otherwise shall return `0`. | ||
|
||
## Errors | ||
|
||
No errors are defined. | ||
|
||
## Tests | ||
|
||
Tested | ||
|
||
## Known bugs | ||
|
||
None | ||
|
||
## See Also | ||
|
||
1. [Standard library functions](../README.md) | ||
2. [Table of Contents](../../../README.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Synopsis | ||
|
||
`#include <ctype.h>` | ||
|
||
`int isalpha(int c);` | ||
|
||
## Description | ||
|
||
The `isalpha()` function shall test whether _c_ is a character of class _alpha_ in the current locale. | ||
|
||
The _c_ argument is an `int`, the value of which the application shall ensure is representable as an `unsigned char` or | ||
equal to the value of the macro `EOF`. If the argument has any other value, the behavior is undefined. | ||
|
||
## Return value | ||
|
||
The `isalpha()` function shall return non-zero if _c_ is an alphanumeric character, otherwise shall return `0`. | ||
|
||
## Errors | ||
|
||
No errors are defined. | ||
|
||
## Tests | ||
|
||
Tested | ||
|
||
## Known bugs | ||
|
||
None | ||
|
||
## See Also | ||
|
||
1. [Standard library functions](../README.md) | ||
2. [Table of Contents](../../../README.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Synopsis | ||
|
||
`#include <ctype.h>` | ||
|
||
`int isblank(int c);` | ||
|
||
## Description | ||
|
||
The `isblank()` function shall test whether _c_ is a character of class _blank_ in the current locale. | ||
|
||
The _c_ argument is a type `int`, the value of which the application shall ensure is a character representable as an | ||
`unsigned char` or equal to the value of the macro `EOF`. If the argument has any other value, the behavior is | ||
undefined. | ||
|
||
## Return value | ||
|
||
The `isblank()` function shall return non-zero if _c_ is a `<blank>`, otherwise shall return `0`. | ||
|
||
## Errors | ||
|
||
No errors are defined. | ||
|
||
## Tests | ||
|
||
Tested | ||
|
||
## Known bugs | ||
|
||
None | ||
|
||
## See Also | ||
|
||
1. [Standard library functions](../README.md) | ||
2. [Table of Contents](../../../README.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Synopsis | ||
|
||
`#include <ctype.h>` | ||
|
||
`int iscntrl(int c);` | ||
|
||
## Description | ||
|
||
The `iscntrl()` function shall test whether _c_ is a character of class _cntrl_ in the current locale. | ||
|
||
The _c_ argument is a type `int`, the value of which the application shall ensure is a character representable as an | ||
`unsigned char` or equal to the value of the macro `EOF`. If the argument has any other value, the behavior is | ||
undefined. | ||
|
||
## Return value | ||
|
||
The `iscntrl()` function shall return non-zero if _c_ is a control character, otherwise shall return `0`. | ||
|
||
## Errors | ||
|
||
No errors are defined. | ||
|
||
## Tests | ||
|
||
Tested | ||
|
||
## Known bugs | ||
|
||
None | ||
|
||
## See Also | ||
|
||
1. [Standard library functions](../README.md) | ||
2. [Table of Contents](../../../README.md) |
Oops, something went wrong.