return 0;
}
+static int vt_default_utf8(void) {
+ _cleanup_free_ char *b = NULL;
+ int r;
+
+ /* Read the default VT UTF8 setting from the kernel */
+
+ r = read_one_line_file("/sys/module/vt/parameters/default_utf8", &b);
+ if (r < 0)
+ return r;
+
+ return parse_boolean(b);
+}
+
+static int vt_reset_keyboard(int fd) {
+ int kb;
+
+ /* If we can't read the default, then default to unicode. It's 2017 after all. */
+ kb = vt_default_utf8() != 0 ? K_UNICODE : K_XLATE;
+
+ return RET_NERRNO(ioctl(fd, KDSKBMODE, kb));
+}
+
static int terminal_reset_ioctl(int fd, bool switch_to_text) {
struct termios termios;
int r;
return cached_underline_enabled;
}
-int vt_default_utf8(void) {
- _cleanup_free_ char *b = NULL;
- int r;
-
- /* Read the default VT UTF8 setting from the kernel */
-
- r = read_one_line_file("/sys/module/vt/parameters/default_utf8", &b);
- if (r < 0)
- return r;
-
- return parse_boolean(b);
-}
-
-int vt_reset_keyboard(int fd) {
- int kb;
-
- /* If we can't read the default, then default to unicode. It's 2017 after all. */
- kb = vt_default_utf8() != 0 ? K_UNICODE : K_XLATE;
-
- return RET_NERRNO(ioctl(fd, KDSKBMODE, kb));
-}
-
int vt_restore(int fd) {
static const struct vt_mode mode = {
int openpt_allocate_in_namespace(pid_t pid, int flags, char **ret_slave);
int open_terminal_in_namespace(pid_t pid, const char *name, int mode);
-int vt_default_utf8(void);
-int vt_reset_keyboard(int fd);
int vt_restore(int fd);
int vt_release(int fd, bool restore_vt);