From patchwork Wed Apr 22 06:21:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Nelkenbaum X-Patchwork-Id: 6254911 X-Patchwork-Delegate: hal@mellanox.com Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D76BC9F313 for ; Wed, 22 Apr 2015 06:22:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F120F20253 for ; Wed, 22 Apr 2015 06:22:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9636A200FF for ; Wed, 22 Apr 2015 06:22:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932316AbbDVGWY (ORCPT ); Wed, 22 Apr 2015 02:22:24 -0400 Received: from ns1327.ztomy.com ([193.47.165.129]:44770 "EHLO mellanox.co.il" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S932136AbbDVGWY (ORCPT ); Wed, 22 Apr 2015 02:22:24 -0400 Received: from Internal Mail-Server by MTLPINE1 (envelope-from ilyan@dev.mellanox.co.il) with ESMTPS (AES256-SHA encrypted); 22 Apr 2015 09:21:54 +0300 Received: from dev-r-vrt-086.mtr.labs.mlnx. (dev-r-vrt-086.mtr.labs.mlnx [10.212.86.1]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id t3M6LtK3031821; Wed, 22 Apr 2015 09:21:55 +0300 From: Ilya Nelkenbaum To: linux-rdma@vger.kernel.org Cc: hal@dev.mellanox.co.il, Ilya Nelkenbaum Subject: [PATCH] ibsim/sim_cmd.c: Add ULLONG_MAX if not defined Date: Wed, 22 Apr 2015 09:21:53 +0300 Message-Id: <1429683713-19991-1-git-send-email-ilyan@dev.mellanox.co.il> X-Mailer: git-send-email 1.8.3.4 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ilya Nelkenbaum In old glibc versions (< 2.9.90) it is not defined Signed-off-by: Ilya Nelkenbaum --- ibsim/sim_cmd.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ibsim/sim_cmd.c b/ibsim/sim_cmd.c index 4822a0b..249228a 100644 --- a/ibsim/sim_cmd.c +++ b/ibsim/sim_cmd.c @@ -934,6 +934,11 @@ static int do_perf_counter_set(FILE *f, char *line) field_trim--; *(field_trim + 1) = 0; +#ifndef ULLONG_MAX +/* Maximum value an `unsigned long long int' can hold. (Minimum is 0.) */ +# define ULLONG_MAX 18446744073709551615ULL +#endif + errno = 0; value = strtoull(s, &val_error, 0); if((value == 0 || value == ULLONG_MAX) && errno != 0) {