diff options
| author | Ed Schouten <ed@FreeBSD.org> | 2010-01-13 17:29:55 +0000 |
|---|---|---|
| committer | Ed Schouten <ed@FreeBSD.org> | 2010-01-13 17:29:55 +0000 |
| commit | a627ac61ab8d660acfe6c88b01bdca8e8c1590aa (patch) | |
| tree | cb66a86f625ee4b27233d49a4268bc0331af7295 /include | |
| parent | 5364a38dba0f16a7889430b625984c8a956d48ee (diff) | |
Notes
Diffstat (limited to 'include')
| -rw-r--r-- | include/Makefile | 4 | ||||
| -rw-r--r-- | include/utmpx.h | 88 |
2 files changed, 90 insertions, 2 deletions
diff --git a/include/Makefile b/include/Makefile index 68a7e8da03549..21cdd563abc0a 100644 --- a/include/Makefile +++ b/include/Makefile @@ -23,8 +23,8 @@ INCS= a.out.h ar.h assert.h bitstring.h complex.h cpio.h _ctype.h ctype.h \ stdbool.h stddef.h stdio.h stdlib.h string.h stringlist.h \ strings.h sysexits.h tar.h termios.h tgmath.h \ time.h timeconv.h timers.h ttyent.h \ - ulimit.h unistd.h utime.h utmp.h uuid.h varargs.h vis.h wchar.h \ - wctype.h wordexp.h + ulimit.h unistd.h utime.h utmp.h utmpx.h uuid.h varargs.h vis.h \ + wchar.h wctype.h wordexp.h MHDRS= float.h floatingpoint.h stdarg.h diff --git a/include/utmpx.h b/include/utmpx.h new file mode 100644 index 0000000000000..22707e4d36812 --- /dev/null +++ b/include/utmpx.h @@ -0,0 +1,88 @@ +/*- + * Copyright (c) 2010 Ed Schouten <ed@FreeBSD.org> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _UTMPX_H_ +#define _UTMPX_H_ + +#include <sys/cdefs.h> +#include <sys/_timeval.h> +#include <sys/_types.h> + +#ifndef _PID_T_DECLARED +typedef __pid_t pid_t; +#define _PID_T_DECLARED +#endif + +struct utmpx { + short ut_type; /* Type of entry. */ + struct timeval ut_tv; /* Time entry was made. */ + char ut_id[8]; /* Record identifier. */ + pid_t ut_pid; /* Process ID. */ + char ut_user[32]; /* User login name. */ + char ut_line[16]; /* Device name. */ +#if __BSD_VISIBLE + char ut_host[128]; /* Remote hostname. */ +#else + char __ut_host[128]; +#endif + char __ut_spare[64]; +}; + +#define EMPTY 0 /* No valid user accounting information. */ +#define BOOT_TIME 1 /* Time of system boot. */ +#define OLD_TIME 2 /* Time when system clock changed. */ +#define NEW_TIME 3 /* Time after system clock changed. */ +#define USER_PROCESS 4 /* A process. */ +#define INIT_PROCESS 5 /* A process spawned by the init process. */ +#define LOGIN_PROCESS 6 /* The session leader of a logged-in user. */ +#define DEAD_PROCESS 7 /* A session leader who has exited. */ +#if __BSD_VISIBLE +#define SHUTDOWN_TIME 8 /* Time of system shutdown. */ +#endif + +#if __BSD_VISIBLE +#define UTXDB_ACTIVE 0 /* Active login sessions. */ +#define UTXDB_LASTLOGIN 1 /* Last login sessions. */ +#define UTXDB_LOG 2 /* Log indexed by time. */ +#endif + +__BEGIN_DECLS +void endutxent(void); +struct utmpx *getutxent(void); +struct utmpx *getutxid(const struct utmpx *); +struct utmpx *getutxline(const struct utmpx *); +struct utmpx *pututxline(const struct utmpx *); +void setutxent(void); + +#if __BSD_VISIBLE +struct utmpx *getutxuser(const char *); +int setutxdb(int, const char *); +#endif +__END_DECLS + +#endif /* !_UTMPX_H_ */ |
