diff options
Diffstat (limited to 'winsup/cygwin/include')
-rw-r--r-- | winsup/cygwin/include/cygwin/utmp.h | 40 | ||||
-rw-r--r-- | winsup/cygwin/include/cygwin/version.h | 3 | ||||
-rw-r--r-- | winsup/cygwin/include/sys/utmp.h | 23 | ||||
-rw-r--r-- | winsup/cygwin/include/utmpx.h | 45 |
4 files changed, 90 insertions, 21 deletions
diff --git a/winsup/cygwin/include/cygwin/utmp.h b/winsup/cygwin/include/cygwin/utmp.h new file mode 100644 index 000000000..56a137ffe --- /dev/null +++ b/winsup/cygwin/include/cygwin/utmp.h @@ -0,0 +1,40 @@ +/* cygwin/utmp.h + + Copyright 2004 Red Hat, Inc. + + This software is a copyrighted work licensed under the terms of the + Cygwin license. Please consult the file "CYGWIN_LICENSE" for + details. */ + +#ifndef CYGWIN_UTMP_H +#define CYGWIN_UTMP_H + +#include <sys/types.h> +#include <time.h> +#include <paths.h> + +#define WTMP_FILE _PATH_WTMP + +#ifdef __cplusplus +extern "C" { +#endif + +#define UT_LINESIZE 16 +#define UT_NAMESIZE 16 +#define UT_HOSTSIZE 256 +#define UT_IDLEN 2 + +#define RUN_LVL 1 +#define BOOT_TIME 2 +#define NEW_TIME 3 +#define OLD_TIME 4 + +#define INIT_PROCESS 5 +#define LOGIN_PROCESS 6 +#define USER_PROCESS 7 +#define DEAD_PROCESS 8 + +#ifdef __cplusplus +} +#endif +#endif /* CYGWIN_UTMP_H */ diff --git a/winsup/cygwin/include/cygwin/version.h b/winsup/cygwin/include/cygwin/version.h index cc2fe3576..f81bc2afc 100644 --- a/winsup/cygwin/include/cygwin/version.h +++ b/winsup/cygwin/include/cygwin/version.h @@ -244,12 +244,13 @@ details. */ 115: Export flockfile, ftrylockfile, funlockfile, getgrgid_r, getgrnam_r, getlogin_r. 116: Export atoll. + 117: Export utmpx functions, Return utmp * from pututent. */ /* Note that we forgot to bump the api for ualarm, strtoll, strtoull */ #define CYGWIN_VERSION_API_MAJOR 0 -#define CYGWIN_VERSION_API_MINOR 116 +#define CYGWIN_VERSION_API_MINOR 117 /* There is also a compatibity version number associated with the shared memory regions. It is incremented when incompatible diff --git a/winsup/cygwin/include/sys/utmp.h b/winsup/cygwin/include/sys/utmp.h index b78c56317..ebc70b9bc 100644 --- a/winsup/cygwin/include/sys/utmp.h +++ b/winsup/cygwin/include/sys/utmp.h @@ -1,6 +1,6 @@ /* sys/utmp.h - Copyright 2001 Red Hat, Inc. + Copyright 2001, 2004 Red Hat, Inc. This software is a copyrighted work licensed under the terms of the Cygwin license. Please consult the file "CYGWIN_LICENSE" for @@ -9,21 +9,14 @@ #ifndef UTMP_H #define UTMP_H -#include <sys/types.h> -#include <time.h> -#include <paths.h> +#include <cygwin/utmp.h> #define UTMP_FILE _PATH_UTMP -#define WTMP_FILE _PATH_WTMP #ifdef __cplusplus extern "C" { #endif -#define UT_LINESIZE 16 -#define UT_NAMESIZE 16 -#define UT_HOSTSIZE 256 -#define UT_IDLEN 2 #define ut_name ut_user struct utmp @@ -38,22 +31,12 @@ struct utmp long ut_addr; }; -#define RUN_LVL 1 -#define BOOT_TIME 2 -#define NEW_TIME 3 -#define OLD_TIME 4 - -#define INIT_PROCESS 5 -#define LOGIN_PROCESS 6 -#define USER_PROCESS 7 -#define DEAD_PROCESS 8 - extern struct utmp *_getutline (struct utmp *); extern struct utmp *getutent (void); extern struct utmp *getutid (struct utmp *); extern struct utmp *getutline (struct utmp *); +extern struct utmp *pututline (struct utmp *); extern void endutent (void); -extern void pututline (struct utmp *); extern void setutent (void); extern void utmpname (const char *); diff --git a/winsup/cygwin/include/utmpx.h b/winsup/cygwin/include/utmpx.h new file mode 100644 index 000000000..395c7a09a --- /dev/null +++ b/winsup/cygwin/include/utmpx.h @@ -0,0 +1,45 @@ +/* utmpx.h + + Copyright 2004 Red Hat, Inc. + + 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> + +#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 +{ + short ut_type; + pid_t ut_pid; + char ut_line[UT_LINESIZE]; + char ut_id[UT_IDLEN]; + time_t ut_time; + char ut_user[UT_NAMESIZE]; + char ut_host[UT_HOSTSIZE]; + long ut_addr; + struct timeval ut_tv; +}; + +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); + +#ifdef __cplusplus +} +#endif +#endif /* UTMPX_H */ |