Page MenuHomeFreeBSD

Fix aio system call wrappers in librt.
ClosedPublic

Authored by jhb on Jul 5 2016, 7:53 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sep 23 2024, 6:02 PM
Unknown Object (File)
Sep 16 2024, 7:32 AM
Unknown Object (File)
Sep 16 2024, 7:32 AM
Unknown Object (File)
Sep 16 2024, 7:32 AM
Unknown Object (File)
Sep 16 2024, 7:27 AM
Unknown Object (File)
Sep 15 2024, 4:39 PM
Unknown Object (File)
Sep 8 2024, 10:34 PM
Unknown Object (File)
Aug 23 2024, 2:19 AM
Subscribers

Details

Summary

Fix aio system call wrappers in librt.

  • Update aio_return/waitcomplete wrappers for ssize_t.
  • Fix aio_return() wrapper to fail with EINVAL on a pending job.
Test Plan
  • I haven't written test cases for these, though you almost want to have a version of 'aio_test' that links against librt and a version that doesn't?

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jhb retitled this revision from to Fix aio system call wrappers in librt..
jhb updated this object.
jhb edited the test plan for this revision. (Show Details)
jhb added a reviewer: kib.
kib edited edge metadata.

I am curious about the aio_return() change. My reading is that EINPROGRESS is acceptable outcome for not yet completed iocb.

POSIX says "If the asynchronous I/O operation has not yet completed, the results of aio_return( ) are undefined."

And EINVAL is defined as "The aiocbp argument does not refer to an asynchronous operation whose return status has not yet been retrieved."

I do not object against the change, but wonder for the reasoning behind it.

lib/librt/aio.c
143 ↗(On Diff #18162)

You might fix the style while changing the line (no initialization in declaration).

This revision is now accepted and ready to land.Jul 6 2016, 2:27 AM
In D7120#148480, @kib wrote:

I am curious about the aio_return() change. My reading is that EINPROGRESS is acceptable outcome for not yet completed iocb.

POSIX says "If the asynchronous I/O operation has not yet completed, the results of aio_return( ) are undefined."

And EINVAL is defined as "The aiocbp argument does not refer to an asynchronous operation whose return status has not yet been retrieved."

I do not object against the change, but wonder for the reasoning behind it.

It matches what the kernel does for aio_return(), so it is consistent with using aio_return() if you don't link against librt.

In D7120#148639, @jhb wrote:

It matches what the kernel does for aio_return(), so it is consistent with using aio_return() if you don't link against librt.

This sounds as a good one-line comment addition.

This revision was automatically updated to reflect the committed changes.