Browse code

Add some basic doc for SysInfo

Signed-off-by: Eric Rafaloff <erafaloff@gmail.com>

Eric Rafaloff authored on 2015/03/27 12:05:07
Showing 2 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1 @@
0
+SysInfo stores information about which features a kernel supports.
... ...
@@ -9,6 +9,7 @@ import (
9 9
 	"github.com/docker/libcontainer/cgroups"
10 10
 )
11 11
 
12
+// SysInfo stores information about which features a kernel supports.
12 13
 type SysInfo struct {
13 14
 	MemoryLimit            bool
14 15
 	SwapLimit              bool
... ...
@@ -16,6 +17,7 @@ type SysInfo struct {
16 16
 	AppArmor               bool
17 17
 }
18 18
 
19
+// Returns a new SysInfo, using the filesystem to detect which features the kernel supports.
19 20
 func New(quiet bool) *SysInfo {
20 21
 	sysInfo := &SysInfo{}
21 22
 	if cgroupMemoryMountpoint, err := cgroups.FindCgroupMountpoint("memory"); err != nil {
... ...
@@ -37,7 +39,7 @@ func New(quiet bool) *SysInfo {
37 37
 		}
38 38
 	}
39 39
 
40
-	// Check if AppArmor seems to be enabled on this system.
40
+	// Check if AppArmor is supported
41 41
 	if _, err := os.Stat("/sys/kernel/security/apparmor"); os.IsNotExist(err) {
42 42
 		sysInfo.AppArmor = false
43 43
 	} else {