| 1 |
//po4a: entry man manual |
| 2 |
= ll2_read_entry(3) |
| 3 |
:doctype: manpage |
| 4 |
:man manual: Programmer's Manual |
| 5 |
:man source: util-linux {release-version} |
| 6 |
:page-layout: base |
| 7 |
:lib: liblastlog2 |
| 8 |
:firstversion: 2.40 |
| 9 |
|
| 10 |
== NAME |
| 11 |
|
| 12 |
ll2_read_entry - Reads one entry from database and returns that. |
| 13 |
|
| 14 |
== SYNOPSIS |
| 15 |
|
| 16 |
*#include <lastlog2.h>* |
| 17 |
|
| 18 |
*int ll2_read_entry (struct ll2_context *__context__, const char *__user__, |
| 19 |
int64_t *__ll_time__, char **__tty__, char **__rhost__, |
| 20 |
char **__pam_service__, char **__error__);* |
| 21 |
|
| 22 |
== DESCRIPTION |
| 23 |
|
| 24 |
Reads the first entry from database, defined in _context_, for user _user_. |
| 25 |
If _context_ is NULL, the default database, defined in _LL2_DEFAULT_DATABASE_, |
| 26 |
will be taken. |
| 27 |
|
| 28 |
-------------------------------------- |
| 29 |
char *error = NULL; |
| 30 |
const char *user = "root"; |
| 31 |
int64_t res_time; |
| 32 |
char *res_tty = NULL; |
| 33 |
char *res_rhost = NULL; |
| 34 |
char *res_service = NULL; |
| 35 |
|
| 36 |
int ret = ll2_read_entry (NULL, user, &res_time, &res_tty, &res_rhost, &res_service, &error); |
| 37 |
-------------------------------------- |
| 38 |
|
| 39 |
== RETURN VALUE |
| 40 |
|
| 41 |
Returns 0 on success, -ENOMEM or -1 on other failure. |
| 42 |
_error_ contains an error string if the return value is -1. |
| 43 |
_error_ is not guaranteed to contain an error string, could also be NULL. |
| 44 |
_error_ should be freed by the caller. |
| 45 |
If lastlog2 database does not exist at all, the errno ENOENT is set |
| 46 |
and can be checked. |
| 47 |
|
| 48 |
The evaluated values are returned by _ll_time_, _tty_, _rhost_ and _pam_service_. |
| 49 |
|
| 50 |
== AUTHORS |
| 51 |
|
| 52 |
mailto:[email protected][Thorsten Kukuk] |
| 53 |
|
| 54 |
== SEE ALSO |
| 55 |
|
| 56 |
*lastlog2*(3), |
| 57 |
*ll2_new_context*(3), |
| 58 |
*ll2_unref_context*(3), |
| 59 |
*ll2_read_all*(3), |
| 60 |
*ll2_write_entry*(3), |
| 61 |
*ll2_update_login_time*(3), |
| 62 |
*ll2_remove_entry*(3), |
| 63 |
*ll2_rename_user*(3), |
| 64 |
*ll2_import_lastlog*(3) |
| 65 |
|
| 66 |
include::man-common/bugreports.adoc[] |
| 67 |
|
| 68 |
include::man-common/footer-lib.adoc[] |
| 69 |
|
| 70 |
ifdef::translation[] |
| 71 |
include::man-common/translation.adoc[] |
| 72 |
endif::[] |