All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jianfeng Tan <jianfeng.tan@intel.com>
To: dev@dpdk.org
Cc: yuanhan.liu@linux.intel.com, ferruh.yigit@intel.com,
	Jianfeng Tan <jianfeng.tan@intel.com>
Subject: [PATCH v2] net/virtio-user: fix build error in SUSE 11
Date: Wed, 29 Jun 2016 03:23:03 +0000	[thread overview]
Message-ID: <1467170583-137837-1-git-send-email-jianfeng.tan@intel.com> (raw)
In-Reply-To: <1466948986-12255-1-git-send-email-jianfeng.tan@intel.com>

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 use EFD_CLOEXEC, which is defined in sys/eventfd.h,
instead of O_CLOEXEC which needs _GNU_SOURCE defined on some old
systems.

Fixes: 37a7eb2ae816 ("net/virtio-user: add device emulation layer")

Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
---
v2:
 - Change the way to fix this issue.
 drivers/net/virtio/virtio_user/virtio_user_dev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c
index 3d12a32..1b1e5bf 100644
--- a/drivers/net/virtio/virtio_user/virtio_user_dev.c
+++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c
@@ -63,12 +63,12 @@ virtio_user_kick_queue(struct virtio_user_dev *dev, uint32_t queue_sel)
 	/* May use invalid flag, but some backend leverages kickfd and callfd as
 	 * criteria to judge if dev is alive. so finally we use real event_fd.
 	 */
-	callfd = eventfd(0, O_CLOEXEC | O_NONBLOCK);
+	callfd = eventfd(0, EFD_CLOEXEC | EFD_NONBLOCK);
 	if (callfd < 0) {
 		PMD_DRV_LOG(ERR, "callfd error, %s\n", strerror(errno));
 		return -1;
 	}
-	kickfd = eventfd(0, O_CLOEXEC | O_NONBLOCK);
+	kickfd = eventfd(0, EFD_CLOEXEC | EFD_NONBLOCK);
 	if (kickfd < 0) {
 		close(callfd);
 		PMD_DRV_LOG(ERR, "kickfd error, %s\n", strerror(errno));
-- 
2.1.4

  parent reply	other threads:[~2016-06-29  3:23 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
2016-06-29  3:23 ` Jianfeng Tan [this message]
2016-07-01  2:10   ` [PATCH v2] net/virtio-user: fix build error in SUSE 11 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=1467170583-137837-1-git-send-email-jianfeng.tan@intel.com \
    --to=jianfeng.tan@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=yuanhan.liu@linux.intel.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.