current status of Async I/O (io_submit & friends) on pipes

From: Hillier, Gernot
Date: Wed Nov 07 2007 - 11:10:12 EST


Is the content of still correct
regarding support of pipes? Is there any up-to-date & authoritative
interface description of io_submit & friends available?

This page tells me I'd receive EINVAL or the like when using async I/O
on a pipe; however what I actually see on e.g. is no error
return, but an indefinite blocking in the io_submit syscall when the
pipe is empty.

Is this expected behaviour?

Please put me on CC for any answer.

Here's a short snippet showing the behaviour. (link it against libaio -
yes, I checked that libaio does nothing else than wrapping the syscalls).

------ SNIP -----

#include <unistd.h>
#include <stdio.h>
#include <errno.h>
#include <libaio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

int main() {
int filedes[2];
char buf;
io_context_t *ctx;
struct iocb * cb;

ctx=(io_context_t *)malloc(sizeof(io_context_t));
cb=(struct iocb *)malloc(1*sizeof(struct iocb));
memset(cb,0,1*sizeof(struct iocb));



printf("before read\n");
/* program will block here */
printf("io_submit %i\n",io_submit(*ctx,1,&cb));
printf("read completed\n");

Gernot Hillier

Siemens AG, CT SE 2
Corporate Competence Center Embedded Linux

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at