From nobody Tue Mar 12 14:41:31 2024 X-Original-To: freebsd-questions@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 4TvH0N1MSlz5F00Y for ; Tue, 12 Mar 2024 15:01:24 +0000 (UTC) (envelope-from Mathias.Picker@virtual-earth.de) Received: from www94.your-server.de (www94.your-server.de [213.133.104.94]) (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 mx1.freebsd.org (Postfix) with ESMTPS id 4TvH0L4qmYz4r58 for ; Tue, 12 Mar 2024 15:01:22 +0000 (UTC) (envelope-from Mathias.Picker@virtual-earth.de) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=virtual-earth.de header.s=default_1811 header.b=lJhbmRdA; dmarc=pass (policy=none) header.from=virtual-earth.de; spf=pass (mx1.freebsd.org: domain of Mathias.Picker@virtual-earth.de designates 213.133.104.94 as permitted sender) smtp.mailfrom=Mathias.Picker@virtual-earth.de DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=virtual-earth.de; s=default_1811; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Message-ID:Date:Subject:To:From:Sender:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References; bh=NBwBZYwbSwtFs4iSoL9si4G43q6fbIAcHriZi9OQ49E=; b=lJhbmRdAMdVKHyUPeDefwVpks9 sGYDO5FRU3tEZia2pg6glsdq8MgDsxqYIdunns1JrUTmSn/3XYyFu4zDDxNuJSGOnaJVIENOzInVx Ephin+zv8pxsKyfEwsrG22w0TAwhwan/N/F2pyX8gCVvu12t01iL4b4sCve/MsES+JhgMfNaE9OeM zzbiSdgjVOTdqczvbzWzg1fxnKMPM+R2az17tS5EBlf7EXkFrhsNFd5WVnM5yQ6SpQXEITyqoyy3N BfJF8mmji5j9HBdKDAjR0HIbVYTx19QLUl+68I0Fyk3W/u8H2AkpdvMVuYbBlFiokGwVo34TY7714 iG4jSoVg==; Received: from sslproxy02.your-server.de ([78.47.166.47]) by www94.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rk3cw-0008NL-U8 for freebsd-questions@freebsd.org; Tue, 12 Mar 2024 16:01:14 +0100 Received: from [2001:a61:3b06:b01:4a2a:e3ff:fe1a:da58] (helo=danton.virtual-earth.de) by sslproxy02.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1rk3cw-006mPV-2H for freebsd-questions@freebsd.org; Tue, 12 Mar 2024 16:01:14 +0100 User-agent: mu4e 1.8.15; emacs 29.1 From: Mathias Picker To: freebsd-questions@freebsd.org Subject: Alternative to sysconf(_SC_AVPHYS_PAGES) to get available memory? Date: Tue, 12 Mar 2024 15:41:31 +0100 Message-ID: <86cyrz8pfq.fsf@virtual-earth.de> List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Authenticated-Sender: Mathias.Picker@virtual-earth.de X-Virus-Scanned: Clear (ClamAV 0.103.10/27212/Tue Mar 12 09:27:22 2024) X-Spamd-Bar: -- X-Spamd-Result: default: False [-3.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; SUBJECT_ENDS_QUESTION(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; DMARC_POLICY_ALLOW(-0.50)[virtual-earth.de,none]; R_SPF_ALLOW(-0.20)[+mx]; R_DKIM_ALLOW(-0.20)[virtual-earth.de:s=default_1811]; MIME_GOOD(-0.10)[text/plain]; RCVD_VIA_SMTP_AUTH(0.00)[]; ASN(0.00)[asn:24940, ipnet:213.133.96.0/19, country:DE]; RCPT_COUNT_ONE(0.00)[1]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; HAS_X_AS(0.00)[]; ARC_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; MLMMJ_DEST(0.00)[freebsd-questions@freebsd.org]; DKIM_TRACE(0.00)[virtual-earth.de:+] X-Rspamd-Queue-Id: 4TvH0L4qmYz4r58 Hi all, I'm just trying to compile osm2rdf (osm map data to GeoSPARQL),=20 and found that they use sysconf(_SC_AVPHYS_PAGES) to get available=20 memory: int64_t available() { return sysconf(_SC_AVPHYS_PAGES) * sysconf(_SC_PAGE_SIZE); } Looking at sysconf(3) I can see that we do not have=20 _SC_AVPHYS_PAGES. I searched for alternatives, but did not find=20 any.=20 I also did not find anything like "available" memory in=20 sysconf(3). So, can anyone tell me a FreeBSD alternative to=20 sysconf(_SC_AVPHYS_PAGES)? Thanks, Mathias --=20 Mathias Picker=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20 Gesch=C3=A4ftsf=C3=BChrer Mathias.Picker@virtual-earth.de virtual earth Gesellschaft f=C3=BCr Wissens re/pr=C3=A4 sentation mbH http://www.virtual-earth.de/ HRB126870 support@virtual-earth.de Westendstr. 142 089 / 1250 3943=20=20=20=20=20=20=20=20=20=20=20=20