There is better solution in the 11.GalileoLinux package. The LinuxUSBShell sketch the way to go!
void setup() {
system("sed -i 's/S:2345/S0:2345/g' /etc/inittab");
system("sed -i 's/ttyS1/ttyGS0/g' /etc/inittab");
system("sed -i 's/grst/#grst/g' /etc/inittab");
system("sed -i 's/clld/#clld/g' /etc/inittab");
system("kill -SIGHUP 1");
}
I've connected cable (RS-232 -> TTL) to UART1, so just need to change ttyGS0 by ttyS0. It's working like a real console.