Quiz 3

Problem 1 (5 pt)

There are many I/O functions can provide different needs of our program. Some of them will block the user program until data are already copy into user buffer. Some of them will immediately return an error if data are not ready. Please scribe the difference of these I/O functions.

  1. Blocking read()
  2. Non-blocking read()
  3. sigaction()
  4. aio_read()

Answer

  1. Blocking read() will block the user process until data is copied to user buffer.
  2. Non-blocking read() will immediately return an error if data is not available.
  3. sigaction() won’t block user process and send a signal to user process after data is available.
  4. aio_read() won’t block user process and send a signal to user process after data is copied to user buffer.