Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <pwd.h>
Link against: libc.lib

_PATH_PWD

_PATH_PWD "/etc"

Description

Defines to "//etc"

[Top]


_PATH_PASSWD

_PATH_PASSWD "/etc/passwd"

Description

Defines to "//etc//passwd"

[Top]


_PASSWD

_PASSWD "passwd"

Description

Defines to "passwd"

[Top]


_PATH_MASTERPASSWD

_PATH_MASTERPASSWD "/etc/master.passwd"

Description

Defines to "//etc//master.passwd"

[Top]


_MASTERPASSWD

_MASTERPASSWD "master.passwd"

Description

"master.passwd"

[Top]


_PATH_MP_DB

_PATH_MP_DB "/etc/pwd.db"

Description

Defines to "//etc//pwd.db"

[Top]


_MP_DB

_MP_DB "pwd.db"

Description

Defines to "pwd.db"

[Top]


_PATH_SMP_DB

_PATH_SMP_DB "/etc/spwd.db"

Description

Defines to "//etc//spwd.db"

[Top]


_SMP_DB

_SMP_DB "spwd.db"

Description

Defines to "spwd.db"

[Top]


_PATH_PWD_MKDB

_PATH_PWD_MKDB "/usr/sbin/pwd_mkdb"

Description

Defines to "//usr//sbin//pwd_mkdb"

[Top]


_PASSWORD_LEN

_PASSWORD_LEN 128

Description

max length, not counting NULL

[Top]


Typedef time_t

Interface status: externallyDefinedApi

typedef __time_t time_t;

Description

Used for time in seconds.

[Top]


Typedef uid_t

Interface status: externallyDefinedApi

typedef __uid_t uid_t;

Description

Used for user IDs.

[Top]


getpwnam(const char *)

Interface status: externallyDefinedApi

IMPORT_C struct passwd* getpwnam(const char *);

Description

Parameters

const char *

Refer to getpwent(void)getpwent(void) for the documentation

Return value

struct passwdpasswd *

See also:

[Top]


getpwuid(uid_t)

Interface status: externallyDefinedApi

IMPORT_C struct passwd* getpwuid(uid_t);

Description

Parameters

uid_tuid_t

Refer to getpwent(void)getpwent(void) for the documentation

Return value

struct passwdpasswd *

See also:

[Top]


endpwent(void)

Interface status: externallyDefinedApi

IMPORT_C void endpwent(void);

Description

Refer to getpwent(void)getpwent(void) for the documentation

See also:

[Top]


getpwent(void)

Interface status: externallyDefinedApi

IMPORT_C struct passwd* getpwent(void);

Description

Note: This description also covers the following functions - getpwnam(const char *)getpwnam(const char *) getpwnam_r(const char *,struct passwd *,char *,size_t,struct passwd **)getpwnam_r(const char *,struct passwd *,char *,size_t,struct passwd **) getpwuid(uid_t)getpwuid(uid_t) getpwuid_r(uid_t,struct passwd *,char *,size_t,struct passwd **)getpwuid_r(uid_t,struct passwd *,char *,size_t,struct passwd **) setpwent(void)setpwent(void) endpwent(void)endpwent(void)

These APIs belongs to set which are only build supported and not available functionally. The reason why only build support is extended to these APIs is that Symbian operating system does not support the creation of multiple users and groups in its environment. Moreover it may not make sense to have multiple users and groups in the context of a mobile environment. We refer to the structure

#include <pwd.h> 
struct passwd {
        char    *pw_name;       /* user name */
        char    *pw_passwd;     /* encrypted password */
        uid_t   pw_uid;         /* user uid */
        gid_t   pw_gid;         /* user gid */
        time_t  pw_change;      /* password change time */
        char    *pw_class;      /* user access class */
        char    *pw_gecos;      /* Honeywell login info */
        char    *pw_dir;        /* home directory */
        char    *pw_shell;      /* default shell */
        time_t  pw_expire;      /* account expiration */
        int     pw_fields;      /* internal: fields filled in */
};

The functions getpwnam and getpwuid returns the default values for a single user system i.e., pw_name,pw_passwd,pw_uid and pw_gid set to root,NULL,0 and 0 respectively in case the input parameter uid/login is 0/ root else the error number is set and NULL is returned by the APIs.

The getpwent when called the first time by an application returns the pointer to a valid passwd structure,that of the simulated single-user group.Subsequent calls return NULL until setpwent is called

The functions getpwnam_r, and getpwuid_r are thread-safe versions of getpwnam, and getpwuid, respectively. The caller must provide storage for the results of the search in the pwd, buffer, bufsize, and result arguments. When these functions are successful, the pwd argument will be filled-in, and a pointer to that argument will be stored in result. If an entry is not found or an error occurs, result will be set to NULL.

The setpwent function sets the library such that subsequent getpwent call returns a filled passwd structure.

endpwent function sets up the library such that the subsequent getpwent call returns NULL.

Bugs:

The functions getpwent, getpwnam, and getpwuid, leave their results in an internal static object and return a pointer to that object. Subsequent calls to the same function will modify the same object. The functions getpwent, endpwent, and setpwent are fairly useless in a networked environment and should be avoided, if possible.

Return value

struct passwdpasswd *

The functions getpwent, getpwnam, and getpwuid return a valid pointer to a passwd structure on success or NULL if the entry is not found or if an error occurs. If an error does occur, errno will be set. The functions getpwnam_r, and getpwuid_r return 0 if no error occurred, or an error number to indicate failure. It is not an error if a matching entry is not found. (Thus, if result is NULL and the return value is 0, no matching entry exists.) The endpwent and setpwent functions have no return value.

See also:

[Top]


setpwent(void)

Interface status: externallyDefinedApi

IMPORT_C void setpwent(void);

Description

Refer to getpwent(void)getpwent(void) for the documentation

See also:

[Top]


getpwnam_r(const char *,struct passwd *,char *,size_t,struct passwd **)

Interface status: externallyDefinedApi

IMPORT_C int getpwnam_r(const char *, struct passwd *, char *, size_t, struct passwd **);

Description

Parameters

const char *

struct passwdpasswd *

char *

size_tsize_t

struct passwdpasswd **

Refer to getpwent(void)getpwent(void) for the documentation

Return value

int

See also:

[Top]


getpwuid_r(uid_t,struct passwd *,char *,size_t,struct passwd **)

Interface status: externallyDefinedApi

IMPORT_C int getpwuid_r(uid_t, struct passwd *, char *, size_t, struct passwd **);

Description

Parameters

uid_tuid_t

struct passwdpasswd *

char *

size_tsize_t

struct passwdpasswd **

Refer to getpwent(void)getpwent(void) for the documentation

Return value

int

See also: