RTEMS | Draft: posix/aio: Implemented aio_suspend() (!275)

Alessandro Nardin (@AlessandroNardin) gitlab at rtems.org
Mon Nov 4 20:20:00 UTC 2024




Alessandro Nardin commented on a discussion on cpukit/posix/src/aio_suspend.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/275#note_114326

 > +  suspendcb *suspendcbp;
 > +  int result, op_num;
 > +
 > +  /* CONTROLS OVER INVALID PARAMETERS */
 > +  if ( list == NULL ){
 > +    rtems_set_errno_and_return_minus_one( EINVAL );
 > +  }
 > +
 > +  if ( nent <= 0 ) {
 > +    rtems_set_errno_and_return_minus_one( EINVAL );
 > +  }
 > +
 > +  /* INITAILIZE SUSPEND CB */
 > +  suspendcbp = malloc( sizeof( suspendcb ) );
 > +  if ( suspendcbp == NULL ) {
 > +    rtems_set_errno_and_return_minus_one( EAGAIN );

I used EAGAIN because it’s also used in other AIO methods, so I thought I could apply the same approach here. For example in aio_write there is:
```
[EAGAIN]
    The requested asynchronous I/O operation was not queued due to system resource limitations.
```
However, the use case here is slightly different. Would it be better to change it to ENOMEM instead?

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/275#note_114326
You're receiving this email because of your account on gitlab.rtems.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20241104/cf7f3ed9/attachment.htm>


More information about the bugs mailing list