#NEWLINE# def shm_counters( ) : #NEWLINE# #INDENT# f = open ( '/proc/sysvipc/shm' , 'r' ) #NEWLINE# try : #NEWLINE# #INDENT# lines = f . readlines ( ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# f . close ( ) #NEWLINE# #UNINDENT# retdict = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for line in lines [ 2 : ] : #NEWLINE# #INDENT# fields = line . split ( ) #NEWLINE# shmid = int ( fields [ 1 ] ) #NEWLINE# perms = int ( fields [ 2 ] ) #NEWLINE# size = int ( fields [ 3 ] ) #NEWLINE# cpid = int ( fields [ 4 ] ) #NEWLINE# lpid = int ( fields [ 5 ] ) #NEWLINE# nattach = int ( fields [ 6 ] ) #NEWLINE# swap = int ( fields [ 11 ] ) #NEWLINE# retdict [ shmid ] = ( perms , size , cpid , lpid , nattach , swap ) #NEWLINE# #UNINDENT# return retdict