]> git.saurik.com Git - apple/libc.git/blob - gen/utmpx-darwin.h
Libc-498.1.5.tar.gz
[apple/libc.git] / gen / utmpx-darwin.h
1 /*
2 * Copyright (c) 2005 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * "Portions Copyright (c) 2004 Apple Computer, Inc. All Rights
7 * Reserved. This file contains Original Code and/or Modifications of
8 * Original Code as defined in and that are subject to the Apple Public
9 * Source License Version 1.0 (the 'License'). You may not use this file
10 * except in compliance with the License. Please obtain a copy of the
11 * License at http://www.apple.com/publicsource and read it before using
12 * this file.
13 *
14 * The Original Code and all software distributed under the License are
15 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
16 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
17 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
19 * License for the specific language governing rights and limitations
20 * under the License."
21 *
22 * @APPLE_LICENSE_HEADER_END@
23 */
24
25 #ifdef UTMP_COMPAT
26 #define UTMP_COMPAT_UTMP0 0x01
27 #define UTMP_COMPAT_UTMP1 0x02
28 #define UTMP_COMPAT_WTMP 0x04
29 #define UTMP_COMPAT_LASTLOG 0x08
30 #endif /* UTMP_COMPAT */
31
32 #define LASTLOG_FACILITY "com.apple.system.lastlog"
33 #define UTMPX_FACILITY "com.apple.system.utmpx"
34
35 extern int utfile_system; /* are we using _PATH_UTMPX? */
36
37 #ifdef __LP64__
38 #define __need_struct_timeval32
39 #include <_structs.h>
40
41 /*
42 * these structures assume natural alignment so they are the same size
43 * and layout as their 32-bit counterpart
44 */
45 #ifdef UTMP_COMPAT
46 struct lastlog32 {
47 __int32_t ll_time;
48 char ll_line[UT_LINESIZE];
49 char ll_host[UT_HOSTSIZE];
50 };
51
52 struct utmp32 {
53 char ut_line[UT_LINESIZE];
54 char ut_name[UT_NAMESIZE];
55 char ut_host[UT_HOSTSIZE];
56 __int32_t ut_time;
57 };
58 #endif /* UTMP_COMPAT */
59
60 struct utmpx32 {
61 char ut_user[_UTX_USERSIZE]; /* login name */
62 char ut_id[_UTX_IDSIZE]; /* id */
63 char ut_line[_UTX_LINESIZE]; /* tty name */
64 pid_t ut_pid; /* process id creating the entry */
65 short ut_type; /* type of this entry */
66 struct timeval32 ut_tv; /* time entry was created */
67 char ut_host[_UTX_HOSTSIZE]; /* host name */
68 __uint32_t ut_pad[16]; /* reserved for future use */
69 };
70 #endif /* __LP64__ */
71
72 struct utmpx *_pututxline(const struct utmpx *);
73 #ifdef __LP64__
74 void _utmpx32_64(const struct utmpx32 *, struct utmpx *);
75 void _utmpx64_32(const struct utmpx *, struct utmpx32 *);
76 #endif /* __LP64__ */
77 void _utmpx_asl(const struct utmpx *);
78 const struct utmpx *_utmpx_working_copy(const struct utmpx *, struct utmpx *, int);
79
80 #ifdef UTMP_COMPAT
81 #ifdef __LP64__
82 void _getutmp32(const struct utmpx *, struct utmp32 *);
83 int _utmp_compat(const struct utmpx *, struct utmp32 *);
84 void _write_lastlog(const struct utmp32 *, const struct utmpx *);
85 void _write_utmp(const struct utmp32 *, int);
86 #else /* __LP64__ */
87 int _utmp_compat(const struct utmpx *, struct utmp *);
88 void _write_lastlog(const struct utmp *, const struct utmpx *);
89 void _write_utmp(const struct utmp *, int);
90 #endif /* __LP64__ */
91 void _write_utmp_compat(const struct utmpx *);
92 #ifdef __LP64__
93 void _write_wtmp(const struct utmp32 *);
94 #else /* __LP64__ */
95 void _write_wtmp(const struct utmp *);
96 #endif /* __LP64__ */
97 #endif /* UTMP_COMPAT */