From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 52A6F2904 for ; Wed, 29 Jun 2016 03:55:53 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP; 28 Jun 2016 18:55:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,543,1459839600"; d="scan'208";a="1007127429" Received: from unknown (HELO yliu-dev) ([10.239.67.162]) by orsmga002.jf.intel.com with ESMTP; 28 Jun 2016 18:55:50 -0700 Date: Wed, 29 Jun 2016 09:56:10 +0800 From: Yuanhan Liu To: Ferruh Yigit Cc: Jianfeng Tan , dev@dpdk.org, huawei.xie@intel.com, Panu Matilainen , Christian Ehrhardt , Thomas Monjalon Message-ID: <20160629015610.GA23111@yliu-dev.sh.intel.com> References: <1466948986-12255-1-git-send-email-jianfeng.tan@intel.com> <57724644.2070107@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <57724644.2070107@intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH] net/virtio-user: fix O_CLOEXEC undeclared error X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jun 2016 01:55:53 -0000 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 > > --- > > 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 > > #include > > #include > >