def _uptime_linux():
<EOL>try:<EOL><INDENT>f = open('<STR_LIT>', '<STR_LIT:r>')<EOL>up = float(f.readline().split()[<NUM_LIT:0>])<EOL>f.close()<EOL>return up<EOL><DEDENT>except (IOError, ValueError):<EOL><INDENT>pass<EOL><DEDENT>try:<EOL><INDENT>libc = ctypes.CDLL('<STR_LIT>')<EOL><DEDENT>except AttributeError:<EOL><INDENT>return None<EOL><DEDENT>except OSError:<EOL><INDENT>try:<EOL><INDENT>libc = ctypes.CDLL('<STR_LIT>')<EOL><DEDENT>except OSError:<EOL><INDENT>return None<EOL><DEDENT><DEDENT>if not hasattr(libc, '<STR_LIT>'):<EOL><INDENT>return None<EOL><DEDENT>buf = ctypes.create_string_buffer(<NUM_LIT>) <EOL>if libc.sysinfo(buf) < <NUM_LIT:0>:<EOL><INDENT>return None<EOL><DEDENT>up = struct.unpack_from('<STR_LIT>', buf.raw)[<NUM_LIT:0>]<EOL>if up < <NUM_LIT:0>:<EOL><INDENT>up = None<EOL><DEDENT>return up<EOL>
Returns uptime in seconds or None, on Linux.