Skip to contentSkip to conversation

Design for setting video modes, ownership of sysfs attributes

DISCUSSION Pascal Schmidt 2 participants 3 messages Sep 19, 2004 2 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw

On Sun, 19 Sep 2004 12:00:21 +0200, you wrote in linux.kernel:

Quoted 1 line

The FDs 0, 1 and posibly 2 will be the console.

*The* console? They can all be connected to different console devices (think redirection). I'd think for video mode questions, you'd look at stdout...

Signature · 2 lines
Ciao,
Pascal
#3 lore raw
Quoted 6 lines · Pascal Schmidt

On Sun, 19 Sep 2004 12:00:21 +0200, you wrote in linux.kernel:

Quoted 1 line

The FDs 0, 1 and posibly 2 will be the console.

*The* console? They can all be connected to different console devices (think redirection). I'd think for video mode questions, you'd look at stdout...

Early versions of stty made that mistake - to find out what settings your printers had, you ended up printing the output of stty on paper.

If you're going to subvert an fd, use stdin, not stdout. stdin is less valuable most commands use argv rather than stdin, and it allows you to retreive the output of a command using the shell backtick operators.

Peter

#4 lore raw
Quoted 4 lines · P. Benie

If you're going to subvert an fd, use stdin, not stdout. stdin is less valuable most commands use argv rather than stdin, and it allows you to retreive the output of a command using the shell backtick operators.

The point is, you need to make a choice if you want to infer the tty from an fd. You can't assume stdin and stdout point to the same console. And if we talk about video mode settings, why would I want to use the fd that the command gets keyboard input from?

The shell backtick obviously uses stdout of the command inside the backticks. ;)

Signature · 2 lines
Ciao,
Pascal