]> git.ipfire.org Git - thirdparty/util-linux.git/blob - login-utils/sulogin-consoles.h
last: do not use non-standard __UT_NAMESIZE
[thirdparty/util-linux.git] / login-utils / sulogin-consoles.h
1 /*
2 * consoles.h Header file for routines to detect the system consoles
3 *
4 * Copyright (c) 2011 SuSE LINUX Products GmbH, All rights reserved.
5 * Copyright (c) 2012 Werner Fink <werner@suse.de>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2, or (at your option)
10 * any later version.
11 *
12 * This program 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
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program (see the file COPYING); if not, write to the
19 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
20 * MA 02110-1301, USA.
21 *
22 * Author: Werner Fink <werner@suse.de>
23 */
24 #ifndef UTIL_LINUX_SULOGIN_CONSOLES_H
25 #define UTIL_LINUX_SULOGIN_CONSOLES_H
26
27 #include <sys/types.h>
28 #include <stdint.h>
29 #include <stdio.h>
30 #include <termios.h>
31
32 #include "list.h"
33 #include "ttyutils.h"
34
35 struct console {
36 struct list_head entry;
37 char *tty;
38 FILE *file;
39 uint32_t flags;
40 int fd, id;
41 #define CON_SERIAL 0x0001
42 #define CON_NOTTY 0x0002
43 pid_t pid;
44 struct chardata cp;
45 struct termios tio;
46 };
47
48 extern int detect_consoles(const char *device, int fallback,
49 struct list_head *consoles);
50
51 extern void emergency_do_umounts(void);
52 extern void emergency_do_mounts(void);
53
54 #endif /* UTIL_LINUX_SULOGIN_CONSOLES_H */