diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2005-03-30 05:19:11 +0000 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2005-03-30 05:19:11 +0000 |
commit | ec764b0a95ee74773955f6d1e64ec82c7c232509 (patch) | |
tree | 74691da8acb927acfbeb6bf1acf74a0f0f08b827 /lib | |
parent | 196fb1bc5cec0b39eb3049de88561cc63b040aa3 (diff) | |
download | coreutils-ec764b0a95ee74773955f6d1e64ec82c7c232509.tar.xz |
(read_utmp): New arg OPTIONS. All uses changed.
(UT_PID): Moved here from ../src/who.c.
(READ_UTMP_CHECK_PIDS): New constant.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/readutmp.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/readutmp.h b/lib/readutmp.h index 491a99b2a..d04c94d2e 100644 --- a/lib/readutmp.h +++ b/lib/readutmp.h @@ -1,7 +1,7 @@ /* Declarations for GNU's read utmp module. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -167,6 +167,12 @@ enum { UT_USER_SIZE = sizeof UT_USER ((STRUCT_UTMP *) 0) }; # define WTMP_FILE "/etc/wtmp" # endif +# if HAVE_STRUCT_XTMP_UT_PID +# define UT_PID(U) ((U)->ut_pid) +# else +# define UT_PID(U) 0 +# endif + # if HAVE_STRUCT_UTMP_UT_TYPE || HAVE_STRUCT_UTMPX_UT_TYPE # define UT_TYPE_EQ(U, V) ((U)->ut_type == (V)) # define UT_TYPE_NOT_DEFINED 0 @@ -192,7 +198,14 @@ enum { UT_USER_SIZE = sizeof UT_USER ((STRUCT_UTMP *) 0) }; && (UT_TYPE_USER_PROCESS (U) \ || (UT_TYPE_NOT_DEFINED && UT_TIME_MEMBER (U) != 0))) +/* Options for read_utmp. */ +enum + { + READ_UTMP_CHECK_PIDS = 1 + }; + char *extract_trimmed_name (const STRUCT_UTMP *ut); -int read_utmp (const char *filename, size_t *n_entries, STRUCT_UTMP **utmp_buf); +int read_utmp (const char *filename, size_t *n_entries, STRUCT_UTMP **utmp_buf, + int options); #endif /* __READUTMP_H__ */ |