View Issue Details

IDProjectCategoryView StatusLast Update
0037205FPCRTLpublic2020-07-01 11:33
ReporterTrevor Roydhouse Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
PlatformApple Mac miniOSmacOS 
Product Version3.3.1 
Summary0037205: [PATCH] Missing and incorrect sysctl MIB array integers OS X
DescriptionThe macOS /usr/include/sys/sysctl.h header is:

#define VM_METER 1 /* struct vmmeter */
#define VM_LOADAVG 2 /* struct loadavg */
/*
 * Note: "3" was skipped sometime ago and should probably remain unused
 * to avoid any new entry from being accepted by older kernels...
 */
#define VM_MACHFACTOR 4 /* struct loadavg with mach factor*/
#define VM_SWAPUSAGE 5 /* total swap usage */
#define VM_MAXID 6 /* number of valid vm ids */

But the rtl/darwin/sysctlh.inc has VM_MAXID assigned to 3 (which is unused) and is missing VM_SWAPUSAGE altogether.

I have attached a patch to correct this.
TagsMacOS, patch, rtl
Fixed in Revision
FPCOldBugId
FPCTarget-
Attached Files

Activities

Trevor Roydhouse

2020-06-12 03:52

reporter  

rtl_sysctlh_patch (721 bytes)   
Index: rtl/darwin/sysctlh.inc
===================================================================
--- rtl/darwin/sysctlh.inc	(revision 45530)
+++ rtl/darwin/sysctlh.inc	(working copy)
@@ -368,10 +368,14 @@
        VM_METER = 1;
     { struct loadavg  }
        VM_LOADAVG = 2;
-    { number of valid vm ids  }
-       VM_MAXID = 3;
+    {  Note: "3" was skipped sometime ago and should probably remain unused 
+             to avoid any new entry from being accepted by older kernels...}
     { struct loadavg with mach factor }
        VM_MACHFACTOR = 4;
+    { struct loadavg with mach factor }
+       VM_SWAPUSAGE = 5;
+    { number of valid vm ids  }
+       VM_MAXID = 6;
     {
        CTL_HW identifiers
       }
rtl_sysctlh_patch (721 bytes)   

Trevor Roydhouse

2020-06-13 02:37

reporter   ~0123409

New patch. Fixed incorrect comment for VM_SWAPUSAGE
rtl_sysctlh_patch-2 (706 bytes)   
Index: rtl/darwin/sysctlh.inc
===================================================================
--- rtl/darwin/sysctlh.inc	(revision 45530)
+++ rtl/darwin/sysctlh.inc	(working copy)
@@ -368,10 +368,14 @@
        VM_METER = 1;
     { struct loadavg  }
        VM_LOADAVG = 2;
-    { number of valid vm ids  }
-       VM_MAXID = 3;
+    {  Note: "3" was skipped sometime ago and should probably remain unused 
+             to avoid any new entry from being accepted by older kernels...}
     { struct loadavg with mach factor }
        VM_MACHFACTOR = 4;
+    { total swap usage }
+       VM_SWAPUSAGE = 5;
+    { number of valid vm ids  }
+       VM_MAXID = 6;
     {
        CTL_HW identifiers
       }
rtl_sysctlh_patch-2 (706 bytes)   

Issue History

Date Modified Username Field Change
2020-06-12 03:52 Trevor Roydhouse New Issue
2020-06-12 03:52 Trevor Roydhouse File Added: rtl_sysctlh_patch
2020-06-12 03:54 Trevor Roydhouse Tag Attached: MacOS
2020-06-12 03:54 Trevor Roydhouse Tag Attached: rtl
2020-06-12 03:54 Trevor Roydhouse Tag Attached: patch
2020-06-13 02:37 Trevor Roydhouse Note Added: 0123409
2020-06-13 02:37 Trevor Roydhouse File Added: rtl_sysctlh_patch-2
2020-07-01 11:33 Marco van de Voort Summary [PATCH] Missing and incorrect sysctl MIB array integers => [PATCH] Missing and incorrect sysctl MIB array integers OS X
2020-07-01 11:33 Marco van de Voort FPCTarget => -