All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@digeo.com>
To: jt@hpl.hp.com
Cc: jt@bougret.hpl.hp.com, linux-kernel@vger.kernel.org,
	jgarzik@pobox.com, davem@redhat.com, kuznet@ms2.inr.ac.ru
Subject: Re: [BUG 2.5.X] pipe/fcntl/F_GETFL/F_SETFL obvious kernel bug
Date: Thu, 24 Apr 2003 14:23:06 -0700	[thread overview]
Message-ID: <20030424142306.4510d10f.akpm@digeo.com> (raw)
In-Reply-To: <20030424183313.GA17374@bougret.hpl.hp.com>

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);
}


  reply	other threads:[~2003-04-24 21:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2003-04-24 21:35   ` Jean Tourrilhes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030424142306.4510d10f.akpm@digeo.com \
    --to=akpm@digeo.com \
    --cc=davem@redhat.com \
    --cc=jgarzik@pobox.com \
    --cc=jt@bougret.hpl.hp.com \
    --cc=jt@hpl.hp.com \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.