Update contrib.
1 /** @file ../include/pwd.h
6 /** @fn getpwnam(const char *name)
9 Refer to getpwent() for the documentation
20 /** @fn getpwuid(uid_t uid)
23 Refer to getpwent() for the documentation
34 /** @fn endpwent(void)
36 Refer to getpwent() for the documentation
46 /** @fn getpwent(void)
48 Note: This description also covers the following functions -
49 getpwnam() getpwnam_r() getpwuid() getpwuid_r() setpwent() endpwent()
51 @return The functions getpwent, getpwnam, and getpwuid return a valid pointer to a passwd structure on success
52 or NULL if the entry is not found or if an error occurs.
53 If an error does occur, errno will be set.
54 The functions getpwnam_r, and getpwuid_r return 0 if no error occurred, or an error number to indicate failure.
55 It is not an error if a matching entry is not found.
56 (Thus, if result is NULL and the return value is 0, no matching entry exists.) The endpwent and setpwent functions
59 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.
60 We refer to the structure
64 char *pw_name; /* user name */
65 char *pw_passwd; /* encrypted password */
66 uid_t pw_uid; /* user uid */
67 gid_t pw_gid; /* user gid */
68 time_t pw_change; /* password change time */
69 char *pw_class; /* user access class */
70 char *pw_gecos; /* Honeywell login info */
71 char *pw_dir; /* home directory */
72 char *pw_shell; /* default shell */
73 time_t pw_expire; /* account expiration */
74 int pw_fields; /* internal: fields filled in */
80 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.
82 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
84 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.
86 The setpwent function sets the library such that subsequent getpwent call returns a filled passwd structure.
88 endpwent function sets up the library such that the subsequent getpwent call returns NULL.
100 The functions getpwent, getpwnam, and getpwuid, leave their results in an internal static object and return
101 a pointer to that object.
104 will modify the same object. The functions getpwent, endpwent, and setpwent are fairly useless in a networked environment and should be
105 avoided, if possible.
110 @externallyDefinedApi
113 /** @fn setpwent(void)
115 Refer to getpwent() for the documentation
122 @externallyDefinedApi
125 /** @fn getpwnam_r(const char *name, struct passwd *pwd, char *, size_t, struct passwd **result)
130 Refer to getpwent() for the documentation
138 @externallyDefinedApi
141 /** @fn getpwuid_r(uid_t uid, struct passwd *pwd, char *, size_t, struct passwd **result)
146 Refer to getpwent() for the documentation
154 @externallyDefinedApi
159 The passwd data structure is used to hold information about entries in the system user data base
162 @externallyDefinedApi
165 /** @var passwd::pw_name
169 /** @var passwd::pw_passwd
173 /** @var passwd::pw_uid
177 /** @var passwd::pw_gid
181 /** @var passwd::pw_change
185 /** @var passwd::pw_class
189 /** @var passwd::pw_gecos
193 /** @var passwd::pw_dir
197 /** @var passwd::pw_shell
201 /** @var passwd::pw_expire
205 /** @var passwd::pw_fields
206 internal: fields filled in
218 /** @def _PATH_PASSWD
220 Defines to "//etc//passwd"
236 /** @def _PATH_MASTERPASSWD
238 Defines to "//etc//master.passwd"
244 /** @def _MASTERPASSWD
255 Defines to "//etc//pwd.db"
272 /** @def _PATH_SMP_DB
274 Defines to "//etc//spwd.db"
290 /** @def _PATH_PWD_MKDB
292 Defines to "//usr//sbin//pwd_mkdb"
299 /** @def _PASSWORD_LEN
301 max length, not counting NULL