안녕하세요...
/dev/tty.... 를 이용해서 특정터미널로 메세지를 보낼수 있을것 같아서..
아래같은 소스를 만들었거든요...
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
main()
{
char *strs="Hello, World!";
int fd;
fd=open ("/dev/tty1", O_RDWR);
printf ("TTYNAME : %s", ttyname(fd));
printf ("ISATTY : %d", isatty(fd));
write (fd, strs, strlen(strs));
close(fd);
}
실행하면 tty1 를 사용하는 사람 화면에 Hello, World! 라고 출력될것을
기대했는데 안되네요...
왜 안되는건지... /dev/tty... 에 기록을 한다는 것은 무슨 의미인지...
그리고 /dev/tty... 에서 내용을 읽는 다는것은 또 무슨 의미인지...
알고싶어요~