Blame login/utmp.h

Packit 6c4009
/* Copyright (C) 1993-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	_UTMP_H
Packit 6c4009
#define	_UTMP_H	1
Packit 6c4009
Packit 6c4009
#include <features.h>
Packit 6c4009
Packit 6c4009
#include <sys/types.h>
Packit 6c4009
Packit 6c4009
Packit 6c4009
__BEGIN_DECLS
Packit 6c4009
Packit 6c4009
/* Get system dependent values and data structures.  */
Packit 6c4009
#include <bits/utmp.h>
Packit 6c4009
Packit 6c4009
/* Compatibility names for the strings of the canonical file names.  */
Packit 6c4009
#define UTMP_FILE	_PATH_UTMP
Packit 6c4009
#define UTMP_FILENAME	_PATH_UTMP
Packit 6c4009
#define WTMP_FILE	_PATH_WTMP
Packit 6c4009
#define WTMP_FILENAME	_PATH_WTMP
Packit 6c4009
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Make FD be the controlling terminal, stdin, stdout, and stderr;
Packit 6c4009
   then close FD.  Returns 0 on success, nonzero on error.  */
Packit 6c4009
extern int login_tty (int __fd) __THROW;
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Write the given entry into utmp and wtmp.  */
Packit 6c4009
extern void login (const struct utmp *__entry) __THROW;
Packit 6c4009
Packit 6c4009
/* Write the utmp entry to say the user on UT_LINE has logged out.  */
Packit 6c4009
extern int logout (const char *__ut_line) __THROW;
Packit 6c4009
Packit 6c4009
/* Append to wtmp an entry for the current time and the given info.  */
Packit 6c4009
extern void logwtmp (const char *__ut_line, const char *__ut_name,
Packit 6c4009
		     const char *__ut_host) __THROW;
Packit 6c4009
Packit 6c4009
/* Append entry UTMP to the wtmp-like file WTMP_FILE.  */
Packit 6c4009
extern void updwtmp (const char *__wtmp_file, const struct utmp *__utmp)
Packit 6c4009
     __THROW;
Packit 6c4009
Packit 6c4009
/* Change name of the utmp file to be examined.  */
Packit 6c4009
extern int utmpname (const char *__file) __THROW;
Packit 6c4009
Packit 6c4009
/* Read next entry from a utmp-like file.  */
Packit 6c4009
extern struct utmp *getutent (void) __THROW;
Packit 6c4009
Packit 6c4009
/* Reset the input stream to the beginning of the file.  */
Packit 6c4009
extern void setutent (void) __THROW;
Packit 6c4009
Packit 6c4009
/* Close the current open file.  */
Packit 6c4009
extern void endutent (void) __THROW;
Packit 6c4009
Packit 6c4009
/* Search forward from the current point in the utmp file until the
Packit 6c4009
   next entry with a ut_type matching ID->ut_type.  */
Packit 6c4009
extern struct utmp *getutid (const struct utmp *__id) __THROW;
Packit 6c4009
Packit 6c4009
/* Search forward from the current point in the utmp file until the
Packit 6c4009
   next entry with a ut_line matching LINE->ut_line.  */
Packit 6c4009
extern struct utmp *getutline (const struct utmp *__line) __THROW;
Packit 6c4009
Packit 6c4009
/* Write out entry pointed to by UTMP_PTR into the utmp file.  */
Packit 6c4009
extern struct utmp *pututline (const struct utmp *__utmp_ptr) __THROW;
Packit 6c4009
Packit 6c4009
Packit 6c4009
#ifdef	__USE_MISC
Packit 6c4009
/* Reentrant versions of the file for handling utmp files.  */
Packit 6c4009
extern int getutent_r (struct utmp *__buffer, struct utmp **__result) __THROW;
Packit 6c4009
Packit 6c4009
extern int getutid_r (const struct utmp *__id, struct utmp *__buffer,
Packit 6c4009
		      struct utmp **__result) __THROW;
Packit 6c4009
Packit 6c4009
extern int getutline_r (const struct utmp *__line,
Packit 6c4009
			struct utmp *__buffer, struct utmp **__result) __THROW;
Packit 6c4009
Packit 6c4009
#endif	/* Use misc.  */
Packit 6c4009
Packit 6c4009
__END_DECLS
Packit 6c4009
Packit 6c4009
#endif /* utmp.h  */