@@ -605,10 +605,6 @@ func Connectx(fd int, srcIf uint32, srcAddr, dstAddr Sockaddr, associd SaeAssocI
605605const minIovec = 8
606606
607607func Readv (fd int , iovs [][]byte ) (n int , err error ) {
608- if ! darwinKernelVersionMin (11 , 0 , 0 ) {
609- return 0 , ENOSYS
610- }
611-
612608 iovecs := make ([]Iovec , 0 , minIovec )
613609 iovecs = appendBytes (iovecs , iovs )
614610 n , err = readv (fd , iovecs )
@@ -617,9 +613,6 @@ func Readv(fd int, iovs [][]byte) (n int, err error) {
617613}
618614
619615func Preadv (fd int , iovs [][]byte , offset int64 ) (n int , err error ) {
620- if ! darwinKernelVersionMin (11 , 0 , 0 ) {
621- return 0 , ENOSYS
622- }
623616 iovecs := make ([]Iovec , 0 , minIovec )
624617 iovecs = appendBytes (iovecs , iovs )
625618 n , err = preadv (fd , iovecs , offset )
@@ -628,10 +621,6 @@ func Preadv(fd int, iovs [][]byte, offset int64) (n int, err error) {
628621}
629622
630623func Writev (fd int , iovs [][]byte ) (n int , err error ) {
631- if ! darwinKernelVersionMin (11 , 0 , 0 ) {
632- return 0 , ENOSYS
633- }
634-
635624 iovecs := make ([]Iovec , 0 , minIovec )
636625 iovecs = appendBytes (iovecs , iovs )
637626 if raceenabled {
@@ -643,10 +632,6 @@ func Writev(fd int, iovs [][]byte) (n int, err error) {
643632}
644633
645634func Pwritev (fd int , iovs [][]byte , offset int64 ) (n int , err error ) {
646- if ! darwinKernelVersionMin (11 , 0 , 0 ) {
647- return 0 , ENOSYS
648- }
649-
650635 iovecs := make ([]Iovec , 0 , minIovec )
651636 iovecs = appendBytes (iovecs , iovs )
652637 if raceenabled {
@@ -706,45 +691,6 @@ func readvRacedetect(iovecs []Iovec, n int, err error) {
706691 }
707692}
708693
709- func darwinMajorMinPatch () (maj , min , patch int , err error ) {
710- var un Utsname
711- err = Uname (& un )
712- if err != nil {
713- return
714- }
715-
716- var mmp [3 ]int
717- c := 0
718- Loop:
719- for _ , b := range un .Release [:] {
720- switch {
721- case b >= '0' && b <= '9' :
722- mmp [c ] = 10 * mmp [c ] + int (b - '0' )
723- case b == '.' :
724- c ++
725- if c > 2 {
726- return 0 , 0 , 0 , ENOTSUP
727- }
728- case b == 0 :
729- break Loop
730- default :
731- return 0 , 0 , 0 , ENOTSUP
732- }
733- }
734- if c != 2 {
735- return 0 , 0 , 0 , ENOTSUP
736- }
737- return mmp [0 ], mmp [1 ], mmp [2 ], nil
738- }
739-
740- func darwinKernelVersionMin (maj , min , patch int ) bool {
741- actualMaj , actualMin , actualPatch , err := darwinMajorMinPatch ()
742- if err != nil {
743- return false
744- }
745- return actualMaj > maj || actualMaj == maj && (actualMin > min || actualMin == min && actualPatch >= patch )
746- }
747-
748694//sys connectx(fd int, endpoints *SaEndpoints, associd SaeAssocID, flags uint32, iov []Iovec, n *uintptr, connid *SaeConnID) (err error)
749695//sys sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error)
750696
0 commit comments