diff options
-rw-r--r-- | apps/examples/ostest/aio.c | 18 | ||||
-rw-r--r-- | nuttx/include/aio.h | 4 |
2 files changed, 13 insertions, 9 deletions
diff --git a/apps/examples/ostest/aio.c b/apps/examples/ostest/aio.c index 81db8440a..68b94228f 100644 --- a/apps/examples/ostest/aio.c +++ b/apps/examples/ostest/aio.c @@ -322,7 +322,7 @@ void aio_test(void) do { - sleep(1); + usleep(500*1000); ret = check_done(); } while (ret < 0); @@ -336,7 +336,7 @@ void aio_test(void) * task end of the last test case -- especially the dangling SIGPOLL. */ - sleep(1); + usleep(500*1000); printf("AIO test case 2: Use LIO_WAIT for transfer complete\n"); g_fildes = open(AIO_FILEPATH, O_RDWR|O_CREAT|O_TRUNC); @@ -370,7 +370,7 @@ void aio_test(void) * task end of the last test case -- especially the dangling SIGPOLL. */ - sleep(1); + usleep(500*1000); printf("AIO test case 3: Use aio_suspend for transfer complete\n"); g_fildes = open(AIO_FILEPATH, O_RDWR|O_CREAT|O_TRUNC); @@ -430,7 +430,7 @@ void aio_test(void) * task end of the last test case -- especially the dangling SIGPOLL. */ - sleep(1); + usleep(500*1000); printf("AIO test case 4: Use individual signals for transfer complete\n"); g_fildes = open(AIO_FILEPATH, O_RDWR|O_CREAT|O_TRUNC); @@ -488,7 +488,7 @@ void aio_test(void) * task end of the last test case -- especially the dangling SIGPOLL. */ - sleep(1); + usleep(500*1000); printf("AIO test case 5: Use list complete signal for transfer complete\n"); g_fildes = open(AIO_FILEPATH, O_RDWR|O_CREAT|O_TRUNC); @@ -546,7 +546,7 @@ void aio_test(void) * task end of the last test case -- especially the dangling SIGPOLL. */ - sleep(1); + usleep(500*1000); printf("AIO test case 6: Cancel I/O by AIO control block\n"); g_fildes = open(AIO_FILEPATH, O_RDWR|O_CREAT|O_TRUNC); @@ -575,7 +575,7 @@ void aio_test(void) do { - sleep(1); + usleep(500*1000); ret = check_done(); } while (ret < 0); @@ -589,7 +589,7 @@ void aio_test(void) * task end of the last test case -- especially the dangling SIGPOLL. */ - sleep(1); + usleep(500*1000); printf("AIO test case 7:Cancel I/O by file descriptor\n"); g_fildes = open(AIO_FILEPATH, O_RDWR|O_CREAT|O_TRUNC); @@ -618,7 +618,7 @@ void aio_test(void) do { - sleep(1); + usleep(500*1000); ret = check_done(); } while (ret < 0); diff --git a/nuttx/include/aio.h b/nuttx/include/aio.h index aff1e0093..b323e01b3 100644 --- a/nuttx/include/aio.h +++ b/nuttx/include/aio.h @@ -125,7 +125,11 @@ struct aiocb FAR volatile void *aio_buf; /* Location of buffer */ off_t aio_offset; /* File offset */ size_t aio_nbytes; /* Length of transfer */ +#if CONFIG_NFILE_DESCRIPTORS > 127 int16_t aio_fildes; /* File descriptor (should be int) */ +#else + int8_t aio_fildes; /* File descriptor (should be int) */ +#endif int8_t aio_reqprio; /* Request priority offset (not used, should be int) */ uint8_t aio_lio_opcode; /* Operation to be performed (should be int) */ |