OSDN Git Service

8a63b348b88c1ac6bbec27af1faa48c2404d1f28
[pf3gnuchains/pf3gnuchains4x.git] / winsup / cygwin / include / sys / utmp.h
1 /* sys/utmp.h
2
3    Copyright 2001, 2003, 2004, 2005, 2008 Red Hat, Inc.
4
5    This software is a copyrighted work licensed under the terms of the
6    Cygwin license.  Please consult the file "CYGWIN_LICENSE" for
7    details. */
8
9 #ifndef UTMP_H
10 #define UTMP_H
11
12 #include <cygwin/utmp.h>
13
14 #define UTMP_FILE _PATH_UTMP
15
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19
20 #ifndef ut_name
21 #define ut_name         ut_user
22 #endif
23
24
25 struct utmp
26 {
27  short  ut_type;
28  pid_t  ut_pid;
29  char   ut_line[UT_LINESIZE];
30  char  ut_id[UT_IDLEN];
31  time_t ut_time;
32  char   ut_user[UT_NAMESIZE];
33  char   ut_host[UT_HOSTSIZE];
34  long   ut_addr;
35 };
36
37 extern struct utmp *getutent (void);
38 extern struct utmp *getutid (const struct utmp *);
39 extern struct utmp *getutline (const struct utmp *);
40 extern struct utmp *pututline (const struct utmp *);
41 extern void endutent (void);
42 extern void setutent (void);
43 extern void utmpname (const char *);
44
45 void login (const struct utmp *);
46 int logout (const char *);
47 int login_tty (int);
48 void updwtmp (const char *, const struct utmp *);
49 void logwtmp (const char *, const char *, const char *);
50
51 #ifdef __cplusplus
52 }
53 #endif
54 #endif /* UTMP_H */