Elliott Hughes | 13da600 | 2025-02-03 10:42:13 -0800 | [diff] [blame] | 1 | // Copyright (C) 2023 The Android Open Source Project |
| 2 | // SPDX-License-Identifier: BSD-2-Clause |
Elliott Hughes | dbf5b2e | 2023-04-03 16:30:39 -0700 | [diff] [blame] | 3 | |
| 4 | #include <utmpx.h> |
| 5 | |
| 6 | #include "header_checks.h" |
| 7 | |
| 8 | static void utmpx_h() { |
| 9 | TYPE(struct utmpx); |
| 10 | STRUCT_MEMBER_ARRAY(struct utmpx, char/*[]*/, ut_user); |
| 11 | STRUCT_MEMBER_ARRAY(struct utmpx, char/*[]*/, ut_id); |
| 12 | STRUCT_MEMBER_ARRAY(struct utmpx, char/*[]*/, ut_line); |
| 13 | STRUCT_MEMBER(struct utmpx, pid_t, ut_pid); |
| 14 | STRUCT_MEMBER(struct utmpx, short, ut_type); |
| 15 | #if !defined(__GLIBC__) |
| 16 | // POSIX says struct timeval, but glibc has an anonymous struct. |
| 17 | STRUCT_MEMBER(struct utmpx, struct timeval, ut_tv); |
| 18 | #endif |
| 19 | |
| 20 | TYPE(pid_t); |
| 21 | TYPE(struct timeval); |
| 22 | |
| 23 | MACRO(EMPTY); |
| 24 | MACRO(BOOT_TIME); |
| 25 | MACRO(OLD_TIME); |
| 26 | MACRO(NEW_TIME); |
| 27 | MACRO(USER_PROCESS); |
| 28 | MACRO(INIT_PROCESS); |
| 29 | MACRO(LOGIN_PROCESS); |
| 30 | MACRO(DEAD_PROCESS); |
| 31 | |
| 32 | FUNCTION(endutxent, void (*f)(void)); |
| 33 | FUNCTION(getutxent, struct utmpx* (*f)(void)); |
| 34 | FUNCTION(getutxid, struct utmpx* (*f)(const struct utmpx*)); |
| 35 | FUNCTION(getutxline, struct utmpx* (*f)(const struct utmpx*)); |
| 36 | FUNCTION(pututxline, struct utmpx* (*f)(const struct utmpx*)); |
| 37 | FUNCTION(setutxent, void (*f)(void)); |
| 38 | } |