Async IO in Linux...

Async IO in Linux...

Post by Kevin Bear » Sat, 22 Jul 2000 04:00:00



Just wondering if anyone knows why this code SIGSEGV's under Linux
It compiles under both Solaris2.6 and Linux (Redhat 6.2 kernel? 2.2.14-5)
but only gets errors on Linux.
I understand that Linux complies with POSIX4 (POSIX1b):

main()
{
?? for(counter=0; counter<NUM_OF_AIOCBS; counter++)
?? {
????? out_data[counter] = (char*)malloc(sizeof(char)+2);
????? sprintf(out_data[counter], "%1.1d\n", counter);
????? printf("%s", out_data[counter]);
?? }
?? for(counter=0; counter<NUM_OF_AIOCBS; counter++)
?? {
????? async_ctrl_blk[counter] = (aiocb*)malloc(sizeof(aiocb_t));
????? async_ctrl_blk[counter]->aio_fildes = open(FILENAME,O_RDWR | O_APPEND
| O_CREAT, 0666);
????? async_ctrl_blk[counter]->aio_offset = 0;
????? async_ctrl_blk[counter]->aio_lio_opcode = LIO_WRITE;
????? async_ctrl_blk[counter]->aio_buf = out_data[counter];
????? async_ctrl_blk[counter]->aio_nbytes = sizeof(char)+2;
?? }

?? if (lio_listio(LIO_NOWAIT, async_ctrl_blk, NUM_OF_AIOCBS, NULL) < 0 )
????? perror("lio_listio");
?? aio_suspend(async_ctrl_blk,NUM_OF_AIOCBS,NULL);

Quote:}

 
 
 

Async IO in Linux...

Post by Kevin Bear » Sat, 22 Jul 2000 04:00:00


Just wondering if anyone knows why this code SIGSEGV's under Linux
It compiles under both Solaris2.6 and Linux (Redhat 6.2 kernel? 2.2.14-5)
but only gets errors on Linux.
I understand that Linux complies with POSIX4 (POSIX1b):

main()
{
?? for(counter=0; counter<NUM_OF_AIOCBS; counter++)
?? {
????? out_data[counter] = (char*)malloc(sizeof(char)+2);
????? sprintf(out_data[counter], "%1.1d\n", counter);
????? printf("%s", out_data[counter]);
?? }
?? for(counter=0; counter<NUM_OF_AIOCBS; counter++)
?? {
????? async_ctrl_blk[counter] = (aiocb*)malloc(sizeof(aiocb_t));
????? async_ctrl_blk[counter]->aio_fildes = open(FILENAME,O_RDWR | O_APPEND
| O_CREAT, 0666);
????? async_ctrl_blk[counter]->aio_offset = 0;
????? async_ctrl_blk[counter]->aio_lio_opcode = LIO_WRITE;
????? async_ctrl_blk[counter]->aio_buf = out_data[counter];
????? async_ctrl_blk[counter]->aio_nbytes = sizeof(char)+2;
?? }
?? if (lio_listio(LIO_NOWAIT, async_ctrl_blk, NUM_OF_AIOCBS, NULL) < 0 )
????? perror("lio_listio");
?? aio_suspend(async_ctrl_blk,NUM_OF_AIOCBS,NULL);

Quote:}


 
 
 

1. Async IO calls - Linux implementations?

I am attempting to port an application that uses asynchronous disk I/O
calls. It is currently implemented on Solaris and other platforms where
aioread/aiowrite/aiocancel/aiowait (solaris) and lio_listio() functions
are implmented.

Are there any implementations of async I/O for Linux 2.x?

Thanks!

Robert

2. vgastate warning

3. Linux and async IO?

4. APCC UPS software needed

5. Async IO in Linux and SGI's KAIO

6. bzImage VS zImage

7. Async IO in Linux...

8. Async IO in Linux?

9. More Oracle Async IO

10. async-io API registration for 2.5.29

11. Tuning Async IO