'POSIX implementation for running process check.
Determine whether there is a running process corresponding to the given
PID.
@return: True if the given PID is currently running; false otherwise.
@rtype: L{bool}
@raise EnvironmentError: If this PID file cannot be read.
@raise InvalidPIDFileError: If this PID file\'s content is invalid.
@raise StalePIDFileError: If this PID file\'s content refers to a PID
for which there is no corresponding running process.'

@staticmethod
def _pidIsRunningPOSIX(pid):

    try:
        kill(pid, 0)
    except OSError as e:
        if (e.errno == errno.ESRCH):
            raise StalePIDFileError('PID    file    refers    to    non-existing    process')
        elif (e.errno == errno.EPERM):
            return True
        else:
            raise
    else:
        return True
