@@ -321,17 +321,22 @@ fn test_p_offsets() {
321321 Ok ( _) => panic ! ( "pwrite unexpectedly succeeded" ) ,
322322 Err ( e) => panic ! ( "pwrite failed with an unexpected error: {:?}" , e) ,
323323 }
324- match preadv ( & f, & mut [ IoSliceMut :: new ( & mut buf) ] , invalid_offset) {
325- Err ( rustix:: io:: Errno :: OPNOTSUPP | rustix:: io:: Errno :: NOSYS ) => { }
326- Err ( rustix:: io:: Errno :: INVAL ) => { }
327- Ok ( _) => panic ! ( "preadv unexpectedly succeeded" ) ,
328- Err ( e) => panic ! ( "preadv failed with an unexpected error: {:?}" , e) ,
329- }
330- match pwritev ( & f, & [ IoSlice :: new ( & buf) ] , invalid_offset) {
331- Err ( rustix:: io:: Errno :: OPNOTSUPP | rustix:: io:: Errno :: NOSYS ) => { }
332- Err ( rustix:: io:: Errno :: INVAL ) => { }
333- Ok ( _) => panic ! ( "pwritev unexpectedly succeeded" ) ,
334- Err ( e) => panic ! ( "pwritev failed with an unexpected error: {:?}" , e) ,
324+ // illumos doesn't seem to diagnose a negative offset in
325+ // `preadv`/`pwritev`.
326+ #[ cfg( not( target_os = "illumos" ) ) ]
327+ {
328+ match preadv ( & f, & mut [ IoSliceMut :: new ( & mut buf) ] , invalid_offset) {
329+ Err ( rustix:: io:: Errno :: OPNOTSUPP | rustix:: io:: Errno :: NOSYS ) => { }
330+ Err ( rustix:: io:: Errno :: INVAL ) => { }
331+ Ok ( _) => panic ! ( "preadv unexpectedly succeeded" ) ,
332+ Err ( e) => panic ! ( "preadv failed with an unexpected error: {:?}" , e) ,
333+ }
334+ match pwritev ( & f, & [ IoSlice :: new ( & buf) ] , invalid_offset) {
335+ Err ( rustix:: io:: Errno :: OPNOTSUPP | rustix:: io:: Errno :: NOSYS ) => { }
336+ Err ( rustix:: io:: Errno :: INVAL ) => { }
337+ Ok ( _) => panic ! ( "pwritev unexpectedly succeeded" ) ,
338+ Err ( e) => panic ! ( "pwritev failed with an unexpected error: {:?}" , e) ,
339+ }
335340 }
336341 #[ cfg( linux_kernel) ]
337342 {
0 commit comments