MySQL 9.1.0
Source Code Documentation
my_getpwnam.h File Reference
#include <string>
#include "my_config.h"
#include <pwd.h>
#include <sys/types.h>

Go to the source code of this file.

Classes

struct  PasswdValue
 Shadow struct for passwd which has proper value semantics, so that it can be safely copied and assigned to. More...
 

Functions

PasswdValue my_getpwnam (const char *)
 Wrapper around the getpwnam_r() POSIX function which places the contents of the passwd struct into an object with value semantics and returns this. More...
 
PasswdValue my_getpwuid (uid_t)
 Wrapper around the getpwuid_r() POSIX function which places the contents of the passwd struct into an object with value semantics and returns this. More...
 

Function Documentation

◆ my_getpwnam()

PasswdValue my_getpwnam ( const char *  name)

Wrapper around the getpwnam_r() POSIX function which places the contents of the passwd struct into an object with value semantics and returns this.

Parameters
nameSymbolic user id
Return values
PasswdValuerepresenting user's passwd entry. PasswdValue::IsVoid() returns true if no such user exists or an error occurred. In the latter case errno is set.

◆ my_getpwuid()

PasswdValue my_getpwuid ( uid_t  uid)

Wrapper around the getpwuid_r() POSIX function which places the contents of the passwd struct into an object with value semantics and returns this.

Parameters
uidNumeric user id
Return values
PasswdValuerepresenting user's passwd entry. PasswdValue::IsVoid() returns true if no such user exists or an error occurred. In the latter case errno is set.