test: fix tests including non-wrapper libgcc exception handling code
[uclibc-ng.git] / include / internal / utmp.h
blob49f96b4d8a36afe8bb882a39d5187cddab5bda3f
1 /* vi: set sw=4 ts=4: */
2 /*
3 * internal helper for utmp and utmpx handling
5 * Copyright (C) 2015 by Bernhard Reutner-Fischer
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
8 */
9 #ifndef __INTERNAL_UTMP_H
10 #define __INTERNAL_UTMP_H
12 #include <utmpx.h>
13 #include <utmp.h>
15 /* Note: _PATH_UTMPX == _PATH_UTMP */
17 #if (defined __UCLIBC_HAS_UTMPX__ && defined __UCLIBC_HAS_UTMP__) \
18 || !defined __UCLIBC_HAS_UTMP__
19 /* implement the X and alias the non-X */
20 # define __set_unlocked __setutxent_unlocked
21 # define set setutxent
22 # define __get_unlocked __getutxent_unlocked
23 # define get getutxent
24 # define end endutxent
25 # define __getid_unlocked __getutxid_unlocked
26 # define getid getutxid
27 # define getline getutxline
28 # define putline pututxline
29 # define name utmpxname
30 # define updw updwtmpx
31 # define UT utmpx
32 # ifndef __DEFAULT_PATH_UTMP
33 # define __DEFAULT_PATH_UTMP _PATH_UTMPX
34 # endif
35 # if defined __UCLIBC_HAS_UTMP__
36 # define other(n,a) strong_alias_untyped(n,a)
37 # else
38 # define other(n,a) /* nothing */
39 # endif
40 #elif defined __UCLIBC_HAS_UTMP__
41 # define __set_unlocked __setutent_unlocked
42 # define set setutent
43 # define __get_unlocked __getutent_unlocked
44 # define get getutent
45 # define end endutent
46 # define __getid_unlocked __getutid_unlocked
47 # define getid getutid
48 # define getline getutline
49 # define putline pututline
50 # define name utmpname
51 # define updw updwtmp
52 # define UT utmp
53 # ifndef __DEFAULT_PATH_UTMP
54 # define __DEFAULT_PATH_UTMP _PATH_UTMP
55 # endif
56 # define other(n,a) /* nothing */
57 #else
58 #error You are supposed to either have UTMP or UTMPX or both here
59 #endif
61 /* not used in libc_hidden_proto(setutxent) */
62 /* not used in libc_hidden_proto(endutxent) */
63 /* not used in libc_hidden_proto(getutxent) */
64 /* not used in libc_hidden_proto(getutxid) */
65 /* not used in libc_hidden_proto(getutxline) */
66 /* not used in libc_hidden_proto(pututxline) */
67 /* not used in libc_hidden_proto(utmpxname) */
68 /* not used in libc_hidden_proto(updwtmpx) */
70 /* not used in libc_hidden_proto(setutent) */
71 /* not used in libc_hidden_proto(endutent) */
72 /* not used in libc_hidden_proto(getutent) */
73 /* not used in libc_hidden_proto(getutid) */
74 /* not used in libc_hidden_proto(getutline) */
75 /* not used in libc_hidden_proto(pututline) */
76 /* not used in libc_hidden_proto(utmpname) */
77 /* not used in libc_hidden_proto(updwtmp) */
79 #ifdef IS_IN_libutil
80 # if (defined __UCLIBC_HAS_UTMPX__ && defined __UCLIBC_HAS_UTMP__) \
81 || !defined __UCLIBC_HAS_UTMP__
82 /* monkey-patch to use the POSIX interface */
83 # define setutent setutxent
84 # define getutline getutxline
85 # define pututline pututxline
86 # define endutent endutxent
87 # define updwtmp updwtmpx
88 # endif
89 #endif /* IS_IN_libutil */
91 #endif /* __INTERNAL_UTMP_H */