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 4FE89A051C; Sat, 20 Jun 2020 23:05:55 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 232A51BFE3; Sat, 20 Jun 2020 23:05:27 +0200 (CEST) Received: from mail-lf1-f68.google.com (mail-lf1-f68.google.com [209.85.167.68]) by dpdk.org (Postfix) with ESMTP id EE5E71BFBA for ; Sat, 20 Jun 2020 23:05:22 +0200 (CEST) Received: by mail-lf1-f68.google.com with SMTP id c21so7502230lfb.3 for ; Sat, 20 Jun 2020 14:05:22 -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=gixy1Rn+5XHXxjNwcM5dZ6ElyhrLOIc8HA3JCgbPGkXaLHnZWwq27i7wr9eONMZ7gb 83vjHR160sawjX0O3BDJPlXQ4zEnVGKggvhgaIgl2fF30HOt1SR/DV+aR9U/7kAEAQBA ruF79ny/MNJ/8XgyJmE950HcMPf/ovoqtvr4+Mjr2ygEYPcvVMZVl3rvK4ftOwYyZQTS Lj3C8zyrJ2juTpycJ6qpmLaoNN1hHE90o4DMRp1EvdLtkoA+0/MElEIEDpT9KveQVUEm zZj523VYvcaqgYQSrul3ayRgzK11gQdsCKHlnaMwXGjUWrPJgjUJSWGjcFThyvKneO7g 2gEg== 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=oQ7DoiWWXEMEZOTtQqIXZxoiUKeujPHtoQJVO2Yzz5juzdB7zS8PWUqem6DcGOGCp5 plF5+BaTj6ommF0g2QwI7y5jtNYlE7hel4Lc3sOOEmintO6/8l85UMM0ayd2MroA75WO vVzBH6En5uXjqgptrsJxnIeZPUcaBQQCa1WUiDFsNHdILSk23l7vOOuVNCI9mY50PNpV xJT7nlnwGmhX+aEfPYlP6vTUsZKsVRZmRQRB9LnxelL6lZ84S7v8UrQASbj4Gd9Sdt8z XKBI77cWPlce0tbELBJnVY9XAHY5D6VpJfr3CeD3BIzzvSVbkG+Pw/wOv4MBf0o2Gl9b CfPA== X-Gm-Message-State: AOAM531jLdj/II3JI06vr65zxwsdP77Qn2GWQTbUf+nXatJoymmACuNO R+/eD+tzgsd9Qh09rDCF5MxDUmRXjd2EZA== X-Google-Smtp-Source: ABdhPJwFof98WqRw7epemVtyUOAZBkAfa8ofC2LK6sVCKdagpmaAKuAYHcdPdT+NL9VBHyeS7Gf+LQ== X-Received: by 2002:a19:381a:: with SMTP id f26mr5507982lfa.110.1592687122117; Sat, 20 Jun 2020 14:05:22 -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 d8sm2653359lfk.27.2020.06.20.14.05.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 Jun 2020 14:05:21 -0700 (PDT) From: Dmitry Kozlyuk To: dev@dpdk.org Cc: Dmitry Malloy , Narcisa Ana Maria Vasile , Fady Bader , Tal Shnaiderman , Dmitry Kozlyuk , Olivier Matz Date: Sun, 21 Jun 2020 00:05:07 +0300 Message-Id: <20200620210511.13134-5-dmitry.kozliuk@gmail.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20200620210511.13134-1-dmitry.kozliuk@gmail.com> References: <20200620210511.13134-1-dmitry.kozliuk@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 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