lkml.org 
[lkml]   [2002]   [Aug]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectProblem : can't make pipe non-blocking on 2.5.X
From
	Hi,

I've got the following problem : I can't make a pipe
non-blocking with 2.5.25.
The various man pages don't mention anything
about it (actually, the "fifo" man page say that non-blocking mode
should succeed). And it seems to work fine on 2.4.20.
Sorry if this has already been reported and fixed, but I
quicly searched the changelog and archive and found nothing.

So, who should I complain to ?

------------- Setup ------------------------
Kernel : 2.5.25 fails (but 2.4.20-pre2 works)
Distrib : Debian 3.0
libc : 2.2.5
------------- Test program -----------------
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <stdio.h>

int main()
{
int trigger_pipe[2];
int err;
int flags;

pipe(trigger_pipe);

err = fcntl(trigger_pipe[0], F_GETFL, &flags);
fprintf(stderr, "GET FLAGS : %d - %X\n", err, flags);
if(err >= 0)
{
flags |= O_NONBLOCK;
err = fcntl(trigger_pipe[0], F_SETFL, flags);
fprintf(stderr, "SET FLAGS : %d - %d\n", err, errno);
}
return(0);
}
------------- Output 2.5.25 ----------------
GET FLAGS : 0 - 40045F18
SET FLAGS : -1 - 22
------------- Output 2.4.20-pre2 -----------
GET FLAGS : 0 - 40043F18
SET FLAGS : 0 - 0
--------------------------------------------

Have fun...

Jean
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:28    [W:0.101 / U:2.392 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site