Obtain information about the current user.
More...
Go to the source code of this file.
Obtain information about the current user.
◆ USERNAME_MAX
The maximum size of a user name.
◆ username_is_super()
int username_is_super |
( |
| ) |
|
Determine if the current user is the super user.
- Returns
- True if the current user is root, false otherwise.
◆ username_get()
int username_get |
( |
char * | name | ) |
|
Get the name of the current user.
- Parameters
-
- Returns
- True if the username could be found, false otherwise.
◆ username_set()
int username_set |
( |
const char * | name | ) |
|
Switch to the named user.
- Parameters
-
name | The name of the user to change privilege to. |
- Returns
- True if the privilege could be changed, false otherwise.
◆ username_home()
int username_home |
( |
char * | dir | ) |
|
Get the current user's home directory.
- Parameters
-
dir | A string to hold the home directory. |
- Returns
- True if the home directory could be found, false otherwise.