Problem using aio functions and D

Stef Bon stefbon@gmail.com
Fri Jan 28 15:45:00 GMT 2011


Hello,

I'm writing a fuse fs, and I want it to make use of aio. Now it's
using normal blocking reads and writes,
and this leads to blocking behaviour.

Since I want my fs to play an important role for a "GoboLinux" like
setup, see for screenshots:

http://linux.bononline.nl/wiki/index.php/Changes_and_issues


Now using various implementations of aio (first libaio) and now posix
aio, I never have been able
to make it run.

To try it I now have a simple program using signalfd, epoll and aio.
It's attached.
This program works very good, at least when it's compiled like:


gcc -Wall -D_GNU_SOURCE -lrt testsignal.c -o testsignal


It's a advanced version of the test program found in the manpage of signalfd.

now test it:

./testsignal
mainloop: adding signalfd 4 to epoll
^CGot SIGINT: start the test aio read.


the progress in logfile:

Jan 28 11:58:08 clfs20091030 testsignal: aio_read_file
Jan 28 11:58:08 clfs20091030 testsignal: aio_read return: 0
Jan 28 11:58:08 clfs20091030 testsignal: mainloop aio read, no error,
nbytes: 14196767
Jan 28 11:58:08 clfs20091030 testsignal: aio_write_file
Jan 28 11:58:08 clfs20091030 testsignal: aio_write return: 0
Jan 28 11:58:08 clfs20091030 testsignal: mainloop aio write, no error,
nbytes: 14196767


This is as expected.

Now when I compile it using the -D_FILE_OFFSET_BITS=64


gcc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -lrt testsignal.c -o testsignal


the log when Ctrl-C is pressed (and the aio read is strarted:)

Jan 28 11:50:27 clfs20091030 testsignal: aio_read_file
Jan 28 11:50:27 clfs20091030 testsignal: aio_read return: 0
Jan 28 11:50:27 clfs20091030 testsignal: unknown aio opcode 128


Someone an idea??

Thanks in advance. This is maybe the problem with making aio work with fuse.
Fuse must be compiled using the -D_FILE_... flag.

Stef
-------------- next part --------------
A non-text attachment was scrubbed...
Name: testsignal.c
Type: text/x-csrc
Size: 6364 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-help/attachments/20110128/879f9f64/attachment.bin>


More information about the Libc-help mailing list