From 6a53baef1edf913faad8d6e700e03a674801143b Mon Sep 17 00:00:00 2001 From: zhandaohong Date: Wed, 6 Dec 2023 21:04:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=89=A7=E8=A1=8Csysc?= =?UTF-8?q?all.SYS=5FREADV=E7=B3=BB=E7=BB=9F=E8=B0=83=E7=94=A8=E5=8C=85?= =?UTF-8?q?=E8=A3=85=E5=87=BD=E6=95=B0readv=E6=97=B6=EF=BC=8C=E8=AF=BB?= =?UTF-8?q?=E5=AE=8C=E6=95=B0=E6=8D=AE=E5=90=8E=EF=BC=8C=E5=8F=88=E6=B8=85?= =?UTF-8?q?=E7=A9=BA=E7=BC=93=E5=86=B2=E5=8C=BA=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sys_exec.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys_exec.go b/sys_exec.go index 1c8e40e4..28171e36 100644 --- a/sys_exec.go +++ b/sys_exec.go @@ -86,7 +86,6 @@ func readv(fd int, bs [][]byte, ivs []syscall.Iovec) (n int, err error) { } // syscall r, _, e := syscall.RawSyscall(syscall.SYS_READV, uintptr(fd), uintptr(unsafe.Pointer(&ivs[0])), uintptr(iovLen)) - resetIovecs(bs, ivs[:iovLen]) if e != 0 { return int(r), syscall.Errno(e) } @@ -94,8 +93,10 @@ func readv(fd int, bs [][]byte, ivs []syscall.Iovec) (n int, err error) { } // TODO: read from sysconf(_SC_IOV_MAX)? The Linux default is -// 1024 and this seems conservative enough for now. Darwin's -// UIO_MAXIOV also seems to be 1024. +// +// 1024 and this seems conservative enough for now. Darwin's +// UIO_MAXIOV also seems to be 1024. +// // iovecs limit length to 2GB(2^31) func iovecs(bs [][]byte, ivs []syscall.Iovec) (iovLen int) { totalLen := 0