Reinitialize _create_xid state after fork.
[glibc.git] / login / utmp-private.h
blob83b344150c4f2303f0272abbeca735bc97f76ac3
1 /* Internal definitions and declarations for UTMP functions.
2 Copyright (C) 1996, 2000, 2002, 2004 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4 Contributed by Ulrich Drepper <drepper@cygnus.com>
5 and Paul Janzen <pcj@primenet.com>, 1996.
7 The GNU C Library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or (at your option) any later version.
12 The GNU C Library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
17 You should have received a copy of the GNU Lesser General Public
18 License along with the GNU C Library; if not, write to the Free
19 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20 02111-1307 USA. */
22 #ifndef _UTMP_PRIVATE_H
23 #define _UTMP_PRIVATE_H 1
25 #include <utmp.h>
26 #include <bits/libc-lock.h>
28 /* The structure describing the functions in a backend. */
29 struct utfuncs
31 int (*setutent) (void);
32 int (*getutent_r) (struct utmp *, struct utmp **);
33 int (*getutid_r) (const struct utmp *, struct utmp *, struct utmp **);
34 int (*getutline_r) (const struct utmp *, struct utmp *, struct utmp **);
35 struct utmp *(*pututline) (const struct utmp *);
36 void (*endutent) (void);
37 int (*updwtmp) (const char *, const struct utmp *);
40 /* The tables from the services. */
41 extern const struct utfuncs __libc_utmp_file_functions attribute_hidden;
42 extern const struct utfuncs __libc_utmp_unknown_functions attribute_hidden;
44 /* Currently selected backend. */
45 extern const struct utfuncs *__libc_utmp_jump_table attribute_hidden;
47 /* Current file name. */
48 extern const char *__libc_utmp_file_name attribute_hidden;
50 /* Locks access to the global data. */
51 __libc_lock_define (extern, __libc_utmp_lock attribute_hidden)
54 #endif /* utmp-private.h */