[lkml]   [2004]   [Aug]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Fork and Exec a process within the kernel
On Tue, Aug 10, 2004 at 03:03:08PM -0400, Richard B. Johnson wrote:
> /dev/console is a symlink to /dev/tty0.

Please don't mislead newbies, Richard. /dev/console is NOT a link to
/dev/tty0, it's a completely different device:

erik@abra2:~ >ls -l /dev/console
crw------- 1 root tty 5, 1 Apr 7 09:13 /dev/console
erik@abra2:~ >ls -l /dev/tty0
crw------- 1 root tty 4, 0 Feb 10 2000 /dev/tty0

On x86 desktop systems console output usually comes on the virtual
terminals, but you can also use serial console. My embedded StrongARM
board only has serial console.

> struct termios term;
> tcgetattr(0, &term); // Get old terminal characteristics
> (void)close(0); // Close old terminal(s)
> (void)close(1);
> (void)close(2);
> fd = open("/dev/console", O_RDWR);

And what happens when you have console on a device that's not a serial
port like a line printer?


+-- Erik Mouw -- -- +31 70 370 12 90 --
| Lab address: Delftechpark 26, 2628 XH, Delft, The Netherlands
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 14:05    [W:0.089 / U:40.440 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site