Find the answer to your Linux question:
Results 1 to 4 of 4
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    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

  2. #2
    Linux Engineer
    Join Date
    Jan 2005
    Location
    Saint Paul, MN
    Posts
    792
    Look at using the select syscall to detect when a read is needed due to data being present.

  3. #3
    I use the poll syscall to notify the userspace, but it have to work without such notification, haven't it?

  4. $spacer_open
    $spacer_close
  5. #4

    Thumbs up

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •