All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yuanhan Liu <yuanhan.liu@linux.intel.com>
To: Ferruh Yigit <ferruh.yigit@intel.com>
Cc: Jianfeng Tan <jianfeng.tan@intel.com>,
	dev@dpdk.org, huawei.xie@intel.com,
	Panu Matilainen <pmatilai@redhat.com>,
	Christian Ehrhardt <christian.ehrhardt@canonical.com>,
	Thomas Monjalon <thomas.monjalon@6wind.com>
Subject: Re: [PATCH] net/virtio-user: fix O_CLOEXEC undeclared error
Date: Wed, 29 Jun 2016 09:56:10 +0800	[thread overview]
Message-ID: <20160629015610.GA23111@yliu-dev.sh.intel.com> (raw)
In-Reply-To: <57724644.2070107@intel.com>

On Tue, Jun 28, 2016 at 10:41:24AM +0100, Ferruh Yigit wrote:
> On 6/26/2016 2:49 PM, Jianfeng Tan wrote:
> > On some older systems, such as SUSE 11, the compiling error shows
> > as:
> >    .../dpdk/drivers/net/virtio/virtio_user/virtio_user_dev.c:67:22:
> >          error: ‘O_CLOEXEC’ undeclared (first use in this function)
> > 
> > The fix is to declare _GNU_SOURCE macro before include fcntl.h.
> > 
> > Fixes: 37a7eb2ae816 ("net/virtio-user: add device emulation layer")
> > 
> > Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
> > ---
> >  drivers/net/virtio/virtio_user/virtio_user_dev.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c
> > index 3d12a32..180f824 100644
> > --- a/drivers/net/virtio/virtio_user/virtio_user_dev.c
> > +++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c
> > @@ -31,6 +31,7 @@
> >   *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> >   */
> >  
> > +#define _GNU_SOURCE
> This flag enables glibc extensions, and kind of problem on code
> portability. How big problem is it?

Honestly, I don't know. But I was also thinking that define _GNU_SOURCE
here is an overkill to me. For this issue, we may simply fix it by
reference the O_CLOEXEC flag only when it's defined.

> Is there any platform that DPDK runs on which uses a libc that isn't
> compatible with what this flag provides?
> 
> And it seems this flag already used in DPDK, including libraries.

Yes, "git grep _GNU_SOURCE" shows a lot of such usage.

	--yliu

> If we
> are agree on using glibc extensions, does it make sense to move this
> flag into a single common location (like mk/exec-env/) ?
> 
> >  #include <stdint.h>
> >  #include <stdio.h>
> >  #include <fcntl.h>
> > 

  reply	other threads:[~2016-06-29  1:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-26 13:49 [PATCH] net/virtio-user: fix O_CLOEXEC undeclared error Jianfeng Tan
2016-06-28  9:02 ` Yuanhan Liu
2016-06-28  9:41 ` Ferruh Yigit
2016-06-29  1:56   ` Yuanhan Liu [this message]
2016-06-29  3:23 ` [PATCH v2] net/virtio-user: fix build error in SUSE 11 Jianfeng Tan
2016-07-01  2:10   ` Yuanhan Liu

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=20160629015610.GA23111@yliu-dev.sh.intel.com \
    --to=yuanhan.liu@linux.intel.com \
    --cc=christian.ehrhardt@canonical.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=huawei.xie@intel.com \
    --cc=jianfeng.tan@intel.com \
    --cc=pmatilai@redhat.com \
    --cc=thomas.monjalon@6wind.com \
    /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.