Home | History | Annotate | Download | only in test

Lines Matching defs:fcntl

1 """Test program for the fcntl C module.
15 fcntl = import_module('fcntl')
40 fcntl.F_WRLCK, 0)
42 lockdata = struct.pack('hhlllii', fcntl.F_WRLCK, 0, 0, 0, 0, 0, 0)
46 lockdata = struct.pack('hh'+start_len+'hh', fcntl.F_WRLCK, 0, 0, 0, 0, 0)
68 rv = fcntl.fcntl(self.f.fileno(), fcntl.F_SETFL, os.O_NONBLOCK)
70 print 'Status from fcntl with O_NONBLOCK: ', rv
72 rv = fcntl.fcntl(self.f.fileno(), fcntl.F_SETLKW, lockdata)
74 print 'String from fcntl with F_SETLKW: ', repr(rv)
80 rv = fcntl.fcntl(self.f, fcntl.F_SETFL, os.O_NONBLOCK)
82 rv = fcntl.fcntl(self.f, fcntl.F_SETLKW, lockdata)
91 self.assertRaises(ValueError, fcntl.fcntl, -1, fcntl.F_SETFL, os.O_NONBLOCK)
92 self.assertRaises(ValueError, fcntl.fcntl, F(-1), fcntl.F_SETFL, os.O_NONBLOCK)
93 self.assertRaises(TypeError, fcntl.fcntl, 'spam', fcntl.F_SETFL, os.O_NONBLOCK)
94 self.assertRaises(TypeError, fcntl.fcntl, F('spam'), fcntl.F_SETFL, os.O_NONBLOCK)
96 self.assertRaises(ValueError, fcntl.fcntl, _testcapi.INT_MAX + 1,
97 fcntl.F_SETFL, os.O_NONBLOCK)
98 self.assertRaises(ValueError, fcntl.fcntl, F(_testcapi.INT_MAX + 1),
99 fcntl.F_SETFL, os.O_NONBLOCK)
100 self.assertRaises(ValueError, fcntl.fcntl, _testcapi.INT_MIN - 1,
101 fcntl.F_SETFL, os.O_NONBLOCK)
102 self.assertRaises(ValueError, fcntl.fcntl, F(_testcapi.INT_MIN - 1),
103 fcntl.F_SETFL, os.O_NONBLOCK)
106 # Issue #1309352: fcntl shouldn't fail when the third arg fits in a
109 cmd = fcntl.F_NOTIFY
111 flags = fcntl.DN_MULTISHOT
116 fcntl.fcntl(fd, cmd, flags)