]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Disable some explicit sbrk() usage
authorBenjamin Kaduk <kaduk@mit.edu>
Fri, 10 Jan 2014 04:34:30 +0000 (23:34 -0500)
committerStephan Wiesand <stephan.wiesand@desy.de>
Wed, 12 Feb 2014 15:41:48 +0000 (07:41 -0800)
Mac OS X 10.9 now considers this function deprecated and warns on
its use, causing the buildslave configuration to error out.

On master, we added a library routine to get a process's size to opr;
opr is not present on the 1.6 branch so another route is needed here.

Since use of the OS X malloc implementation appears to have no
effect on the result of sbrk(0), there is no loss of functionality
by replacing the function call with a (different) constant value.

There may still be some value in sbrk(0) on other systems, so
only disable sbrk() for OS X, on the stable branch.

This change is specific to the 1.6 branch.

Change-Id: Ie5f96e923b78be22a9ce83d0a35a7675d517b073
Reviewed-on: http://gerrit.openafs.org/10746
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/viced/afsfileprocs.c
src/viced/viced.c

index 2d86ea9f6e3b8f3fe4cfad9fddc2db20243eaec6..d831bd79d792d474fd6d04c943017481dc14b938 100644 (file)
@@ -5765,7 +5765,7 @@ SetAFSStats(struct AFSStatistics *stats)
     if (seconds <= 0)
        seconds = 1;
     stats->StoreDataRate = AFSCallStats.TotalStoredBytes / seconds;
-#ifdef AFS_NT40_ENV
+#if defined(AFS_NT40_ENV) || defined(AFS_DARWIN_ENV)
     stats->ProcessSize = -1;   /* TODO: */
 #else
     stats->ProcessSize = (afs_int32) ((long)sbrk(0) >> 10);
@@ -5927,7 +5927,7 @@ SRXAFS_GetStatistics64(struct rx_call *acall, afs_int32 statsVersion, ViceStatis
         seconds = 1;
     Statistics->ViceStatistics64_val[STATS64_STOREDATARATE] =
        AFSCallStats.TotalStoredBytes / seconds;
-#ifdef AFS_NT40_ENV
+#if defined(AFS_NT40_ENV) || defined(AFS_DARWIN_ENV)
     Statistics->ViceStatistics64_val[STATS64_PROCESSSIZE] = -1;
 #else
     Statistics->ViceStatistics64_val[STATS64_PROCESSSIZE] =
index 24ecfa201cd39ccf7fefb3d38b747e75ca83ffc1..6878e31da87395c79fe0ed9f0d39acc9fe8e3a87 100644 (file)
@@ -735,7 +735,7 @@ PrintCounters(void)
     audit_PrintStats(stderr);
     h_PrintStats();
     PrintCallBackStats();
-#ifdef AFS_NT40_ENV
+#if defined(AFS_NT40_ENV) || defined(AFS_DARWIN_ENV)
     processSize = -1;          /* TODO: */
 #else
     processSize = (int)((long)sbrk(0) >> 10);