()
| 39 | } |
| 40 | |
| 41 | fn read() { |
| 42 | let f = preopen() |
| 43 | .open_at( |
| 44 | PathFlags::empty(), |
| 45 | "1mb", |
| 46 | OpenFlags::empty(), |
| 47 | DescriptorFlags::empty(), |
| 48 | ) |
| 49 | .unwrap(); |
| 50 | |
| 51 | // 0-length is ok |
| 52 | f.read(0, 0).unwrap(); |
| 53 | |
| 54 | // This isn't transferring data from the guest to the host, so this is ok. |
| 55 | f.read(1 << 20, 0).unwrap(); |
| 56 | |
| 57 | // Host shouldn't allocate based on what the guest asks for... |
| 58 | f.read(u64::MAX, 0).unwrap(); |
| 59 | |
| 60 | f.read_via_stream(0) |
| 61 | .unwrap() |
| 62 | .blocking_read(1 << 20) |
| 63 | .unwrap(); |
| 64 | } |
| 65 | |
| 66 | fn write() { |
| 67 | let f = preopen() |
no test coverage detected