Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

updatebwdb(3c) [hpux man page]

bwtmps(3C)																bwtmps(3C)

NAME
bwtmps: bwtmpname(), updatebwdb(), getbwent(), setbwent(), endbwent() - access and update routines for the wtmps and btmps databases SYNOPSIS
DESCRIPTION
returns a pointer to a structure. The key members of 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 Routines The following routines are provided: Allows the user to set the database being examined to either or does not open the database -- it merely closes the old file if it is currently open, and saves the new file name. and are macros defined in header file, which refer to and files respectively . Reads in the next entry from either or depending on the previous call to If the database is not already open, opens it. If it reaches end of file, fails. Appends the structure pointed to by to either or as set by the previous call to Resets the requests for to begin from the start of the database, as specified by a previous call to Closes the handle of the currently open database. RETURN VALUE
returns pointer to structure of type on success. If size is not one of the supported structure sizes , returns NULL and sets errno to On reaching end of database, returns NULL. returns 0 if append to the database is successful. returns -1 on failure to append to database. ERRORS
[EINVAL] The size parameter passed to the bwtmps(3C) functions does not match any of the structure sizes supported . WARNINGS
Applications should not access the and databases directly, but should use these functions as the structure written to these databases is a superset of the structure. does not update and files. bwtmps(3C) interfaces load shared library 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 that will require a change to the compile/link command: Compile : Or compile with and The option 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 as needed above. AUTHOR
The routines were developed by Hewlett-Packard Company. FILES
SEE ALSO
getuts(3C), thread_safety(5). bwtmps(3C)

Check Out this Related Man Page

getuts(3C)																getuts(3C)

NAME
getuts: endutsent(), getutsent(), getutsid(), getutsline(), pututsline(), setutsent(), ENDUTSENT(), GETUTSENT(), GETUTSID(), GETUTSLINE(), PUTUTSLINE(), SETUTSENT(), - access and update routines for user-accounting database maintained by utmpd SYNOPSIS
Remarks The size of the structure (for example is passed as utmps_size parameter in the above calls. A macro equivalent exists for each of the above function calls. These macros provide a shorthand way of calling getuts(3C) functions, by implicitly passing the utmps_size parameter to the corresponding getuts(3C) function. DESCRIPTION
and each return a pointer to a structure, the key elements of the 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 Routines This call returns the next record from the in-memory user accounting database maintained by utmpd(1M). When the end of the database is reached fails and returns NULL. The macro is a wrapper around and implicitly passes the utmps_size parameter. For entries of ut_type matching and searches the database for an entry matching id->ut_id field. The record is fetched irre- spective of the current position in the internal ordering and does not alter the current position in the inter- nal ordering for the API. If ut_type specified is or fetches an entry with a ut_type matching id->ut_type. If no matching entry is found fails and returns NULL. The macro is a wrapper around and implicitly passes the utmps_size parameter to This is similar to It searches the utmpd(1M)'s database for an entry of type or that also has the ut_line field matching the line->ut_line string. If the entry is not found in the database, fails and returns NULL. The record is fetched irrespective of the current position in the internal ordering and does not alter the internal ordering for the API. The macro is a wrapper around and implicitly passes the utmps_size parameter to Writes out the supplied structure into the in-memory user accounting database maintained by utmpd(1M). For entries of ut_type matching and searches the utmpd(1M)'s database for an entry matching utmps->ut_id field. If the entry already exists in the utmpd(1M)'s database, this API updates the entry already present. Otherwise, adds a new entry into the utmpd(1M)'s database. If ut_type specified is or updates the entry with ut_type matching utmps->ut_type. The macro is a wrapper around and implicitly passes the utmps_size parameter to This API searches the utmpd(1M)'s database for an entry with ut_pid matching the pid argument. Since pid has significance only for currently ACTIVE processes, matching is done only for entries of type or On finding a matching entry, returns the corresponding entry; otherwise, fails and returns NULL. The macro is a wrapper around and implicitly passes the utmps_size parameter to Resets the requests for to begin from the start of the utmpd(1M)'s database. It also clears out the static structure. The macro is a wrapper around It closes any open file descriptors and clears out the static structure. The macro is a wrapper around The specific calling convention of passing the expected data structure size is used in order to allow for future expansion of the inter- face, and the structure while preserving backward compatibility for programs written using the getuts(3C) interfaces. The interfaces encode the version information of the structure in the utmps_size parameter. Should the structure change in a future release, utmpd(1M) and libc interfaces detect the version of the structure the application was compiled with based on the utmps_size param- eter and return the appropriate structure. The getuts(3C) interfaces use file only when the utmpd(1M) is not running. This feature may be discontinued in a future release. The field in the structure can hold a 16 byte IPv6 address. In case applications want to write a four byte IPv4 address into this field, they must initialize the field to and use the last four bytes of the field. Applications which write an IPv6 address into the field must initialize the to and are macros defined in header file. RETURN VALUE
and return a pointer to static structure on success. On failure they return NULL. ERRORS
The size parameter passed to the functions does not match any of the structure sizes supported by the server. WARNINGS
If the size of a member of the structure changes in a future release, applications compiled with older version of the structure will get truncated information for the structure fields that have expanded. To get the complete information, the applications have to be re-com- piled. The value returned by and points to a single static area that is overwritten by each call to any of the functions, so it must be copied if it is to be saved. AUTHOR
The routines were developed by Hewlett-Packard Company. FILES
SEE ALSO
utmpd(1M), bwtmps(3C), thread_safety(5). getuts(3C)
Man Page