ll2_new_context - Man Page

Allocates context which defines the lastlog2 environment.

Synopsis

#include <lastlog2.h>

*ll2_context * ll2_new_context(const char *db_path);

Description

Defines lastlog2 context e.g. database file, which will be used for any other lastlog2 call. If db_path is NULL, the default path defined in LL2_DEFAULT_DATABASE will be taken.

const   char *db_path = "/var/lib/lastlog/lastlog2.db";
ll2_context *context = ll2_new_context(db_path);

Return Value

Returns context which will be used for all other lastlog2 library calls. This context should be released with ll2_unref_context when it is not needed anymore. Returns NULL on an error.

Authors

Thorsten Kukuk

See Also

lastlog2(3), ll2_unref_context(3), ll2_read_all(3), ll2_write_entry(3), ll2_read_entry(3), ll2_remove_entry(3), ll2_update_login_time(3), ll2_import_lastlog(3)

Reporting Bugs

For bug reports, use the issue tracker.

Availability

The liblastlog2 library is part of the util-linux package since version 2.40. It can be downloaded from Linux Kernel Archive.

Referenced By

lastlog2(3), ll2_import_lastlog(3), ll2_read_all(3), ll2_read_entry(3), ll2_remove_entry(3), ll2_rename_user(3), ll2_unref_context(3), ll2_update_login_time(3), ll2_write_entry(3).

2026-03-31 util-linux 2.42 Programmers Manual