# File lib/puppet/util/selinux.rb, line 154
154:     def read_mounts
155:         mounts = ""
156:         begin
157:             if File.instance_methods.include? "read_nonblock"
158:                 # If possible we use read_nonblock() in a loop rather than read() to work-
159:                 # a linux kernel bug.  See ticket #1963 for details.
160:                 mountfh = File.open("/proc/mounts")
161:                 mounts += mountfh.read_nonblock(1024) while true
162:             else
163:                 # Otherwise we shell out and let cat do it for us
164:                 mountfh = IO.popen("/bin/cat /proc/mounts")
165:                 mounts = mountfh.read
166:             end
167:         rescue EOFError
168:             # that's expected
169:         rescue
170:             return nil
171:         ensure        
172:             mountfh.close
173:         end
174: 
175:         mntpoint = {}
176: 
177:         # Read all entries in /proc/mounts.  The second column is the
178:         # mountpoint and the third column is the filesystem type.
179:         # We skip rootfs because it is always mounted at /
180:         mounts.collect do |line|
181:             params = line.split(' ')
182:             next if params[2] == 'rootfs'
183:             mntpoint[params[1]] = params[2]
184:         end
185:         return mntpoint
186:     end