Switching the current console

% The current console is switched through invocation of the function <#2675#> change_console()<#2675#>, which resides in <#2676#> tty_io.c<#2676#> and is invoked by both <#2677#> keyboard.c<#2677#> and <#2678#> vt.c<#2678#> (the former switches console in response to key presses, the latter when a program requests it by invoking an <#2679#> ioctl()<#2679#> call). The actual switching process is performed in two steps, and the function <#2680#> complete_change_console()<#2680#> takes care of the second part of it. Splitting the switch is meant to complete the task after a possible handshake with the process controlling the tty we're leaving. If the console is not under process control, <#2681#> change_console()<#2681#> calls <#2682#> complete_change_console()<#2682#> by itself. Process intervention is needed to successfully switch from a graphic console to a text one and vice-versa, and the X server (for example) is the controlling process of its own graphic console.