Both stdin and stdout file descriptors point to it. How does it work? Can some one point to a good resource for understanding UNIX terminals and system calls that interact with it.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
dev/ttyis a file system object that represents the current console. Copying files into this “directory” from the command line prints out the content of these files to your console:is equivalent to
These objects are there to let you use the familiar file APIs to interact with console. It is a clever way to unify console API with file API. You can use
fopen,fprintf, etc. to interact with the console in the same way that you interact with regular files.This example writes
"Hello, world\n"to the terminal: