From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 35742A052B; Thu, 30 Jul 2020 23:07:57 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 793AE1C042; Thu, 30 Jul 2020 23:07:33 +0200 (CEST) Received: from mail-lf1-f66.google.com (mail-lf1-f66.google.com [209.85.167.66]) by dpdk.org (Postfix) with ESMTP id 2F21E1BFFD for ; Thu, 30 Jul 2020 23:07:27 +0200 (CEST) Received: by mail-lf1-f66.google.com with SMTP id j22so9828751lfm.2 for ; Thu, 30 Jul 2020 14:07:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KbYqZN0ClR4nsYNdtYEr+bqQUXtWxm/P5uBfGcIfH4w=; b=bWq6EWBFWYyjFt1LIsWieBE9ZG6euKgkNE6ncrFqNvMW7eP2UeZoq8IXavv/kEioXl Z6ynZKYr58kmsTvT/A/cZuGoEHbHF6aT0BpvXjHNuzdIPpByzSaUdnldb7dCYJD2RsY1 0RSpGxlnel1HkEydrKCvYUvhSRHhxooVVPzUMtOOLghaIcSExzCqtY44rKS36bDL5O8d ObHJLhtRETLpSK2QFEXfEKnhFQe61hvJFk/qLiRLdDVNjWkrpxS2Ae8n+HXKizU7hYIl uyQ+IilH74Jng/O3i3LiM45LTS+wBAKIgrNkLutglP/aXyXGTOSMM0XE52V6JvJqIcEv 3hNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KbYqZN0ClR4nsYNdtYEr+bqQUXtWxm/P5uBfGcIfH4w=; b=aYC/qPm/1Z2K2sXdH+RE6zTJrz38mUS/x3wWR/VGtZqU0GL7MO5u0nQZ8abHN7Pxah JexvjRLAsiMUoZSR4eOEhNWpkdQ2EuGK/cTg4FoYjCBz6/D/tg+y6sm99nFc2kritlFN +pT3mB2Sdn8PV5X6MiumcyXiwVKAOoHfS/g1NSiE6vgn8csx3cfvgTdjh0lNi3xJCY/O 3zkA6e5LtqEbS7MsuPCo1AYhTGC5Uzv8QYvTjnchDKb1ySnD+MKfssqvRGd70jbDlR0x VVhV2kXAouzijiVne+OrAMIQQrNoxEl6S9BLx9ZnJojvB8m8BzYItuyOh5I73GZiKuvj eRwg== X-Gm-Message-State: AOAM533U9cWINSHx6gHjmXNP8EZgf5/vM8UK+7kmtYmoKZAUo+74iWCx J9d1XEANCH3Hk0wbfplfS9x60XVj+Y+85Q== X-Google-Smtp-Source: ABdhPJzZLT/o8ts3bWNmHdA03TAmwZ5DN+dyb9nSd0fg0HuDTsiIRoP5AVh6xp+F22bgffGuBHJwZw== X-Received: by 2002:a05:6512:3610:: with SMTP id f16mr265083lfs.8.1596143246479; Thu, 30 Jul 2020 14:07:26 -0700 (PDT) Received: from localhost.localdomain (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.gmail.com with ESMTPSA id y9sm1257763lji.49.2020.07.30.14.07.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jul 2020 14:07:25 -0700 (PDT) From: Dmitry Kozlyuk To: dev@dpdk.org Cc: Dmitry Malloy , Narcisa Ana Maria Vasile , Fady Bader , Tal Shnaiderman , "Kadam, Pallavi" , Dmitry Kozlyuk , Olivier Matz Date: Fri, 31 Jul 2020 00:06:48 +0300 Message-Id: <20200730210652.14568-5-dmitry.kozliuk@gmail.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20200730210652.14568-1-dmitry.kozliuk@gmail.com> References: <20200620210511.13134-1-dmitry.kozliuk@gmail.com> <20200730210652.14568-1-dmitry.kozliuk@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2 4/7] cmdline: add internal wrapper for vdprintf X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Add internal wrapper for vdprintf(3) that is only available on Unix. Signed-off-by: Dmitry Kozlyuk --- lib/librte_cmdline/cmdline.c | 2 +- lib/librte_cmdline/cmdline_os_unix.c | 6 ++++++ lib/librte_cmdline/cmdline_private.h | 8 ++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/librte_cmdline/cmdline.c b/lib/librte_cmdline/cmdline.c index a04719998..00b9e6b2e 100644 --- a/lib/librte_cmdline/cmdline.c +++ b/lib/librte_cmdline/cmdline.c @@ -132,7 +132,7 @@ cmdline_printf(const struct cmdline *cl, const char *fmt, ...) if (cl->s_out < 0) return; va_start(ap, fmt); - vdprintf(cl->s_out, fmt, ap); + cmdline_vdprintf(cl->s_out, fmt, ap); va_end(ap); } diff --git a/lib/librte_cmdline/cmdline_os_unix.c b/lib/librte_cmdline/cmdline_os_unix.c index 865a89ddd..2052cd254 100644 --- a/lib/librte_cmdline/cmdline_os_unix.c +++ b/lib/librte_cmdline/cmdline_os_unix.c @@ -45,3 +45,9 @@ cmdline_read_char(struct cmdline *cl, char *c) { return read(cl->s_in, c, 1); } + +int +cmdline_vdprintf(int fd, const char *format, va_list op) +{ + return vdprintf(fd, format, op); +} diff --git a/lib/librte_cmdline/cmdline_private.h b/lib/librte_cmdline/cmdline_private.h index ecfeb89f6..338d3d55c 100644 --- a/lib/librte_cmdline/cmdline_private.h +++ b/lib/librte_cmdline/cmdline_private.h @@ -7,6 +7,10 @@ #include +#include + +#include + #include #include @@ -35,4 +39,8 @@ int cmdline_poll_char(struct cmdline *cl); /* Read one character from input. */ ssize_t cmdline_read_char(struct cmdline *cl, char *c); +/* vdprintf(3) */ +__rte_format_printf(2, 0) +int cmdline_vdprintf(int fd, const char *format, va_list op); + #endif -- 2.25.4