From nobody Wed Jan 19 19:32:51 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id E85CD195E195; Wed, 19 Jan 2022 19:32:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JfG4z6C2sz4tvB; Wed, 19 Jan 2022 19:32:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642620771; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7dFBA0EHzY7R0x9WBWir47pU7D3SLorn3197ic5tnCo=; b=XjXaj9VycKs7lr0oFYtNuZvFxSM3nWdfg2iFmanlf10JG4BoSHpX/dtcJmKrPRqFxbT5pO a6XBH1dQ6v0+XtE9Ce4g6584C6CIwpYuNWOuEApqZFCrL1375QVDkNc7vwOXYd3Z7J4YUz GgdZhC3ngZvujGDW5JqU5JixHJpGtfBPDLaPdA98eaQxb5bhafh415URk6EEhoh+WwYOKl pStKwEdH7dKm3UmW3ZMOaGwKrGA61ex8lq+RPcejskTZqSocEPD6oTNOVOff+VYsouMyy9 CRBrU89kq0VVfyk49KFjT1oNN62sp5DpEnSRcULkDzdkNV+HqeNc0zfu7J9Hew== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B502E1AB14; Wed, 19 Jan 2022 19:32:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 20JJWp0F024810; Wed, 19 Jan 2022 19:32:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20JJWpkC024809; Wed, 19 Jan 2022 19:32:51 GMT (envelope-from git) Date: Wed, 19 Jan 2022 19:32:51 GMT Message-Id: <202201191932.20JJWpkC024809@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wolfram Schneider Subject: git: a97ce14abcf9 - main - correct type of mmap len parameter List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wosch X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a97ce14abcf9252cfb14e9759d4ff2f89a2ca10f Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642620771; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7dFBA0EHzY7R0x9WBWir47pU7D3SLorn3197ic5tnCo=; b=aWwFC07RCRMSAeNO7116uGkk5J3ZpFjn5lQ02Ea2yoELzkruhXbvkwkjs6bT/ojTbCFwsj hBPpNsSxZBXAcRPnkSfHzV34tSdjeeIwTF4vCqgbXoIJffDGsqXR0oCcc+dI+x5YgSANoS FAB/XH7+XkxvDDzZkWh1qfuUiysrHDybHIuo9WTpggCr3ILVHq4NZfQ+ISJXqrMS3OfIi5 QlFqCbC0rpQcBBGe5ZC/wk+kgrD6MDQoHTuQQxzi7obTLmSYMKCwvozmunfvyD1Ztgt3Wt YMGvNBUQSJowvdrz01ALBe+DRWkp/Nu0oHltrd/oXi84Av8fUt/6FxvG5KOpww== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1642620771; a=rsa-sha256; cv=none; b=veud37Hkv58zLqx7Kq8dib4efcEX1qoXF+afHDNzUAtDChFXxyr0aNtOGGD/v0gJ71r7p+ 7RCqfqOF2XpdRCM6kWoE8vrlsHiYpWLqAROpHXdeD9CFX1J4JTdKzZcswhYFz6gkJP3BPl Qqnzes2zT8qe2mJGvXLxbf63fHFuBqQz04U1xIHZllB7hvbMil5haBJCgjaMyHQ3lsi9Ox thoYcJvyWlVq/sp/KWm6uhbDkBT4aWcN4Vho5ahomOFlTNrSV4H5ZEYyv9VaSWH4OuoB2d ND2FqCgXt7fFw9+M9iPZJr51YmpcnO5mpygU6tv1LbYZStvbfL7BNuibtcWiNQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by wosch: URL: https://cgit.FreeBSD.org/src/commit/?id=a97ce14abcf9252cfb14e9759d4ff2f89a2ca10f commit a97ce14abcf9252cfb14e9759d4ff2f89a2ca10f Author: Wolfram Schneider AuthorDate: 2022-01-19 19:20:11 +0000 Commit: Wolfram Schneider CommitDate: 2022-01-19 19:32:16 +0000 correct type of mmap len parameter Using locate -m on a database > 2GB should work now. PR: 261277 --- usr.bin/locate/locate/fastfind.c | 4 ++-- usr.bin/locate/locate/locate.c | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/usr.bin/locate/locate/fastfind.c b/usr.bin/locate/locate/fastfind.c index e2f6d74552ec..a4e12db970a3 100644 --- a/usr.bin/locate/locate/fastfind.c +++ b/usr.bin/locate/locate/fastfind.c @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: BSD-4-Clause * - * Copyright (c) 1995 Wolfram Schneider . Berlin. + * Copyright (c) 1995-2022 Wolfram Schneider * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. * @@ -119,7 +119,7 @@ fastfind_mmap (pathpart, paddr, len, database) char *pathpart; /* search string */ caddr_t paddr; /* mmap pointer */ - int len; /* length of database */ + off_t len; /* length of database */ char *database; /* for error message */ diff --git a/usr.bin/locate/locate/locate.c b/usr.bin/locate/locate/locate.c index 29c46b2b78cc..3499591acabc 100644 --- a/usr.bin/locate/locate/locate.c +++ b/usr.bin/locate/locate/locate.c @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: BSD-4-Clause * - * Copyright (c) 1995 Wolfram Schneider . Berlin. + * Copyright (c) 1995-2022 Wolfram Schneider * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. * @@ -122,8 +122,8 @@ void usage(void); void statistic(FILE *, char *); void fastfind(FILE *, char *, char *); void fastfind_icase(FILE *, char *, char *); -void fastfind_mmap(char *, caddr_t, int, char *); -void fastfind_mmap_icase(char *, caddr_t, int, char *); +void fastfind_mmap(char *, caddr_t, off_t, char *); +void fastfind_mmap_icase(char *, caddr_t, off_t, char *); void search_mmap(char *, char **); void search_fopen(char *, char **); unsigned long cputime(void); @@ -314,9 +314,9 @@ search_mmap(char *db, char **s) t0 = cputime(); #endif if (f_icase) - fastfind_mmap_icase(*s, p, (int)len, db); + fastfind_mmap_icase(*s, p, len, db); else - fastfind_mmap(*s, p, (int)len, db); + fastfind_mmap(*s, p, len, db); #ifdef DEBUG warnx("fastfind %ld ms", cputime () - t0); #endif