* Problem : can't make pipe non-blocking on 2.5.X
@ 2002-08-14 18:19 Jean Tourrilhes
2002-08-14 18:43 ` Richard B. Johnson
2002-08-14 21:46 ` OGAWA Hirofumi
0 siblings, 2 replies; 5+ messages in thread
From: Jean Tourrilhes @ 2002-08-14 18:19 UTC (permalink / raw)
To: Linux kernel mailing list
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Problem : can't make pipe non-blocking on 2.5.X
2002-08-14 18:19 Problem : can't make pipe non-blocking on 2.5.X Jean Tourrilhes
@ 2002-08-14 18:43 ` Richard B. Johnson
2002-08-14 18:54 ` Jean Tourrilhes
2002-08-14 21:46 ` OGAWA Hirofumi
1 sibling, 1 reply; 5+ messages in thread
From: Richard B. Johnson @ 2002-08-14 18:43 UTC (permalink / raw)
To: jt; +Cc: Linux kernel mailing list
On Wed, 14 Aug 2002, Jean Tourrilhes wrote:
>
> pipe(trigger_pipe);
>
if((flags = fcntl(trigger_pipe[0], F_GETFL)) != -1);
flags &= ~O_NDELAY;
fcntl(trigger_pipe[0], F_SETFL, flags);
Cheers,
Dick Johnson
Penguin : Linux version 2.4.19 on an i686 machine (797.90 BogoMips).
The US military has given us many words, FUBAR, SNAFU, now ENRON.
Yes, top management were graduates of West Point and Annapolis.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Problem : can't make pipe non-blocking on 2.5.X
2002-08-14 18:43 ` Richard B. Johnson
@ 2002-08-14 18:54 ` Jean Tourrilhes
0 siblings, 0 replies; 5+ messages in thread
From: Jean Tourrilhes @ 2002-08-14 18:54 UTC (permalink / raw)
To: Richard B. Johnson; +Cc: Linux kernel mailing list
On Wed, Aug 14, 2002 at 02:43:01PM -0400, Richard B. Johnson wrote:
> On Wed, 14 Aug 2002, Jean Tourrilhes wrote:
>
> >
> > pipe(trigger_pipe);
> >
> if((flags = fcntl(trigger_pipe[0], F_GETFL)) != -1);
> flags &= ~O_NDELAY;
> fcntl(trigger_pipe[0], F_SETFL, flags);
Same error. Please try again.
Jean
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Problem : can't make pipe non-blocking on 2.5.X
2002-08-14 18:19 Problem : can't make pipe non-blocking on 2.5.X Jean Tourrilhes
2002-08-14 18:43 ` Richard B. Johnson
@ 2002-08-14 21:46 ` OGAWA Hirofumi
2002-08-14 21:52 ` Jean Tourrilhes
1 sibling, 1 reply; 5+ messages in thread
From: OGAWA Hirofumi @ 2002-08-14 21:46 UTC (permalink / raw)
To: jt; +Cc: Linux kernel mailing list
Jean Tourrilhes <jt@bougret.hpl.hp.com> writes:
> 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 ?
>
[...]
> err = fcntl(trigger_pipe[0], F_GETFL, &flags);
F_GETFL should be,
flags = fcntl(trigger_pipe[0], F_GETFL, 0);
> 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
> --------------------------------------------
Looks like effect of different implement of O_DIRECT(0x40000).
Thanks.
--
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Problem : can't make pipe non-blocking on 2.5.X
2002-08-14 21:46 ` OGAWA Hirofumi
@ 2002-08-14 21:52 ` Jean Tourrilhes
0 siblings, 0 replies; 5+ messages in thread
From: Jean Tourrilhes @ 2002-08-14 21:52 UTC (permalink / raw)
To: OGAWA Hirofumi; +Cc: Linux kernel mailing list
On Thu, Aug 15, 2002 at 06:46:18AM +0900, OGAWA Hirofumi wrote:
>
> F_GETFL should be,
> flags = fcntl(trigger_pipe[0], F_GETFL, 0);
Oups. I'll fix that. Thanks !
> > ------------- 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
> > --------------------------------------------
>
> Looks like effect of different implement of O_DIRECT(0x40000).
> Thanks.
Work in progress, I guess. Thanks...
Jean
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2002-08-14 21:48 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-14 18:19 Problem : can't make pipe non-blocking on 2.5.X Jean Tourrilhes
2002-08-14 18:43 ` Richard B. Johnson
2002-08-14 18:54 ` Jean Tourrilhes
2002-08-14 21:46 ` OGAWA Hirofumi
2002-08-14 21:52 ` Jean Tourrilhes
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®