Blame sysdeps/unix/sysv/linux/s390/bits/utmpx.h

Packit 6c4009
/* Structures and definitions for the user accounting database.  GNU version.
Packit 6c4009
   Copyright (C) 1997-2018 Free Software Foundation, Inc.
Packit 6c4009
   This file is part of the GNU C Library.
Packit 6c4009
Packit 6c4009
   The GNU C Library is free software; you can redistribute it and/or
Packit 6c4009
   modify it under the terms of the GNU Lesser General Public
Packit 6c4009
   License as published by the Free Software Foundation; either
Packit 6c4009
   version 2.1 of the License, or (at your option) any later version.
Packit 6c4009
Packit 6c4009
   The GNU C Library is distributed in the hope that it will be useful,
Packit 6c4009
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 6c4009
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 6c4009
   Lesser General Public License for more details.
Packit 6c4009
Packit 6c4009
   You should have received a copy of the GNU Lesser General Public
Packit 6c4009
   License along with the GNU C Library; if not, see
Packit 6c4009
   <http://www.gnu.org/licenses/>.  */
Packit 6c4009
Packit 6c4009
#ifndef _UTMPX_H
Packit 6c4009
# error "Never include <bits/utmpx.h> directly; use <utmpx.h> instead."
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
#include <bits/types.h>
Packit 6c4009
#include <sys/time.h>
Packit 6c4009
#include <bits/wordsize.h>
Packit 6c4009
Packit 6c4009
Packit 6c4009
#ifdef __USE_GNU
Packit 6c4009
# include <paths.h>
Packit 6c4009
# define _PATH_UTMPX	_PATH_UTMP
Packit 6c4009
# define _PATH_WTMPX	_PATH_WTMP
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
Packit 6c4009
#define __UT_LINESIZE	32
Packit 6c4009
#define __UT_NAMESIZE	32
Packit 6c4009
#define __UT_HOSTSIZE	256
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* The structure describing the status of a terminated process.  This
Packit 6c4009
   type is used in `struct utmpx' below.  */
Packit 6c4009
struct __exit_status
Packit 6c4009
  {
Packit 6c4009
#ifdef __USE_GNU
Packit 6c4009
    short int e_termination;	/* Process termination status.  */
Packit 6c4009
    short int e_exit;		/* Process exit status.  */
Packit 6c4009
#else
Packit 6c4009
    short int __e_termination;	/* Process termination status.  */
Packit 6c4009
    short int __e_exit;		/* Process exit status.  */
Packit 6c4009
#endif
Packit 6c4009
  };
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* The structure describing an entry in the user accounting database.  */
Packit 6c4009
struct utmpx
Packit 6c4009
{
Packit 6c4009
  short int ut_type;		/* Type of login.  */
Packit 6c4009
  __pid_t ut_pid;		/* Process ID of login process.  */
Packit Service b76e3f
  char ut_line[__UT_LINESIZE]
Packit Service b76e3f
    __attribute_nonstring__;	/* Devicename.  */
Packit Service b76e3f
  char ut_id[4]
Packit Service b76e3f
    __attribute_nonstring__;	/* Inittab ID.  */
Packit Service b76e3f
  char ut_user[__UT_NAMESIZE]
Packit Service b76e3f
    __attribute_nonstring__;	/* Username.  */
Packit Service b76e3f
  char ut_host[__UT_HOSTSIZE]
Packit Service b76e3f
    __attribute_nonstring__;	/* Hostname for remote login.  */
Packit 6c4009
  struct __exit_status ut_exit;	/* Exit status of a process marked
Packit 6c4009
				   as DEAD_PROCESS.  */
Packit 6c4009
Packit 6c4009
/* The fields ut_session and ut_tv must be the same size when compiled
Packit 6c4009
   32- and 64-bit.  This allows files and shared memory to be shared
Packit 6c4009
   between 32- and 64-bit applications.  */
Packit 6c4009
#if __WORDSIZE == 32
Packit 6c4009
  __int64_t ut_session;		/* Session ID, used for windowing.  */
Packit 6c4009
  struct
Packit 6c4009
  {
Packit 6c4009
    __int64_t tv_sec;		/* Seconds.  */
Packit 6c4009
    __int64_t tv_usec;		/* Microseconds.  */
Packit 6c4009
  } ut_tv;			/* Time entry was made.  */
Packit 6c4009
#else
Packit 6c4009
  long int ut_session;		/* Session ID, used for windowing.  */
Packit 6c4009
  struct timeval ut_tv;		/* Time entry was made.  */
Packit 6c4009
#endif
Packit 6c4009
  __int32_t ut_addr_v6[4];	/* Internet address of remote host.  */
Packit 6c4009
  char __glibc_reserved[20];		/* Reserved for future use.  */
Packit 6c4009
};
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Values for the `ut_type' field of a `struct utmpx'.  */
Packit 6c4009
#define EMPTY		0	/* No valid user accounting information.  */
Packit 6c4009
Packit 6c4009
#ifdef __USE_GNU
Packit 6c4009
# define RUN_LVL	1	/* The system's runlevel.  */
Packit 6c4009
#endif
Packit 6c4009
#define BOOT_TIME	2	/* Time of system boot.  */
Packit 6c4009
#define NEW_TIME	3	/* Time after system clock changed.  */
Packit 6c4009
#define OLD_TIME	4	/* Time when system clock changed.  */
Packit 6c4009
Packit 6c4009
#define INIT_PROCESS	5	/* Process spawned by the init process.  */
Packit 6c4009
#define LOGIN_PROCESS	6	/* Session leader of a logged in user.  */
Packit 6c4009
#define USER_PROCESS	7	/* Normal process.  */
Packit 6c4009
#define DEAD_PROCESS	8	/* Terminated process.  */
Packit 6c4009
Packit 6c4009
#ifdef __USE_GNU
Packit 6c4009
# define ACCOUNTING	9	/* System accounting.  */
Packit 6c4009
#endif