From patchwork Fri Feb 27 14:52:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 45227 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f72.google.com (mail-wg0-f72.google.com [74.125.82.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0666E21488 for ; Fri, 27 Feb 2015 14:53:03 +0000 (UTC) Received: by wghl18 with SMTP id l18sf14483657wgh.3 for ; Fri, 27 Feb 2015 06:53:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:subject :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=WdknxIfy4RZV1liSeiUpxKYCxtd9PKnxhoe2+jcsM8Q=; b=EgroZYdlkiy/QJyLJJnr6WlHJ9Ux+O5joqLm7Rb8Q6YJtukmnSyMm5SCJbNLwCsCSx Z4rAtREwlQmknZawwefiaNP7z+xCho6qgmMa0gPvQKYmrLGffI62HEEjQXrWl4yywGw9 +4WmK3KpOfiwtma/kp8ymaej06BSDurkdPX62dwBe3rKA+4UfmiBX9s+MglelSERYOO4 FPJk9JuB2mckBqN/AH7XJbVJGCRDkS0IhSWJL9/TuzG7xKdiJOx3Nhq3NtpHaZGmgQLY AZ1fBbMFvCCSmTj2bcDCtHxG5rFf+U9nWW75CHYJFRSeiXwqNYgcalazJKOa4V3Wm7dT J58g== X-Gm-Message-State: ALoCoQnQTjNAyzAHtCjqC5olHUFXC98YtsNJ6xtIoHD2ekLPLKXMj3tp68/QKo0h2KOxvVXliBSf X-Received: by 10.112.214.234 with SMTP id od10mr2101607lbc.3.1425048782224; Fri, 27 Feb 2015 06:53:02 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.88.98 with SMTP id bf2ls175743lab.70.gmail; Fri, 27 Feb 2015 06:53:02 -0800 (PST) X-Received: by 10.112.167.4 with SMTP id zk4mr12483804lbb.74.1425048782078; Fri, 27 Feb 2015 06:53:02 -0800 (PST) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com. [209.85.215.50]) by mx.google.com with ESMTPS id bs9si3142817lbd.13.2015.02.27.06.53.02 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Feb 2015 06:53:02 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) client-ip=209.85.215.50; Received: by lams18 with SMTP id s18so18017215lam.13 for ; Fri, 27 Feb 2015 06:53:02 -0800 (PST) X-Received: by 10.152.87.3 with SMTP id t3mr12991448laz.19.1425048781904; Fri, 27 Feb 2015 06:53:01 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp3990019lbj; Fri, 27 Feb 2015 06:53:01 -0800 (PST) X-Received: by 10.140.96.55 with SMTP id j52mr28260708qge.92.1425048778887; Fri, 27 Feb 2015 06:52:58 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id h34si4285464qgf.2.2015.02.27.06.52.57 (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 27 Feb 2015 06:52:58 -0800 (PST) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YRMHf-0006dt-Sh; Fri, 27 Feb 2015 14:52:55 +0000 Received: from mail-qg0-f53.google.com ([209.85.192.53]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YRMHa-0006dV-64 for lng-odp@lists.linaro.org; Fri, 27 Feb 2015 14:52:50 +0000 Received: by mail-qg0-f53.google.com with SMTP id f51so14343537qge.12 for ; Fri, 27 Feb 2015 06:52:45 -0800 (PST) X-Received: by 10.229.134.200 with SMTP id k8mr30086415qct.13.1425048764906; Fri, 27 Feb 2015 06:52:44 -0800 (PST) Received: from mike-desktop.?.holmesfamily.ws (c-98-221-136-245.hsd1.nj.comcast.net. [98.221.136.245]) by mx.google.com with ESMTPSA id h8sm2735212qaq.44.2015.02.27.06.52.43 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 27 Feb 2015 06:52:44 -0800 (PST) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Fri, 27 Feb 2015 09:52:30 -0500 Message-Id: <1425048757-28438-1-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 2.1.0 X-Topics: patch Subject: [lng-odp] [PATCH v5 1/8] example: odp_generator: fix c99 usleep X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: lng-odp-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: mike.holmes@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Signed-off-by: Mike Holmes --- example/generator/odp_generator.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c index 47cab6c..f3a315d 100644 --- a/example/generator/odp_generator.c +++ b/example/generator/odp_generator.c @@ -10,6 +10,7 @@ * @example odp_generator.c ODP loopback demo application */ +#include #include #include #include @@ -397,7 +398,10 @@ static void *gen_send_thread(void *arg) odp_atomic_load_u64(&counters.seq), odp_atomic_load_u64(&counters.seq)%0xffff); /* TODO use odp timer */ - usleep(args->appl.interval * 1000); + struct timespec ts; + ts.tv_sec = 0; + ts.tv_nsec = args->appl.interval; + nanosleep(&ts, NULL); } if (args->appl.number != -1 && odp_atomic_load_u64(&counters.seq)