示例#1
0
def test_set_status_flags():
    fd1, fd2 = os.pipe()
    try:
        flags = rposix.get_status_flags(fd1)
        assert flags & rposix.O_NONBLOCK == 0
        rposix.set_status_flags(fd1, flags | rposix.O_NONBLOCK)
        assert rposix.get_status_flags(fd1) & rposix.O_NONBLOCK != 0
    finally:
        os.close(fd1)
        os.close(fd2)
示例#2
0
def test_set_status_flags():
    fd1, fd2 = os.pipe()
    try:
        flags = rposix.get_status_flags(fd1)
        assert flags & rposix.O_NONBLOCK == 0
        rposix.set_status_flags(fd1, flags | rposix.O_NONBLOCK)
        assert rposix.get_status_flags(fd1) & rposix.O_NONBLOCK != 0
    finally:
        os.close(fd1)
        os.close(fd2)