Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8340215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T05:07:10+00:00 2026-06-09T05:07:10+00:00

I am working on serial port application on Linux , when select () api

  • 0

I am working on serial port application on Linux , when select () api is checked for data on waiting handles it returns positive value once data arrives on port but read() api call returns -1 , how can this possible?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T05:07:11+00:00Added an answer on June 9, 2026 at 5:07 am

    Here is what man pages say about select:

    select() and pselect() allow a program to monitor multiple file
    descriptors, waiting until one or more of the file descriptors become
    “ready” for some class of I/O operation (e.g., input possible). A file
    descriptor is considered ready if it is possible to perform the
    corresponding I/O operation (e.g., read(2)) without blocking.

    If there is an error condition on a file descriptor (RST segment received for a network sockets, for example), the only way to notify the process that is currently blocked in select is to make this descriptor ready for IO. The subsequent read/write function will return an error so that the application can handle it.

    This behavior looks compliant with what select promises – flag a descriptor as ready if you can perform a non-blocking IO on it (however, there are some cases with network sockets, when a descriptor is flagged as ready for read, but the subsequent read operation blocks). You don’t block on read – an error is returned immediately.

    As for the return status of select, it should only return the number of “ready events” for the file descriptors in all sets. It can be negative if select itself fails (interrupted by a system call, for example – errno == EINTR), but not when some errors on the descriptors being watched occur.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am reading data from a scale using a serial port. Communication is working
I'm working on serial port, transmitting and receiving data to some hardware at 8bit
I'm working on an application that connects to a serial port. I have experience
I am working on a project with serial port. I want to Write command
I working with serial frames. I'm receiving a 16-bit value as two separate 8-bit
I am working on a multi threaded server application for processing serial/USB ports. The
I'm working on an embedded system and it uses one serial port for all
I'm working in Visual Studio C#, and I opened up a serial port, but
I wrote an application that must use serial ports on Linux, especially ttyUSB ones.
I've got an old legacy application for communicating via serial port to an embedded

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.