United States-English |
|
|
HP-UX Reference > Bbwtmps(3C)HP-UX 11i Version 3: February 2007 |
|
NAMEbwtmps: bwtmpname(), updatebwdb(), getbwent(), setbwent(), endbwent() — access and update routines for the wtmps and btmps databases SYNOPSIS#include <utmps.h> void bwtmpname(char *file); int updatebwdb(struct utmps *utmps, size_t size); struct utmps * getbwent(size_t size); void setbwent(void); void endbwent(void); DESCRIPTIONgetbwent() returns a pointer to a utmps structure. The key members of utmps structure are : char ut_user[] User login name char ut_id[] Unique Id to distinguish an entry char ut_line[] Device name pid_t ut_pid Process Id short ut_type Type of Entry struct ut_exit The exit status of a process struct timeval ut_tv Time entry was made char ut_host[] Host name, if remote uint8_t ut_addr[] Internet Address of the Host, if remote short ut_addr_type Flag to identify type of address in ut_addr RoutinesThe following routines are provided:
RETURN VALUEgetbwent() returns pointer to structure of type struct utmps on success. If size is not one of the supported utmps structure sizes , getbwent() returns NULL and sets errno to EINVAL. On reaching end of database, getbwent returns NULL. updatebwdb() returns 0 if append to the database is successful. updatebwdb() returns -1 on failure to append to database. ERRORS
WARNINGSApplications should not access the wtmps and btmps databases directly, but should use these functions as the structure written to these databases is a superset of the utmps structure. updatebwdb() does not update /var/adm/wtmp and /var/adm/btmp files. bwtmps(3C) interfaces load shared library libuseracct.so.1/libuseracct.1. Compile/link for Archive Applications (PA-RISC only)If you use bwtmps(3C) interfaces and compile/link your application archive, please note that bwtmps(3C) interfaces have a dependency on libdld.sl that will require a change to the compile/link command: Compile : cc -Wl,-a,archive -Wl,-E -Wl,+n -l:libdld.sl -o outfile source Or compile with CCOPTS and LDOPTS:
The option -Wl,-a,archive is positionally dependent and should occur at the beginning of the compile line. For optimum compatibility in future releases, you should avoid using archive libc with other shared libraries except for libdld.sl as needed above. |
Printable version | ||
|