Page MenuHomeFreeBSD

Use if ... else when printing memory attributes
ClosedPublic

Authored by andrew on Apr 11 2021, 11:41 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Aug 8, 5:11 PM
Unknown Object (File)
Fri, Aug 7, 12:37 PM
Unknown Object (File)
Fri, Aug 7, 11:57 AM
Unknown Object (File)
Thu, Aug 6, 2:33 PM
Unknown Object (File)
Thu, Aug 6, 11:13 AM
Unknown Object (File)
Wed, Aug 5, 8:06 AM
Unknown Object (File)
Sat, Jul 25, 6:22 PM
Unknown Object (File)
Fri, Jul 24, 8:23 PM
Subscribers

Details

Summary

In vmstat there is a switch statement that converts these attributes to
a string. As some values can be duplicate we have to hide these from
userspace.

Replace this switch statement with an if ... else macro that lets us
repeat values without a compiler error.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable