Skip to content

Commit 9b6bd64

Browse files
committed
internal/poll: remove qty and flags fields from Windows' poll.operation
There is no need to keep the qty and flags fields in the poll.operation struct. This skims down the size of os.File by 16 bytes and makes poll.operation harder to misuse. Change-Id: I8943d88f29ed3c7eefbb83114b0d31052abbe646 Reviewed-on: https://go-review.googlesource.com/c/go/+/685436 Reviewed-by: Damien Neil <[email protected]> Reviewed-by: Mark Freeman <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
1 parent cd3655a commit 9b6bd64

File tree

2 files changed

+98
-69
lines changed

2 files changed

+98
-69
lines changed

src/internal/poll/fd_windows.go

Lines changed: 92 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,12 @@ type operation struct {
7777
mode int32
7878

7979
// fields used only by net package
80-
buf syscall.WSABuf
81-
msg windows.WSAMsg
82-
sa syscall.Sockaddr
83-
rsa *syscall.RawSockaddrAny
84-
rsan int32
85-
flags uint32
86-
qty uint32
87-
bufs []syscall.WSABuf
80+
buf syscall.WSABuf
81+
msg windows.WSAMsg
82+
sa syscall.Sockaddr
83+
rsa *syscall.RawSockaddrAny
84+
rsan int32
85+
bufs []syscall.WSABuf
8886
}
8987

9088
func (o *operation) setEvent() {
@@ -210,7 +208,7 @@ func (fd *FD) cancelIO(o *operation) {
210208
// It supports both synchronous and asynchronous IO.
211209
// o.qty and o.flags are set to zero before calling submit
212210
// to avoid reusing the values from a previous call.
213-
func (fd *FD) execIO(o *operation, submit func(o *operation) error) (int, error) {
211+
func (fd *FD) execIO(o *operation, submit func(o *operation) (uint32, error)) (int, error) {
214212
// Notify runtime netpoll about starting IO.
215213
err := fd.pd.prepare(int(o.mode), fd.isFile)
216214
if err != nil {
@@ -223,9 +221,7 @@ func (fd *FD) execIO(o *operation, submit func(o *operation) error) (int, error)
223221
// event to wait for the IO to complete.
224222
o.setEvent()
225223
}
226-
o.qty = 0
227-
o.flags = 0
228-
err = submit(o)
224+
qty, err := submit(o)
229225
var waitErr error
230226
// Blocking operations shouldn't return ERROR_IO_PENDING.
231227
// Continue without waiting if that happens.
@@ -240,9 +236,10 @@ func (fd *FD) execIO(o *operation, submit func(o *operation) error) (int, error)
240236
// before the cancellation request runs.
241237
}
242238
if fd.isFile {
243-
err = windows.GetOverlappedResult(fd.Sysfd, &o.o, &o.qty, false)
239+
err = windows.GetOverlappedResult(fd.Sysfd, &o.o, &qty, false)
244240
} else {
245-
err = windows.WSAGetOverlappedResult(fd.Sysfd, &o.o, &o.qty, false, &o.flags)
241+
var flags uint32
242+
err = windows.WSAGetOverlappedResult(fd.Sysfd, &o.o, &qty, false, &flags)
246243
}
247244
}
248245
switch err {
@@ -266,7 +263,7 @@ func (fd *FD) execIO(o *operation, submit func(o *operation) error) (int, error)
266263
err = waitErr
267264
}
268265
}
269-
return int(o.qty), err
266+
return int(qty), err
270267
}
271268

272269
// FD is a file descriptor. The net and os packages embed this type in
@@ -507,8 +504,9 @@ func (fd *FD) Read(buf []byte) (int, error) {
507504
case kindFile, kindPipe:
508505
o := &fd.rop
509506
o.InitBuf(buf)
510-
n, err = fd.execIO(o, func(o *operation) error {
511-
return syscall.ReadFile(fd.Sysfd, unsafe.Slice(o.buf.Buf, o.buf.Len), &o.qty, fd.overlapped(o))
507+
n, err = fd.execIO(o, func(o *operation) (qty uint32, err error) {
508+
err = syscall.ReadFile(fd.Sysfd, unsafe.Slice(o.buf.Buf, o.buf.Len), &qty, fd.overlapped(o))
509+
return qty, err
512510
})
513511
fd.addOffset(n)
514512
switch err {
@@ -523,8 +521,10 @@ func (fd *FD) Read(buf []byte) (int, error) {
523521
case kindNet:
524522
o := &fd.rop
525523
o.InitBuf(buf)
526-
n, err = fd.execIO(o, func(o *operation) error {
527-
return syscall.WSARecv(fd.Sysfd, &o.buf, 1, &o.qty, &o.flags, &o.o, nil)
524+
n, err = fd.execIO(o, func(o *operation) (qty uint32, err error) {
525+
var flags uint32
526+
err = syscall.WSARecv(fd.Sysfd, &o.buf, 1, &qty, &flags, &o.o, nil)
527+
return qty, err
528528
})
529529
if race.Enabled {
530530
race.Acquire(unsafe.Pointer(&ioSync))
@@ -638,8 +638,9 @@ func (fd *FD) Pread(b []byte, off int64) (int, error) {
638638
o := &fd.rop
639639
o.InitBuf(b)
640640
fd.setOffset(off)
641-
n, err := fd.execIO(o, func(o *operation) error {
642-
return syscall.ReadFile(fd.Sysfd, unsafe.Slice(o.buf.Buf, o.buf.Len), &o.qty, &o.o)
641+
n, err := fd.execIO(o, func(o *operation) (qty uint32, err error) {
642+
err = syscall.ReadFile(fd.Sysfd, unsafe.Slice(o.buf.Buf, o.buf.Len), &qty, &o.o)
643+
return qty, err
643644
})
644645
if err == syscall.ERROR_HANDLE_EOF {
645646
err = io.EOF
@@ -664,12 +665,14 @@ func (fd *FD) ReadFrom(buf []byte) (int, syscall.Sockaddr, error) {
664665
defer fd.readUnlock()
665666
o := &fd.rop
666667
o.InitBuf(buf)
667-
n, err := fd.execIO(o, func(o *operation) error {
668+
n, err := fd.execIO(o, func(o *operation) (qty uint32, err error) {
668669
if o.rsa == nil {
669670
o.rsa = new(syscall.RawSockaddrAny)
670671
}
671672
o.rsan = int32(unsafe.Sizeof(*o.rsa))
672-
return syscall.WSARecvFrom(fd.Sysfd, &o.buf, 1, &o.qty, &o.flags, o.rsa, &o.rsan, &o.o, nil)
673+
var flags uint32
674+
err = syscall.WSARecvFrom(fd.Sysfd, &o.buf, 1, &qty, &flags, o.rsa, &o.rsan, &o.o, nil)
675+
return qty, err
673676
})
674677
err = fd.eofError(n, err)
675678
if err != nil {
@@ -693,12 +696,14 @@ func (fd *FD) ReadFromInet4(buf []byte, sa4 *syscall.SockaddrInet4) (int, error)
693696
defer fd.readUnlock()
694697
o := &fd.rop
695698
o.InitBuf(buf)
696-
n, err := fd.execIO(o, func(o *operation) error {
699+
n, err := fd.execIO(o, func(o *operation) (qty uint32, err error) {
697700
if o.rsa == nil {
698701
o.rsa = new(syscall.RawSockaddrAny)
699702
}
700703
o.rsan = int32(unsafe.Sizeof(*o.rsa))
701-
return syscall.WSARecvFrom(fd.Sysfd, &o.buf, 1, &o.qty, &o.flags, o.rsa, &o.rsan, &o.o, nil)
704+
var flags uint32
705+
err = syscall.WSARecvFrom(fd.Sysfd, &o.buf, 1, &qty, &flags, o.rsa, &o.rsan, &o.o, nil)
706+
return qty, err
702707
})
703708
err = fd.eofError(n, err)
704709
if err != nil {
@@ -722,12 +727,14 @@ func (fd *FD) ReadFromInet6(buf []byte, sa6 *syscall.SockaddrInet6) (int, error)
722727
defer fd.readUnlock()
723728
o := &fd.rop
724729
o.InitBuf(buf)
725-
n, err := fd.execIO(o, func(o *operation) error {
730+
n, err := fd.execIO(o, func(o *operation) (qty uint32, err error) {
726731
if o.rsa == nil {
727732
o.rsa = new(syscall.RawSockaddrAny)
728733
}
729734
o.rsan = int32(unsafe.Sizeof(*o.rsa))
730-
return syscall.WSARecvFrom(fd.Sysfd, &o.buf, 1, &o.qty, &o.flags, o.rsa, &o.rsan, &o.o, nil)
735+
var flags uint32
736+
err = syscall.WSARecvFrom(fd.Sysfd, &o.buf, 1, &qty, &flags, o.rsa, &o.rsan, &o.o, nil)
737+
return qty, err
731738
})
732739
err = fd.eofError(n, err)
733740
if err != nil {
@@ -763,8 +770,9 @@ func (fd *FD) Write(buf []byte) (int, error) {
763770
case kindPipe, kindFile:
764771
o := &fd.wop
765772
o.InitBuf(b)
766-
n, err = fd.execIO(o, func(o *operation) error {
767-
return syscall.WriteFile(fd.Sysfd, unsafe.Slice(o.buf.Buf, o.buf.Len), &o.qty, fd.overlapped(o))
773+
n, err = fd.execIO(o, func(o *operation) (qty uint32, err error) {
774+
err = syscall.WriteFile(fd.Sysfd, unsafe.Slice(o.buf.Buf, o.buf.Len), &qty, fd.overlapped(o))
775+
return qty, err
768776
})
769777
fd.addOffset(n)
770778
case kindNet:
@@ -773,8 +781,9 @@ func (fd *FD) Write(buf []byte) (int, error) {
773781
}
774782
o := &fd.wop
775783
o.InitBuf(b)
776-
n, err = fd.execIO(o, func(o *operation) error {
777-
return syscall.WSASend(fd.Sysfd, &o.buf, 1, &o.qty, 0, &o.o, nil)
784+
n, err = fd.execIO(o, func(o *operation) (qty uint32, err error) {
785+
err = syscall.WSASend(fd.Sysfd, &o.buf, 1, &qty, 0, &o.o, nil)
786+
return qty, err
778787
})
779788
}
780789
ntotal += n
@@ -862,8 +871,9 @@ func (fd *FD) Pwrite(buf []byte, off int64) (int, error) {
862871
o := &fd.wop
863872
o.InitBuf(b)
864873
fd.setOffset(off + int64(ntotal))
865-
n, err := fd.execIO(o, func(o *operation) error {
866-
return syscall.WriteFile(fd.Sysfd, unsafe.Slice(o.buf.Buf, o.buf.Len), &o.qty, &o.o)
874+
n, err := fd.execIO(o, func(o *operation) (qty uint32, err error) {
875+
err = syscall.WriteFile(fd.Sysfd, unsafe.Slice(o.buf.Buf, o.buf.Len), &qty, &o.o)
876+
return qty, err
867877
})
868878
if n > 0 {
869879
ntotal += n
@@ -891,8 +901,9 @@ func (fd *FD) Writev(buf *[][]byte) (int64, error) {
891901
}
892902
o := &fd.wop
893903
o.InitBufs(buf)
894-
n, err := fd.execIO(o, func(o *operation) error {
895-
return syscall.WSASend(fd.Sysfd, &o.bufs[0], uint32(len(o.bufs)), &o.qty, 0, &o.o, nil)
904+
n, err := fd.execIO(o, func(o *operation) (qty uint32, err error) {
905+
err = syscall.WSASend(fd.Sysfd, &o.bufs[0], uint32(len(o.bufs)), &qty, 0, &o.o, nil)
906+
return qty, err
896907
})
897908
o.ClearBufs()
898909
TestHookDidWritev(n)
@@ -912,8 +923,9 @@ func (fd *FD) WriteTo(buf []byte, sa syscall.Sockaddr) (int, error) {
912923
o := &fd.wop
913924
o.InitBuf(buf)
914925
o.sa = sa
915-
n, err := fd.execIO(o, func(o *operation) error {
916-
return syscall.WSASendto(fd.Sysfd, &o.buf, 1, &o.qty, 0, o.sa, &o.o, nil)
926+
n, err := fd.execIO(o, func(o *operation) (qty uint32, err error) {
927+
err = syscall.WSASendto(fd.Sysfd, &o.buf, 1, &qty, 0, o.sa, &o.o, nil)
928+
return qty, err
917929
})
918930
return n, err
919931
}
@@ -927,8 +939,9 @@ func (fd *FD) WriteTo(buf []byte, sa syscall.Sockaddr) (int, error) {
927939
o := &fd.wop
928940
o.InitBuf(b)
929941
o.sa = sa
930-
n, err := fd.execIO(o, func(o *operation) error {
931-
return syscall.WSASendto(fd.Sysfd, &o.buf, 1, &o.qty, 0, o.sa, &o.o, nil)
942+
n, err := fd.execIO(o, func(o *operation) (qty uint32, err error) {
943+
err = syscall.WSASendto(fd.Sysfd, &o.buf, 1, &qty, 0, o.sa, &o.o, nil)
944+
return qty, err
932945
})
933946
ntotal += int(n)
934947
if err != nil {
@@ -950,8 +963,9 @@ func (fd *FD) WriteToInet4(buf []byte, sa4 *syscall.SockaddrInet4) (int, error)
950963
// handle zero-byte payload
951964
o := &fd.wop
952965
o.InitBuf(buf)
953-
n, err := fd.execIO(o, func(o *operation) error {
954-
return windows.WSASendtoInet4(fd.Sysfd, &o.buf, 1, &o.qty, 0, sa4, &o.o, nil)
966+
n, err := fd.execIO(o, func(o *operation) (qty uint32, err error) {
967+
err = windows.WSASendtoInet4(fd.Sysfd, &o.buf, 1, &qty, 0, sa4, &o.o, nil)
968+
return qty, err
955969
})
956970
return n, err
957971
}
@@ -964,8 +978,9 @@ func (fd *FD) WriteToInet4(buf []byte, sa4 *syscall.SockaddrInet4) (int, error)
964978
}
965979
o := &fd.wop
966980
o.InitBuf(b)
967-
n, err := fd.execIO(o, func(o *operation) error {
968-
return windows.WSASendtoInet4(fd.Sysfd, &o.buf, 1, &o.qty, 0, sa4, &o.o, nil)
981+
n, err := fd.execIO(o, func(o *operation) (qty uint32, err error) {
982+
err = windows.WSASendtoInet4(fd.Sysfd, &o.buf, 1, &qty, 0, sa4, &o.o, nil)
983+
return qty, err
969984
})
970985
ntotal += int(n)
971986
if err != nil {
@@ -987,8 +1002,9 @@ func (fd *FD) WriteToInet6(buf []byte, sa6 *syscall.SockaddrInet6) (int, error)
9871002
// handle zero-byte payload
9881003
o := &fd.wop
9891004
o.InitBuf(buf)
990-
n, err := fd.execIO(o, func(o *operation) error {
991-
return windows.WSASendtoInet6(fd.Sysfd, &o.buf, 1, &o.qty, 0, sa6, &o.o, nil)
1005+
n, err := fd.execIO(o, func(o *operation) (qty uint32, err error) {
1006+
err = windows.WSASendtoInet6(fd.Sysfd, &o.buf, 1, &qty, 0, sa6, &o.o, nil)
1007+
return qty, err
9921008
})
9931009
return n, err
9941010
}
@@ -1001,8 +1017,9 @@ func (fd *FD) WriteToInet6(buf []byte, sa6 *syscall.SockaddrInet6) (int, error)
10011017
}
10021018
o := &fd.wop
10031019
o.InitBuf(b)
1004-
n, err := fd.execIO(o, func(o *operation) error {
1005-
return windows.WSASendtoInet6(fd.Sysfd, &o.buf, 1, &o.qty, 0, sa6, &o.o, nil)
1020+
n, err := fd.execIO(o, func(o *operation) (qty uint32, err error) {
1021+
err = windows.WSASendtoInet6(fd.Sysfd, &o.buf, 1, &qty, 0, sa6, &o.o, nil)
1022+
return qty, err
10061023
})
10071024
ntotal += int(n)
10081025
if err != nil {
@@ -1019,17 +1036,18 @@ func (fd *FD) WriteToInet6(buf []byte, sa6 *syscall.SockaddrInet6) (int, error)
10191036
func (fd *FD) ConnectEx(ra syscall.Sockaddr) error {
10201037
o := &fd.wop
10211038
o.sa = ra
1022-
_, err := fd.execIO(o, func(o *operation) error {
1023-
return ConnectExFunc(fd.Sysfd, o.sa, nil, 0, nil, &o.o)
1039+
_, err := fd.execIO(o, func(o *operation) (uint32, error) {
1040+
return 0, ConnectExFunc(fd.Sysfd, o.sa, nil, 0, nil, &o.o)
10241041
})
10251042
return err
10261043
}
10271044

10281045
func (fd *FD) acceptOne(s syscall.Handle, rawsa []syscall.RawSockaddrAny, o *operation) (string, error) {
10291046
// Submit accept request.
10301047
o.rsan = int32(unsafe.Sizeof(rawsa[0]))
1031-
_, err := fd.execIO(o, func(o *operation) error {
1032-
return AcceptFunc(fd.Sysfd, s, (*byte)(unsafe.Pointer(&rawsa[0])), 0, uint32(o.rsan), uint32(o.rsan), &o.qty, &o.o)
1048+
_, err := fd.execIO(o, func(o *operation) (qty uint32, err error) {
1049+
err = AcceptFunc(fd.Sysfd, s, (*byte)(unsafe.Pointer(&rawsa[0])), 0, uint32(o.rsan), uint32(o.rsan), &qty, &o.o)
1050+
return qty, err
10331051
})
10341052
if err != nil {
10351053
CloseFunc(s)
@@ -1171,11 +1189,13 @@ func (fd *FD) RawRead(f func(uintptr) bool) error {
11711189
// socket is readable. h/t https://stackoverflow.com/a/42019668/332798
11721190
o := &fd.rop
11731191
o.InitBuf(nil)
1174-
_, err := fd.execIO(o, func(o *operation) error {
1192+
_, err := fd.execIO(o, func(o *operation) (qty uint32, err error) {
1193+
var flags uint32
11751194
if !fd.IsStream {
1176-
o.flags |= windows.MSG_PEEK
1195+
flags |= windows.MSG_PEEK
11771196
}
1178-
return syscall.WSARecv(fd.Sysfd, &o.buf, 1, &o.qty, &o.flags, &o.o, nil)
1197+
err = syscall.WSARecv(fd.Sysfd, &o.buf, 1, &qty, &flags, &o.o, nil)
1198+
return qty, err
11791199
})
11801200
if err == windows.WSAEMSGSIZE {
11811201
// expected with a 0-byte peek, ignore.
@@ -1270,8 +1290,9 @@ func (fd *FD) ReadMsg(p []byte, oob []byte, flags int) (int, int, int, syscall.S
12701290
o.msg.Name = (syscall.Pointer)(unsafe.Pointer(o.rsa))
12711291
o.msg.Namelen = int32(unsafe.Sizeof(*o.rsa))
12721292
o.msg.Flags = uint32(flags)
1273-
n, err := fd.execIO(o, func(o *operation) error {
1274-
return windows.WSARecvMsg(fd.Sysfd, &o.msg, &o.qty, &o.o, nil)
1293+
n, err := fd.execIO(o, func(o *operation) (qty uint32, err error) {
1294+
err = windows.WSARecvMsg(fd.Sysfd, &o.msg, &qty, &o.o, nil)
1295+
return qty, err
12751296
})
12761297
err = fd.eofError(n, err)
12771298
var sa syscall.Sockaddr
@@ -1300,8 +1321,9 @@ func (fd *FD) ReadMsgInet4(p []byte, oob []byte, flags int, sa4 *syscall.Sockadd
13001321
o.msg.Name = (syscall.Pointer)(unsafe.Pointer(o.rsa))
13011322
o.msg.Namelen = int32(unsafe.Sizeof(*o.rsa))
13021323
o.msg.Flags = uint32(flags)
1303-
n, err := fd.execIO(o, func(o *operation) error {
1304-
return windows.WSARecvMsg(fd.Sysfd, &o.msg, &o.qty, &o.o, nil)
1324+
n, err := fd.execIO(o, func(o *operation) (qty uint32, err error) {
1325+
err = windows.WSARecvMsg(fd.Sysfd, &o.msg, &qty, &o.o, nil)
1326+
return qty, err
13051327
})
13061328
err = fd.eofError(n, err)
13071329
if err == nil {
@@ -1329,8 +1351,9 @@ func (fd *FD) ReadMsgInet6(p []byte, oob []byte, flags int, sa6 *syscall.Sockadd
13291351
o.msg.Name = (syscall.Pointer)(unsafe.Pointer(o.rsa))
13301352
o.msg.Namelen = int32(unsafe.Sizeof(*o.rsa))
13311353
o.msg.Flags = uint32(flags)
1332-
n, err := fd.execIO(o, func(o *operation) error {
1333-
return windows.WSARecvMsg(fd.Sysfd, &o.msg, &o.qty, &o.o, nil)
1354+
n, err := fd.execIO(o, func(o *operation) (qty uint32, err error) {
1355+
err = windows.WSARecvMsg(fd.Sysfd, &o.msg, &qty, &o.o, nil)
1356+
return qty, err
13341357
})
13351358
err = fd.eofError(n, err)
13361359
if err == nil {
@@ -1363,8 +1386,9 @@ func (fd *FD) WriteMsg(p []byte, oob []byte, sa syscall.Sockaddr) (int, int, err
13631386
o.msg.Name = (syscall.Pointer)(unsafe.Pointer(o.rsa))
13641387
o.msg.Namelen = len
13651388
}
1366-
n, err := fd.execIO(o, func(o *operation) error {
1367-
return windows.WSASendMsg(fd.Sysfd, &o.msg, 0, &o.qty, &o.o, nil)
1389+
n, err := fd.execIO(o, func(o *operation) (qty uint32, err error) {
1390+
err = windows.WSASendMsg(fd.Sysfd, &o.msg, 0, nil, &o.o, nil)
1391+
return qty, err
13681392
})
13691393
return n, int(o.msg.Control.Len), err
13701394
}
@@ -1388,8 +1412,9 @@ func (fd *FD) WriteMsgInet4(p []byte, oob []byte, sa *syscall.SockaddrInet4) (in
13881412
len := sockaddrInet4ToRaw(o.rsa, sa)
13891413
o.msg.Name = (syscall.Pointer)(unsafe.Pointer(o.rsa))
13901414
o.msg.Namelen = len
1391-
n, err := fd.execIO(o, func(o *operation) error {
1392-
return windows.WSASendMsg(fd.Sysfd, &o.msg, 0, &o.qty, &o.o, nil)
1415+
n, err := fd.execIO(o, func(o *operation) (qty uint32, err error) {
1416+
err = windows.WSASendMsg(fd.Sysfd, &o.msg, 0, nil, &o.o, nil)
1417+
return qty, err
13931418
})
13941419
return n, int(o.msg.Control.Len), err
13951420
}
@@ -1413,8 +1438,9 @@ func (fd *FD) WriteMsgInet6(p []byte, oob []byte, sa *syscall.SockaddrInet6) (in
14131438
len := sockaddrInet6ToRaw(o.rsa, sa)
14141439
o.msg.Name = (syscall.Pointer)(unsafe.Pointer(o.rsa))
14151440
o.msg.Namelen = len
1416-
n, err := fd.execIO(o, func(o *operation) error {
1417-
return windows.WSASendMsg(fd.Sysfd, &o.msg, 0, &o.qty, &o.o, nil)
1441+
n, err := fd.execIO(o, func(o *operation) (qty uint32, err error) {
1442+
err = windows.WSASendMsg(fd.Sysfd, &o.msg, 0, nil, &o.o, nil)
1443+
return qty, err
14181444
})
14191445
return n, int(o.msg.Control.Len), err
14201446
}

src/internal/poll/sendfile_windows.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,12 @@ func SendFile(fd *FD, src uintptr, size int64) (written int64, err error, handle
7373
o.o.Offset = uint32(off)
7474
o.o.OffsetHigh = uint32(off >> 32)
7575

76-
n, err := fd.execIO(o, func(o *operation) error {
77-
o.qty = uint32(chunkSize)
78-
return syscall.TransmitFile(fd.Sysfd, hsrc, o.qty, 0, &o.o, nil, syscall.TF_WRITE_BEHIND)
76+
n, err := fd.execIO(o, func(o *operation) (uint32, error) {
77+
err := syscall.TransmitFile(fd.Sysfd, hsrc, uint32(chunkSize), 0, &o.o, nil, syscall.TF_WRITE_BEHIND)
78+
if err != nil {
79+
return 0, err
80+
}
81+
return uint32(chunkSize), nil
7982
})
8083
if err != nil {
8184
return written, err, written > 0

0 commit comments

Comments
 (0)