linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUG 2.5.X] pipe/fcntl/F_GETFL/F_SETFL obvious kernel bug
@ 2003-04-24 18:33 Jean Tourrilhes
  2003-04-24 21:23 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Jean Tourrilhes @ 2003-04-24 18:33 UTC (permalink / raw)
  To: Linux kernel mailing list, Jeff Garzik, davem, kuznet

	Hi,

	I reported this obvious kernel 2.5.X bug 6 months ago, and as
of 2.5.67 it is still not fixed. Do you know who I should send this
bug report to ?
	Thanks...

	Jean

---------------------------------------------
	Compile test program below.
	On 2.5.67 :
GET FLAGS : 0 - 40044F18
SET FLAGS : -1 - 22
	On 2.4.21-pre7 :
GET FLAGS : 0 - 40043F18
SET FLAGS : 0 - 0
---------------------------------------------
#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;
      //flags |= O_NDELAY;
      //flags &= ~O_NDELAY;
      err = fcntl(trigger_pipe[0], F_SETFL, flags);
      fprintf(stderr, "SET FLAGS : %d - %d\n", err, errno);
    }
  return(0);
}



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [BUG 2.5.X] pipe/fcntl/F_GETFL/F_SETFL obvious kernel bug
  2003-04-24 18:33 [BUG 2.5.X] pipe/fcntl/F_GETFL/F_SETFL obvious kernel bug Jean Tourrilhes
@ 2003-04-24 21:23 ` Andrew Morton
  2003-04-24 21:35   ` Jean Tourrilhes
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2003-04-24 21:23 UTC (permalink / raw)
  To: jt; +Cc: jt, linux-kernel, jgarzik, davem, kuznet

Jean Tourrilhes <jt@bougret.hpl.hp.com> wrote:
>
> 	Hi,
> 
> 	I reported this obvious kernel 2.5.X bug 6 months ago, and as
> of 2.5.67 it is still not fixed. Do you know who I should send this
> bug report to ?

fcntl(fd, F_GETFL, intp) does not put the return value into *intp.  The
flags are in fcntl()'s return value.  Same with 2.4.

#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <stdio.h>

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

	pipe(trigger_pipe);

	/* Get flags */
	flags = fcntl(trigger_pipe[0], F_GETFL, NULL);
	fprintf(stderr, "Set flags: 0x%x\n", flags);

	/* Set flags */
	flags |= O_NONBLOCK;
	err = fcntl(trigger_pipe[0], F_SETFL, flags);
	fprintf(stderr, "Set flags: %d\n", err);

	/* Check flags */
	flags = fcntl(trigger_pipe[0], F_GETFL, NULL);
	fprintf(stderr, "Get flags: 0x%0x\n", flags);
}


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [BUG 2.5.X] pipe/fcntl/F_GETFL/F_SETFL obvious kernel bug
  2003-04-24 21:23 ` Andrew Morton
@ 2003-04-24 21:35   ` Jean Tourrilhes
  0 siblings, 0 replies; 3+ messages in thread
From: Jean Tourrilhes @ 2003-04-24 21:35 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, jgarzik, davem, kuznet

On Thu, Apr 24, 2003 at 02:23:06PM -0700, Andrew Morton wrote:
> Jean Tourrilhes <jt@bougret.hpl.hp.com> wrote:
> >
> > 	Hi,
> > 
> > 	I reported this obvious kernel 2.5.X bug 6 months ago, and as
> > of 2.5.67 it is still not fixed. Do you know who I should send this
> > bug report to ?
> 
> fcntl(fd, F_GETFL, intp) does not put the return value into *intp.  The
> flags are in fcntl()'s return value.  Same with 2.4.

	*blush*. Thanks for the quick and precise answer, and sorry
about the noise.

	Jean

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-04-24 21:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-24 18:33 [BUG 2.5.X] pipe/fcntl/F_GETFL/F_SETFL obvious kernel bug Jean Tourrilhes
2003-04-24 21:23 ` Andrew Morton
2003-04-24 21:35   ` Jean Tourrilhes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).