# File lib/rfuse.rb, line 310
        def loop()
            raise RFuse::Error, "Already running!" if @running
            raise RFuse::Error, "FUSE not mounted" unless mounted?
            @running = true
            while @running do
                begin
                    ready, ignore, errors  = IO.select([@fuse_io,@pr],[],[@fuse_io])

                    if ready.include?(@pr)

                        signo = @pr.read_nonblock(1).unpack("c")[0]

                        # Signal.signame exist in Ruby 2, but returns horrible errors for non-signals in 2.1.0
                        if (signame = Signal.list.invert[signo])
                            call_sigmethod(sigmethod(signame))
                        end

                    elsif errors.include?(@fuse_io)

                        @running = false
                        raise RFuse::Error, "FUSE error"

                    elsif ready.include?(@fuse_io)
                        if process() < 0
                            # Fuse has been unmounted externally
                            # TODO: mounted? should now return false
                            # fuse_exited? is not true...
                            @running = false
                        end
                    end
                rescue Errno::EWOULDBLOCK, Errno::EAGAIN
                    #oh well...
                end
            end
        end