I wrote the following code:
First application
int efd = eventfd(0,0);
const char* pipeName="//dev//pipes//fifo_server";
int ret = mkfifo(pipeName,0666);
int fifo_server = open(pipeName,O_WRONLY);
int ret1 = ioctl(fifo_server, I_SENDFD, efd);
Second application
const char* pipeName="//dev//pipes//fifo_server";
int fifo_server = open(pipeName,O_RDONLY);
int ret1 = ioctl(fifo_server, I_RECVFD, &evfd);
The pipe is created and opened but when calling ioctl()
, I get in errno
the value ENOTTY in either of the applications.
Anyone has any idea why?