From nobody Tue Jun 4 01:07:43 2024 X-Original-To: dev-commits-ports-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 4VtXWg3SRhz5LxqH; Tue, 04 Jun 2024 01:07:43 +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 4VtXWg2x5Xz4Cbl; Tue, 4 Jun 2024 01:07:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717463263; 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=lhyin9uG6Z5ERHvQPhFOodkSiv0Vl2cesDNKeQNuEIY=; b=I5alX2/isLbBruIHHNsDCheq+xnV2iQ9N+ueqcKkYr88lvMVxy8NV8yED8l0NTr1HILCg+ vNO4gJwKYbGEXsveJM9sYBNdQI6OzT/DBUdtAmSbkuPBQMKSj3YAAZWl6/CIZDAlQrf2/Z zl74HN/5S0DpE1DMUfhXUcKXJ+xVIyqhje5GvqQvtOJbsW/O9zCDB8zd9qhXpzEZuvKWow 5vG3p3P96rah5vF8hGHfwJAS3qEOLxhDZv9uah1tryNmx4b3JYDUNUp1j2OnEH1e2IRTcL fNV2RvyU1xv6025zjSQHQNjDve3CJiLQtKIn04oDGPJo5BpW9mf3NCyVWzBRnA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717463263; a=rsa-sha256; cv=none; b=OsgtVQHstadR89pTaKn9LTYrTOAsmHawhAfT/hI70Fx3DTiF16aipqMtSX53293g80LdED 7V1U8lHSeBt6zkQSxcMh896rM2LsPvLS4PwDPRnEfLGm8+ixcZaIkwkVdNf7IfVf8tH5Ng 2/DTJejkKPD4PkP7NzfwcrUJ4dVq1HQPoOwbQ935Ugb+ds1xlYfwxPlhQMfZ4h5c6iA8RZ 6f08r8kiX096athCFYpFusVUwtHEUhVjbSUdeg9GazsTp47da2XZyi38x0hNdOH1CIc5oK qJQtFjVqRtfoYREiBQolwKgkn4RyTukX0iI7IPweADSu7tjtdg0EDKMwlBAtDQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717463263; 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=lhyin9uG6Z5ERHvQPhFOodkSiv0Vl2cesDNKeQNuEIY=; b=bVvGVWyuCuV0LL2JjYOzlAaKi8U8I/rKeustXhU31HkMfCBm0YJZDxWg/RlyggfgNNJ1Pe y3CnSGWfSt/sVdDN0rhFxjIHcL2W9CurWbBI2OabjSIAxYGWw30RuU5g8FXFHwLmszfsOQ of2uflW+gdLS+uZ9qdujldX2sJC20KosrTVMedEiPUXjjwDXawS1UvaZwFmeZmhgABBsep Zwryx7S+ILSeF5fTOTTga9vpvO8EA5vTXqiW16d458BWBo5t8WBgsd00hlnrh2yKhNIIHN e+lKSmOAN+p+bLF+ZEnJg86D+botza1N8ESxD540mEY4tHT8WYQ/+0NZQO/6CA== 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 4VtXWg2DCkzxjt; Tue, 4 Jun 2024 01:07:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 45417hJk047172; Tue, 4 Jun 2024 01:07:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 45417hOL047169; Tue, 4 Jun 2024 01:07:43 GMT (envelope-from git) Date: Tue, 4 Jun 2024 01:07:43 GMT Message-Id: <202406040107.45417hOL047169@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Dan Langille Subject: git: 9df94c4d9d1c - main - sysutils/bacula1[1,3,5]-[client,server]: build without sbrk List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-ports-all@freebsd.org Sender: owner-dev-commits-ports-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dvl X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9df94c4d9d1c50f758e9be67e51060a14527e2cc Auto-Submitted: auto-generated The branch main has been updated by dvl: URL: https://cgit.FreeBSD.org/ports/commit/?id=9df94c4d9d1c50f758e9be67e51060a14527e2cc commit 9df94c4d9d1c50f758e9be67e51060a14527e2cc Author: Dan Langille AuthorDate: 2024-06-04 01:03:04 +0000 Commit: Dan Langille CommitDate: 2024-06-04 01:07:39 +0000 sysutils/bacula1[1,3,5]-[client,server]: build without sbrk This enables build on aarch64 and riscv64 Differential Revision: https://reviews.freebsd.org/D42979 --- sysutils/bacula11-client/Makefile | 3 - sysutils/bacula11-server/Makefile | 2 +- .../bacula11-server/files/patch-src_lib_bsys.c | 29 +++ sysutils/bacula13-client/Makefile | 3 - sysutils/bacula13-server/Makefile | 2 +- .../bacula13-server/files/patch-src_lib_bsys.c | 29 +++ sysutils/bacula15-client/Makefile | 3 - sysutils/bacula15-server/Makefile | 2 +- sysutils/bacula15-server/Makefile.old | 207 +++++++++++++++++++++ .../bacula15-server/files/patch-src_lib_bsys.c | 29 +++ 10 files changed, 297 insertions(+), 12 deletions(-) diff --git a/sysutils/bacula11-client/Makefile b/sysutils/bacula11-client/Makefile index db2c57bb741d..97462c95486c 100644 --- a/sysutils/bacula11-client/Makefile +++ b/sysutils/bacula11-client/Makefile @@ -3,9 +3,6 @@ PKGNAMESUFFIX= 11-client COMMENT= Network backup solution (client) -BROKEN_aarch64= Fails to link: missing sbrk -BROKEN_riscv64= Fails to link: missing sbrk - WITH_CLIENT_ONLY=yes USE_RC_SUBR= bacula-fd diff --git a/sysutils/bacula11-server/Makefile b/sysutils/bacula11-server/Makefile index 1e691d80c2dc..39eb9172f0d7 100644 --- a/sysutils/bacula11-server/Makefile +++ b/sysutils/bacula11-server/Makefile @@ -1,6 +1,6 @@ PORTNAME= bacula PORTVERSION= 11.0.6 -PORTREVISION= 5 +PORTREVISION= 6 CATEGORIES?= sysutils MASTER_SITES= SF/bacula/bacula/${PORTVERSION} PKGNAMEPREFIX?= # diff --git a/sysutils/bacula11-server/files/patch-src_lib_bsys.c b/sysutils/bacula11-server/files/patch-src_lib_bsys.c new file mode 100644 index 000000000000..15638f0e8617 --- /dev/null +++ b/sysutils/bacula11-server/files/patch-src_lib_bsys.c @@ -0,0 +1,29 @@ +--- src/lib/bsys.c.orig ++++ src/lib/bsys.c +@@ -1270,7 +1270,7 @@ + /* + * Determine the amount of heap used + * macOS - sbrk(0) is deprecated, use malloc info +- * Windows - not implemented ++ * Windows - not implemented and FreeBSD + * others - use sbrk(0) + */ + +@@ -1279,7 +1279,7 @@ + + void mark_heap() + { +-#if defined(HAVE_WIN32) ++#if defined(HAVE_WIN32) || defined(__FreeBSD__) + start_heap = 0; + #elif defined(HAVE_DARWIN_OS) + struct mstats ms = mstats(); +@@ -1296,6 +1296,8 @@ + #elif defined(HAVE_DARWIN_OS) + struct mstats ms = mstats(); + return (int64_t) ms.bytes_used - start_heap; ++#elif defined(__FreeBSD__) ++ return 0; + #else + return (int64_t) sbrk(0) - start_heap; + #endif diff --git a/sysutils/bacula13-client/Makefile b/sysutils/bacula13-client/Makefile index 82178c81163b..7d0dcbfc28f3 100644 --- a/sysutils/bacula13-client/Makefile +++ b/sysutils/bacula13-client/Makefile @@ -3,9 +3,6 @@ PKGNAMESUFFIX= 13-client COMMENT= Network backup solution (client) -BROKEN_aarch64= Fails to link: missing sbrk -BROKEN_riscv64= Fails to link: missing sbrk - WITH_CLIENT_ONLY=yes USE_RC_SUBR= bacula-fd diff --git a/sysutils/bacula13-server/Makefile b/sysutils/bacula13-server/Makefile index b6c42dbef5b6..8d9021c02eee 100644 --- a/sysutils/bacula13-server/Makefile +++ b/sysutils/bacula13-server/Makefile @@ -1,6 +1,6 @@ PORTNAME= bacula DISTVERSION= 13.0.4 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES?= sysutils MASTER_SITES= SF/bacula/bacula/${PORTVERSION} PKGNAMEPREFIX?= # diff --git a/sysutils/bacula13-server/files/patch-src_lib_bsys.c b/sysutils/bacula13-server/files/patch-src_lib_bsys.c new file mode 100644 index 000000000000..15638f0e8617 --- /dev/null +++ b/sysutils/bacula13-server/files/patch-src_lib_bsys.c @@ -0,0 +1,29 @@ +--- src/lib/bsys.c.orig ++++ src/lib/bsys.c +@@ -1270,7 +1270,7 @@ + /* + * Determine the amount of heap used + * macOS - sbrk(0) is deprecated, use malloc info +- * Windows - not implemented ++ * Windows - not implemented and FreeBSD + * others - use sbrk(0) + */ + +@@ -1279,7 +1279,7 @@ + + void mark_heap() + { +-#if defined(HAVE_WIN32) ++#if defined(HAVE_WIN32) || defined(__FreeBSD__) + start_heap = 0; + #elif defined(HAVE_DARWIN_OS) + struct mstats ms = mstats(); +@@ -1296,6 +1296,8 @@ + #elif defined(HAVE_DARWIN_OS) + struct mstats ms = mstats(); + return (int64_t) ms.bytes_used - start_heap; ++#elif defined(__FreeBSD__) ++ return 0; + #else + return (int64_t) sbrk(0) - start_heap; + #endif diff --git a/sysutils/bacula15-client/Makefile b/sysutils/bacula15-client/Makefile index 8805264752b5..96d818343a83 100644 --- a/sysutils/bacula15-client/Makefile +++ b/sysutils/bacula15-client/Makefile @@ -3,9 +3,6 @@ PKGNAMESUFFIX= 15-client COMMENT= Network backup solution (client) -BROKEN_aarch64= Fails to link: missing sbrk -BROKEN_riscv64= Fails to link: missing sbrk - WITH_CLIENT_ONLY=yes USE_RC_SUBR= bacula-fd diff --git a/sysutils/bacula15-server/Makefile b/sysutils/bacula15-server/Makefile index a9d84c4720a0..33848b9db168 100644 --- a/sysutils/bacula15-server/Makefile +++ b/sysutils/bacula15-server/Makefile @@ -1,6 +1,6 @@ PORTNAME= bacula DISTVERSION= 15.0.2 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES?= sysutils MASTER_SITES= SF/bacula/bacula/${DISTVERSION} PKGNAMEPREFIX?= # diff --git a/sysutils/bacula15-server/Makefile.old b/sysutils/bacula15-server/Makefile.old new file mode 100644 index 000000000000..a9d84c4720a0 --- /dev/null +++ b/sysutils/bacula15-server/Makefile.old @@ -0,0 +1,207 @@ +PORTNAME= bacula +DISTVERSION= 15.0.2 +PORTREVISION= 2 +CATEGORIES?= sysutils +MASTER_SITES= SF/bacula/bacula/${DISTVERSION} +PKGNAMEPREFIX?= # +PKGNAMESUFFIX?= 15-server + +MAINTAINER= dvl@FreeBSD.org +COMMENT?= Network backup solution (server) +WWW= https://www.bacula.org/ + +LICENSE= AGPLv3 +LICENSE_FILE= ${WRKSRC}/LICENSE + +USES+= cpe libtool localbase python:env readline shebangfix ssl + +SHEBANG_FILES= scripts/get_malware_abuse.ch scripts/key-manager.py.in \ + scripts/md5tobase64.py src/cats/make_catalog_backup.pl.in +#scripts/baculabackupreport.in + +CONFLICTS?= bacula13-server bacula11-server bacula9-server + +LIB_DEPENDS+= liblzo2.so:archivers/lzo2 + +USERS= bacula +GROUPS= ${USERS} + +LIB_VERSION= ${DISTVERSION} + +PLIST_SUB+= LIB_VERSION=${LIB_VERSION} + +GNU_CONFIGURE= yes +GNU_CONFIGURE_MANPREFIX= ${PREFIX}/share +USE_LDCONFIG= yes + +OPTIONS_DEFINE?= IPV6 MTX NLS S3 +MTX_DESC= Install mtx for control of autochanger devices +S3_DESC= Install S3 plugin + +.if ${PKGNAMESUFFIX} == "15-server" +OPTIONS_MULTI= BACKEND +OPTIONS_MULTI_BACKEND= MYSQL PGSQL SQLITE3 +OPTIONS_DEFAULT+= PGSQL +.endif + +OPTIONS_SUB= yes + +.if ${PKGNAMESUFFIX} == "15-client" || ${PKGNAMESUFFIX} == "15-server" #Till end of the file + +.if !defined(WITH_CLIENT_ONLY) +LIB_DEPENDS+= libbac-${LIB_VERSION}.so:sysutils/bacula15-client +USE_RC_SUBR?= bacula-dir bacula-sd +.endif + +.if defined(WITH_CLIENT_ONLY) +SUB_FILES+= pkg-deinstall.client pkg-install.client pkg-message.client +.else +SUB_FILES+= pkg-message.server +.endif + +CONFIGURE_ARGS+= --disable-conio \ + --enable-batch-insert \ + --enable-smartalloc \ + --sysconfdir=${ETCDIR} \ + --with-baseport=9101 \ + --with-db-name=bacula \ + --with-db-user=bacula \ + --with-dump-email=root@localhost \ + --with-job-email=root@localhost \ + --with-logdir=/var/log \ + --with-plugindir=${PREFIX}/lib \ + --with-readline=${LOCALBASE} \ + --with-sbin-perm=755 \ + --with-scriptdir=${PREFIX}/share/${PORTNAME} \ + --with-tcp-wrappers=/usr/lib \ + --with-working-dir=${BACULA_DIR} + +.if defined(WITH_CLIENT_ONLY) +CONFIGURE_ARGS+= --with-fd-group=wheel \ + --with-fd-user=root +.else +CONFIGURE_ARGS+= --with-dir-group=${BACULA_GROUP} \ + --with-dir-user=${BACULA_USER} \ + --with-sd-group=operator \ + --with-sd-user=${BACULA_USER} +.endif + +# The user/group IDs below are registered, see +# http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/book.html#users-and-groups +# +BACULA_USER?= bacula +BACULA_GROUP?= ${BACULA_USER} +BACULA_UID?= bacula +BACULA_GID?= ${BACULA_UID} +BACULA_DIR?= /var/db/bacula + +PLIST_SUB+= BACULA_DIR=${BACULA_DIR} + +SUB_LIST+= BACULA_DIR=${BACULA_DIR} \ + BACULA_GID=${BACULA_GID} \ + BACULA_GROUP=${BACULA_GROUP} \ + BACULA_UID=${BACULA_UID} \ + BACULA_USER=${BACULA_USER} + +NLS_USES= gettext +NLS_CONFIGURE_ENABLE= nls + +# Client only or full server version +.if defined(WITH_CLIENT_ONLY) +CONFFILES= fd +CONFIGURE_ARGS+= --enable-client-only + +PKGDEINSTALL= ${FILESDIR}/pkg-deinstall.client +PKGINSTALL= ${FILESDIR}/pkg-install.client +.else +# Server only Options +CONFFILES= sd dir +# Server default database + +MYSQL_CONFIGURE_ON= --with-mysql=yes +MYSQL_USES= mysql +MYSQL_SUB_LIST= REQ_MYSQL=mysql +MYSQL_SUB_LIST_OFF= REQ_MYSQL="" +SQLITE3_CONFIGURE_ON= --with-sqlite3=yes +SQLITE3_USES= sqlite:3 +PGSQL_CONFIGURE_ON= --with-postgresql=yes +PGSQL_USES= pgsql +PGSQL_SUB_LIST= REQ_PGSQL=postgresql +PGSQL_SUB_LIST_OFF= REQ_PGSQL="" + +MTX_RUN_DEPENDS= ${LOCALBASE}/sbin/mtx:misc/mtx + +.endif + +S3_CONFIGURE_ARGS= --enable-s3 +S3_LIB_DEPENDS= libs3.so:sysutils/bacula-libs3 + +.include + +.if defined(WITH_CLIENT_ONLY) +MP8+= bacula.8 bacula-fd.8 bconsole.8 +.else +MP8+= bacula-dir.8 bacula-sd.8 bcopy.8 bextract.8 bls.8 bscan.8 \ + btape.8 btraceback.8 dbcheck.8 bwild.8 bregex.8 +MP1+= bsmtp.1 bacula-tray-monitor.1 +.endif + +MAKE_ENV+= MAN1="${MP1}" \ + MAN8="${MP8}" + +post-patch: +# This port does not install docs. See bacula-docs for that + @${REINPLACE_CMD} -e '/docdir/d' ${WRKSRC}/Makefile.in +# Change $(ECHO) to echo in some Makefile.in files + @${REINPLACE_CMD} -e 's|$$(ECHO)|echo|g' \ + ${WRKSRC}/src/filed/Makefile.in \ + ${WRKSRC}/src/console/Makefile.in \ + ${WRKSRC}/src/cats/Makefile.in \ + ${WRKSRC}/src/dird/Makefile.in \ + ${WRKSRC}/src/stored/Makefile.in \ + ${WRKSRC}/src/tools/Makefile.in + +# Default bconsole.conf is in ${ETCDIR} + @${REINPLACE_CMD} -e 's|./bconsole.conf|${ETCDIR}/bconsole.conf|g' ${WRKSRC}/src/console/console.c + @${REINPLACE_CMD} -e 's|^MAN8 =|MAN8 ?=|g' -e 's|^MAN1 =|MAN1 ?=|g' ${WRKSRC}/manpages/Makefile.in +.if defined(WITH_CLIENT_ONLY) +# In client port only install startup script out of script dir (see below post-install) +# Dont mkdir ${PREFIX}/share/bacula cause it's empty + @${REINPLACE_CMD} -e 's|^\(fd_subdirs = .*\)scripts\(.*\)|\1\2|g' ${WRKSRC}/Makefile.in + @${REINPLACE_CMD} -e 's|\(.*$${MKDIR} $${DESTDIR}$${scriptdir}\)|#\1|g' ${WRKSRC}/Makefile.in +.else +# In server port don't install filed + @${REINPLACE_CMD} -e '/^fd_subdirs = /s|src/filed||' -e 's|src/console||' \ + ${WRKSRC}/Makefile.in +.endif + +.if !target(post-install) +post-install: +.if defined(WITH_CLIENT_ONLY) + ${MV} ${STAGEDIR}${ETCDIR}/bconsole.conf ${STAGEDIR}${ETCDIR}/bconsole.conf.sample + ${INSTALL_DATA} ${WRKSRC}/examples/sample-query.sql ${STAGEDIR}${LOCALBASE}/share/bacula/query.sql.sample +.else + ${INSTALL_SCRIPT} ${FILESDIR}/chio-bacula ${STAGEDIR}${PREFIX}/sbin + ${INSTALL_DATA} ${FILESDIR}/bacula-barcodes ${STAGEDIR}${ETCDIR}/bacula-barcodes.sample +# bacula-dir attempts to install query.sql as bpart of bacula-server, but that should only installed by bacula-client. + ${RM} ${STAGEDIR}${LOCALBASE}/share/bacula/query.sql + +#the following are installed by the -CLIENT port, and I (ler@lerctr.org) +#don't know how to remove them from being built for the -SERVER port. + ${RM} ${STAGEDIR}${LOCALBASE}/lib/bpipe-fd.so + ${RM} ${STAGEDIR}${LOCALBASE}/lib/libbac-${LIB_VERSION}.so + ${RM} ${STAGEDIR}${LOCALBASE}/lib/libbac.so + ${RM} ${STAGEDIR}${LOCALBASE}/lib/libbaccfg-${LIB_VERSION}.so + ${RM} ${STAGEDIR}${LOCALBASE}/lib/libbaccfg.so + ${RM} ${STAGEDIR}${LOCALBASE}/lib/libbacfind-${LIB_VERSION}.so + ${RM} ${STAGEDIR}${LOCALBASE}/lib/libbacfind.so +.endif + for na in ${CONFFILES}; do \ + ${MV} ${STAGEDIR}${ETCDIR}/bacula-$$na.conf ${STAGEDIR}${ETCDIR}/bacula-$$na.conf.sample; \ + done +.endif +.else +.include "${MASTERDIR}/Makefile.common" +.endif # 15-client and 15-server are defined + +.include diff --git a/sysutils/bacula15-server/files/patch-src_lib_bsys.c b/sysutils/bacula15-server/files/patch-src_lib_bsys.c new file mode 100644 index 000000000000..15638f0e8617 --- /dev/null +++ b/sysutils/bacula15-server/files/patch-src_lib_bsys.c @@ -0,0 +1,29 @@ +--- src/lib/bsys.c.orig ++++ src/lib/bsys.c +@@ -1270,7 +1270,7 @@ + /* + * Determine the amount of heap used + * macOS - sbrk(0) is deprecated, use malloc info +- * Windows - not implemented ++ * Windows - not implemented and FreeBSD + * others - use sbrk(0) + */ + +@@ -1279,7 +1279,7 @@ + + void mark_heap() + { +-#if defined(HAVE_WIN32) ++#if defined(HAVE_WIN32) || defined(__FreeBSD__) + start_heap = 0; + #elif defined(HAVE_DARWIN_OS) + struct mstats ms = mstats(); +@@ -1296,6 +1296,8 @@ + #elif defined(HAVE_DARWIN_OS) + struct mstats ms = mstats(); + return (int64_t) ms.bytes_used - start_heap; ++#elif defined(__FreeBSD__) ++ return 0; + #else + return (int64_t) sbrk(0) - start_heap; + #endif