Results 1 to 4 of 4
Hi all,
I wrote a kernel module and implemented an tty device. Now I reached the testing phase and realized that the read syscall blocks permanently. Even if I write ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 05-30-2010 #1Just Joined!
- Join Date
- May 2010
- Posts
- 5
tty device and tty subsystem - read syscall blocks
Hi all,
I wrote a kernel module and implemented an tty device. Now I reached the testing phase and realized that the read syscall blocks permanently. Even if I write data to the device. I know that the subsystem block the read call if the buffer is empty, but it have to wake up if data occure. It doesn't.
Any ideas?
Best regards
Otix
- 05-31-2010 #2Linux User
- Join Date
- Jan 2005
- Location
- Saint Paul, MN
- Posts
- 396
Look at using the select syscall to detect when a read is needed due to data being present.
- 05-31-2010 #3Just Joined!
- Join Date
- May 2010
- Posts
- 5
I use the poll syscall to notify the userspace, but it have to work without such notification, haven't it?
- 06-02-2010 #4Just Joined!
- Join Date
- May 2010
- Posts
- 5
I got it.
I set the ICANON flag in the struct ktermios. For this reason the subsystem reads data only on the arrival of special characters (NL, EOL, EOF).
see man termios for details.
Best regards
Otix


Reply With Quote
