| | 423 | |
| | 424 | RETURN VALUE |
| | 425 | getutent(), getutid(), getutline() and pututline() return a pointer to |
| | 426 | a struct utmp on success, and NULL on failure. This struct utmp is |
| | 427 | allocated in static storage, and may be overwritten by subsequent |
| | 428 | calls. |
| | 429 | |
| | 430 | FILES |
| | 431 | /var/run/utmp database of currently logged-in users |
| | 432 | /var/log/wtmp database of past user logins |
| | 433 | |
| | 434 | NOTES |
| | 435 | Glibc Notes |
| | 436 | The above functions are not thread-safe. Glibc adds reentrant versions |
| | 437 | |
| | 438 | #define _GNU_SOURCE /* or _SVID_SOURCE or _BSD_SOURCE */ |
| | 439 | #include <utmp.h> |
| | 440 | |
| | 441 | int getutent_r(struct utmp *ubuf, struct utmp **ubufp); |
| | 442 | |
| | 443 | int getutid_r(struct utmp *ut, |
| | 444 | struct utmp *ubuf, struct utmp **ubufp); |
| | 445 | |
| | 446 | int getutline_r(struct utmp *ut, |
| | 447 | struct utmp *ubuf, struct utmp **ubufp); |
| | 448 | |
| | 449 | These functions are GNU extensions, analogs of the functions of the |
| | 450 | same name without the _r suffix. The ubuf parameter gives these func- |
| | 451 | tions a place to store their result. On success they return 0, and a |
| | 452 | pointer to the result is written in *ubufp. On error these functions |
| | 453 | return -1. |
| | 454 | |