blob: 54f449233ada2eddbd5fc16f339859db3d533480 [file] [log] [blame]
Elliott Hughes13da6002025-02-03 10:42:13 -08001// Copyright (C) 2023 The Android Open Source Project
2// SPDX-License-Identifier: BSD-2-Clause
Elliott Hughesdbf5b2e2023-04-03 16:30:39 -07003
4#include <utmpx.h>
5
6#include "header_checks.h"
7
8static 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}