2004-12-15 18:29:01 +01:00
|
|
|
/* utmpx.h
|
|
|
|
|
|
|
|
This software is a copyrighted work licensed under the terms of the
|
|
|
|
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
|
|
|
|
details. */
|
|
|
|
|
|
|
|
#ifndef UTMPX_H
|
|
|
|
#define UTMPX_H
|
|
|
|
|
|
|
|
#include <cygwin/utmp.h>
|
|
|
|
#include <sys/time.h>
|
|
|
|
|
2016-01-07 15:40:40 +01:00
|
|
|
#define _PATH_UTMPX _PATH_UTMP
|
2004-12-15 18:29:01 +01:00
|
|
|
#define UTMPX_FILE _PATH_UTMP
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Must be kept in sync with struct utmp as defined in sys/utmp.h! */
|
|
|
|
struct utmpx
|
|
|
|
{
|
2005-05-02 05:50:11 +02:00
|
|
|
short ut_type;
|
|
|
|
pid_t ut_pid;
|
2004-12-15 18:29:01 +01:00
|
|
|
char ut_line[UT_LINESIZE];
|
|
|
|
char ut_id[UT_IDLEN];
|
2005-05-02 05:50:11 +02:00
|
|
|
time_t ut_time;
|
|
|
|
char ut_user[UT_NAMESIZE];
|
|
|
|
char ut_host[UT_HOSTSIZE];
|
|
|
|
long ut_addr;
|
2004-12-15 18:29:01 +01:00
|
|
|
struct timeval ut_tv;
|
|
|
|
};
|
|
|
|
|
2005-03-03 23:08:12 +01:00
|
|
|
#ifndef ut_name
|
|
|
|
#define ut_name ut_user
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef ut_xtime
|
|
|
|
#define ut_xtime ut_tv.tv_sec
|
|
|
|
#endif
|
|
|
|
|
2004-12-15 18:29:01 +01:00
|
|
|
extern void endutxent (void);
|
|
|
|
extern struct utmpx *getutxent (void);
|
|
|
|
extern struct utmpx *getutxid (const struct utmpx *id);
|
|
|
|
extern struct utmpx *getutxline (const struct utmpx *line);
|
|
|
|
extern struct utmpx *pututxline (const struct utmpx *utmpx);
|
|
|
|
extern void setutxent (void);
|
2016-01-07 15:40:40 +01:00
|
|
|
extern int utmpxname (const char *file);
|
2006-02-02 23:46:37 +01:00
|
|
|
extern void updwtmpx (const char *file, const struct utmpx *utmpx);
|
2004-12-15 18:29:01 +01:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif /* UTMPX_H */
|