Find the answer to your Linux question:
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.
  1. #1
    Just 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

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

  3. #3
    Just 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?

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    May 2010
    Posts
    5

    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
  •