2003-05-12 19:06:27 +08:00
|
|
|
/* sys/utmp.h
|
|
|
|
|
|
|
|
This software is a copyrighted work licensed under the terms of the
|
|
|
|
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
|
|
|
|
details. */
|
|
|
|
|
|
|
|
#ifndef UTMP_H
|
|
|
|
#define UTMP_H
|
|
|
|
|
2004-12-16 01:29:01 +08:00
|
|
|
#include <cygwin/utmp.h>
|
2003-05-12 19:06:27 +08:00
|
|
|
|
|
|
|
#define UTMP_FILE _PATH_UTMP
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2005-03-04 06:08:12 +08:00
|
|
|
#ifndef ut_name
|
|
|
|
#define ut_name ut_user
|
|
|
|
#endif
|
|
|
|
|
2019-07-20 02:14:33 +08:00
|
|
|
#if __GNUC__ >= 8
|
|
|
|
#define ATTRIBUTE_NONSTRING __attribute__ ((nonstring))
|
|
|
|
#else
|
|
|
|
#define ATTRIBUTE_NONSTRING
|
|
|
|
#endif
|
2003-05-12 19:06:27 +08:00
|
|
|
|
2005-05-02 11:50:11 +08:00
|
|
|
struct utmp
|
2003-05-12 19:06:27 +08:00
|
|
|
{
|
2005-05-02 11:50:11 +08:00
|
|
|
short ut_type;
|
|
|
|
pid_t ut_pid;
|
2019-07-20 02:14:33 +08:00
|
|
|
char ut_line[UT_LINESIZE] ATTRIBUTE_NONSTRING;
|
2003-05-12 19:06:27 +08:00
|
|
|
char ut_id[UT_IDLEN];
|
2005-05-02 11:50:11 +08:00
|
|
|
time_t ut_time;
|
2019-07-20 02:14:33 +08:00
|
|
|
char ut_user[UT_NAMESIZE] ATTRIBUTE_NONSTRING;
|
|
|
|
char ut_host[UT_HOSTSIZE] ATTRIBUTE_NONSTRING;
|
2005-05-02 11:50:11 +08:00
|
|
|
long ut_addr;
|
2003-05-12 19:06:27 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
extern struct utmp *getutent (void);
|
2008-07-30 12:58:24 +08:00
|
|
|
extern struct utmp *getutid (const struct utmp *);
|
|
|
|
extern struct utmp *getutline (const struct utmp *);
|
|
|
|
extern struct utmp *pututline (const struct utmp *);
|
2003-05-12 19:06:27 +08:00
|
|
|
extern void endutent (void);
|
|
|
|
extern void setutent (void);
|
2016-01-07 22:40:40 +08:00
|
|
|
extern int utmpname (const char *);
|
2003-05-12 19:06:27 +08:00
|
|
|
|
2008-07-30 12:58:24 +08:00
|
|
|
void login (const struct utmp *);
|
|
|
|
int logout (const char *);
|
2003-05-12 19:06:27 +08:00
|
|
|
int login_tty (int);
|
2003-09-10 23:51:59 +08:00
|
|
|
void updwtmp (const char *, const struct utmp *);
|
|
|
|
void logwtmp (const char *, const char *, const char *);
|
2003-05-12 19:06:27 +08:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif /* UTMP_H */
|