@ttsc/darwin-x64 0.6.0-dev.20250501-2 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/bin/go/VERSION +2 -2
  2. package/bin/go/bin/go +0 -0
  3. package/bin/go/bin/gofmt +0 -0
  4. package/bin/go/pkg/tool/darwin_amd64/asm +0 -0
  5. package/bin/go/pkg/tool/darwin_amd64/cgo +0 -0
  6. package/bin/go/pkg/tool/darwin_amd64/compile +0 -0
  7. package/bin/go/pkg/tool/darwin_amd64/cover +0 -0
  8. package/bin/go/pkg/tool/darwin_amd64/fix +0 -0
  9. package/bin/go/pkg/tool/darwin_amd64/link +0 -0
  10. package/bin/go/pkg/tool/darwin_amd64/preprofile +0 -0
  11. package/bin/go/pkg/tool/darwin_amd64/vet +0 -0
  12. package/bin/go/src/archive/tar/format.go +0 -6
  13. package/bin/go/src/archive/tar/reader.go +4 -24
  14. package/bin/go/src/builtin/builtin.go +4 -13
  15. package/bin/go/src/crypto/tls/conn.go +3 -7
  16. package/bin/go/src/crypto/tls/handshake_client_tls13.go +2 -2
  17. package/bin/go/src/crypto/tls/handshake_server_tls13.go +2 -2
  18. package/bin/go/src/crypto/x509/constraints.go +33 -33
  19. package/bin/go/src/crypto/x509/verify.go +13 -28
  20. package/bin/go/src/html/template/attr_string.go +2 -3
  21. package/bin/go/src/html/template/context.go +1 -21
  22. package/bin/go/src/html/template/element_string.go +2 -3
  23. package/bin/go/src/html/template/escape.go +2 -16
  24. package/bin/go/src/html/template/state_string.go +3 -5
  25. package/bin/go/src/html/template/transition.go +6 -41
  26. package/bin/go/src/internal/buildcfg/zbootstrap.go +1 -1
  27. package/bin/go/src/internal/godebugs/table.go +0 -1
  28. package/bin/go/src/internal/poll/fd_windows.go +38 -64
  29. package/bin/go/src/internal/poll/sendfile_windows.go +1 -3
  30. package/bin/go/src/internal/syscall/unix/at.go +17 -0
  31. package/bin/go/src/internal/syscall/unix/at_sysnum_linux.go +1 -2
  32. package/bin/go/src/internal/syscall/windows/at_windows.go +3 -20
  33. package/bin/go/src/internal/syscall/windows/syscall_windows.go +0 -4
  34. package/bin/go/src/internal/syscall/windows/types_windows.go +0 -82
  35. package/bin/go/src/internal/syscall/windows/zsyscall_windows.go +0 -27
  36. package/bin/go/src/net/http/doc.go +1 -0
  37. package/bin/go/src/net/sendfile.go +0 -2
  38. package/bin/go/src/net/sendfile_stub.go +0 -2
  39. package/bin/go/src/net/sendfile_windows.go +0 -3
  40. package/bin/go/src/net/url/url.go +16 -21
  41. package/bin/go/src/os/dir_darwin.go +2 -2
  42. package/bin/go/src/os/dir_unix.go +2 -2
  43. package/bin/go/src/os/file.go +3 -0
  44. package/bin/go/src/os/file_unix.go +5 -9
  45. package/bin/go/src/os/root_unix.go +0 -1
  46. package/bin/go/src/os/stat.go +0 -3
  47. package/bin/go/src/reflect/value.go +2 -3
  48. package/bin/go/src/runtime/defs_linux_mips64x.go +1 -1
  49. package/bin/go/src/runtime/defs_linux_mipsx.go +1 -1
  50. package/bin/go/src/runtime/metrics/doc.go +0 -5
  51. package/bin/go/src/runtime/print.go +4 -16
  52. package/bin/go/src/runtime/race/README +9 -9
  53. package/bin/go/src/runtime/race/internal/amd64v1/race_darwin.syso +0 -0
  54. package/bin/go/src/runtime/race/internal/amd64v1/race_freebsd.syso +0 -0
  55. package/bin/go/src/runtime/race/internal/amd64v1/race_linux.syso +0 -0
  56. package/bin/go/src/runtime/race/internal/amd64v1/race_windows.syso +0 -0
  57. package/bin/go/src/runtime/race/internal/amd64v3/race_linux.syso +0 -0
  58. package/bin/go/src/runtime/race/race_darwin_arm64.syso +0 -0
  59. package/bin/go/src/runtime/race/race_linux_arm64.syso +0 -0
  60. package/bin/go/src/runtime/race/race_linux_loong64.syso +0 -0
  61. package/bin/go/src/runtime/race/race_linux_s390x.syso +0 -0
  62. package/bin/ttsc +0 -0
  63. package/package.json +1 -1
  64. package/bin/go/src/internal/poll/fstatat_unix.go +0 -22
  65. package/bin/go/src/internal/syscall/unix/fchmodat_linux.go +0 -51
  66. package/bin/go/src/internal/syscall/unix/fchmodat_other.go +0 -29
  67. package/bin/go/src/os/statat.go +0 -24
  68. package/bin/go/src/os/statat_other.go +0 -12
  69. package/bin/go/src/os/statat_unix.go +0 -20
  70. package/bin/go/src/runtime/race/internal/amd64v1/race_darwin.patch +0 -63
  71. package/bin/go/src/runtime/race/internal/amd64v1/race_freebsd.patch +0 -63
  72. package/bin/go/src/runtime/race/internal/amd64v1/race_linux.patch +0 -63
  73. package/bin/go/src/runtime/race/internal/amd64v1/race_windows.patch +0 -63
  74. package/bin/go/src/runtime/race/internal/amd64v3/race_linux.patch +0 -63
  75. package/bin/go/src/runtime/race/race_darwin_arm64.patch +0 -63
  76. package/bin/go/src/runtime/race/race_linux_arm64.patch +0 -63
  77. package/bin/go/src/runtime/race/race_linux_loong64.patch +0 -63
  78. package/bin/go/src/runtime/race/race_linux_s390x.patch +0 -63
@@ -23,8 +23,6 @@ var transitionFunc = [...]func(context, []byte) (context, int){
23
23
  stateRCDATA: tSpecialTagEnd,
24
24
  stateAttr: tAttr,
25
25
  stateURL: tURL,
26
- stateMetaContent: tMetaContent,
27
- stateMetaContentURL: tMetaContentURL,
28
26
  stateSrcset: tURL,
29
27
  stateJS: tJS,
30
28
  stateJSDqStr: tJSDelimited,
@@ -85,7 +83,6 @@ var elementContentType = [...]state{
85
83
  elementStyle: stateCSS,
86
84
  elementTextarea: stateRCDATA,
87
85
  elementTitle: stateRCDATA,
88
- elementMeta: stateText,
89
86
  }
90
87
 
91
88
  // tTag is the context transition function for the tag state.
@@ -96,11 +93,6 @@ func tTag(c context, s []byte) (context, int) {
96
93
  return c, len(s)
97
94
  }
98
95
  if s[i] == '>' {
99
- // Treat <meta> specially, because it doesn't have an end tag, and we
100
- // want to transition into the correct state/element for it.
101
- if c.element == elementMeta {
102
- return context{state: stateText, element: elementNone}, i + 1
103
- }
104
96
  return context{
105
97
  state: elementContentType[c.element],
106
98
  element: c.element,
@@ -121,8 +113,6 @@ func tTag(c context, s []byte) (context, int) {
121
113
  attrName := strings.ToLower(string(s[i:j]))
122
114
  if c.element == elementScript && attrName == "type" {
123
115
  attr = attrScriptType
124
- } else if c.element == elementMeta && attrName == "content" {
125
- attr = attrMetaContent
126
116
  } else {
127
117
  switch attrType(attrName) {
128
118
  case contentTypeURL:
@@ -172,13 +162,12 @@ func tAfterName(c context, s []byte) (context, int) {
172
162
  }
173
163
 
174
164
  var attrStartStates = [...]state{
175
- attrNone: stateAttr,
176
- attrScript: stateJS,
177
- attrScriptType: stateAttr,
178
- attrStyle: stateCSS,
179
- attrURL: stateURL,
180
- attrSrcset: stateSrcset,
181
- attrMetaContent: stateMetaContent,
165
+ attrNone: stateAttr,
166
+ attrScript: stateJS,
167
+ attrScriptType: stateAttr,
168
+ attrStyle: stateCSS,
169
+ attrURL: stateURL,
170
+ attrSrcset: stateSrcset,
182
171
  }
183
172
 
184
173
  // tBeforeValue is the context transition function for stateBeforeValue.
@@ -214,7 +203,6 @@ var specialTagEndMarkers = [...][]byte{
214
203
  elementStyle: []byte("style"),
215
204
  elementTextarea: []byte("textarea"),
216
205
  elementTitle: []byte("title"),
217
- elementMeta: []byte(""),
218
206
  }
219
207
 
220
208
  var (
@@ -624,28 +612,6 @@ func tError(c context, s []byte) (context, int) {
624
612
  return c, len(s)
625
613
  }
626
614
 
627
- // tMetaContent is the context transition function for the meta content attribute state.
628
- func tMetaContent(c context, s []byte) (context, int) {
629
- for i := 0; i < len(s); i++ {
630
- if i+3 <= len(s)-1 && bytes.Equal(bytes.ToLower(s[i:i+4]), []byte("url=")) {
631
- c.state = stateMetaContentURL
632
- return c, i + 4
633
- }
634
- }
635
- return c, len(s)
636
- }
637
-
638
- // tMetaContentURL is the context transition function for the "url=" part of a meta content attribute state.
639
- func tMetaContentURL(c context, s []byte) (context, int) {
640
- for i := 0; i < len(s); i++ {
641
- if s[i] == ';' {
642
- c.state = stateMetaContent
643
- return c, i + 1
644
- }
645
- }
646
- return c, len(s)
647
- }
648
-
649
615
  // eatAttrName returns the largest j such that s[i:j] is an attribute name.
650
616
  // It returns an error if s[i:] does not look like it begins with an
651
617
  // attribute name, such as encountering a quote mark without a preceding
@@ -672,7 +638,6 @@ var elementNameMap = map[string]element{
672
638
  "style": elementStyle,
673
639
  "textarea": elementTextarea,
674
640
  "title": elementTitle,
675
- "meta": elementMeta,
676
641
  }
677
642
 
678
643
  // asciiAlpha reports whether c is an ASCII letter.
@@ -15,7 +15,7 @@ const DefaultGORISCV64 = `rva20u64`
15
15
  const defaultGOEXPERIMENT = ``
16
16
  const defaultGO_EXTLINK_ENABLED = ``
17
17
  const defaultGO_LDSO = ``
18
- const version = `go1.26.2`
18
+ const version = `go1.26.0`
19
19
  const defaultGOOS = runtime.GOOS
20
20
  const defaultGOARCH = runtime.GOARCH
21
21
  const DefaultGOFIPS140 = `off`
@@ -40,7 +40,6 @@ var All = []Info{
40
40
  {Name: "gocacheverify", Package: "cmd/go"},
41
41
  {Name: "gotestjsonbuildtext", Package: "cmd/go", Changed: 24, Old: "1"},
42
42
  {Name: "gotypesalias", Package: "go/types", Changed: 23, Old: "0"},
43
- {Name: "htmlmetacontenturlescape", Package: "html/template"},
44
43
  {Name: "http2client", Package: "net/http"},
45
44
  {Name: "http2debug", Package: "net/http", Opaque: true},
46
45
  {Name: "http2server", Package: "net/http"},
@@ -149,7 +149,7 @@ var wsaMsgPool = sync.Pool{
149
149
 
150
150
  // newWSAMsg creates a new WSAMsg with the provided parameters.
151
151
  // Use [freeWSAMsg] to free it.
152
- func newWSAMsg(p []byte, oob []byte, flags int, rsa *wsaRsa) *windows.WSAMsg {
152
+ func newWSAMsg(p []byte, oob []byte, flags int, unconnected bool) *windows.WSAMsg {
153
153
  // The returned object can't be allocated in the stack because it is accessed asynchronously
154
154
  // by Windows in between several system calls. If the stack frame is moved while that happens,
155
155
  // then Windows may access invalid memory.
@@ -159,53 +159,39 @@ func newWSAMsg(p []byte, oob []byte, flags int, rsa *wsaRsa) *windows.WSAMsg {
159
159
  msg := wsaMsgPool.Get().(*windows.WSAMsg)
160
160
  msg.Buffers.Len = uint32(len(p))
161
161
  msg.Buffers.Buf = unsafe.SliceData(p)
162
- if len(oob) > 0 {
163
- msg.Control = syscall.WSABuf{
164
- Len: uint32(len(oob)),
165
- Buf: unsafe.SliceData(oob),
166
- }
162
+ msg.Control = syscall.WSABuf{
163
+ Len: uint32(len(oob)),
164
+ Buf: unsafe.SliceData(oob),
167
165
  }
168
166
  msg.Flags = uint32(flags)
169
- if rsa != nil {
170
- msg.Name = &rsa.name
171
- msg.Namelen = rsa.namelen
167
+ if unconnected {
168
+ msg.Name = wsaRsaPool.Get().(*syscall.RawSockaddrAny)
169
+ msg.Namelen = int32(unsafe.Sizeof(syscall.RawSockaddrAny{}))
172
170
  }
173
171
  return msg
174
172
  }
175
173
 
176
174
  func freeWSAMsg(msg *windows.WSAMsg) {
177
175
  // Clear pointers to buffers so they can be released by garbage collector.
178
- msg.Name = nil
179
- msg.Namelen = 0
180
176
  msg.Buffers.Len = 0
181
177
  msg.Buffers.Buf = nil
182
178
  msg.Control.Len = 0
183
179
  msg.Control.Buf = nil
180
+ if msg.Name != nil {
181
+ *msg.Name = syscall.RawSockaddrAny{}
182
+ wsaRsaPool.Put(msg.Name)
183
+ msg.Name = nil
184
+ msg.Namelen = 0
185
+ }
184
186
  wsaMsgPool.Put(msg)
185
187
  }
186
188
 
187
- // wsaRsa bundles a [syscall.RawSockaddrAny] with its length for efficient caching.
188
- //
189
- // When used by WSARecvFrom, wsaRsa must be on the heap. See
190
- // https://learn.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-wsarecvfrom.
191
- type wsaRsa struct {
192
- name syscall.RawSockaddrAny
193
- namelen int32
194
- }
195
-
196
189
  var wsaRsaPool = sync.Pool{
197
190
  New: func() any {
198
- return new(wsaRsa)
191
+ return new(syscall.RawSockaddrAny)
199
192
  },
200
193
  }
201
194
 
202
- func newWSARsa() *wsaRsa {
203
- rsa := wsaRsaPool.Get().(*wsaRsa)
204
- rsa.name = syscall.RawSockaddrAny{}
205
- rsa.namelen = int32(unsafe.Sizeof(syscall.RawSockaddrAny{}))
206
- return rsa
207
- }
208
-
209
195
  var operationPool = sync.Pool{
210
196
  New: func() any {
211
197
  return new(operation)
@@ -751,18 +737,19 @@ func (fd *FD) ReadFrom(buf []byte) (int, syscall.Sockaddr, error) {
751
737
 
752
738
  fd.pin('r', &buf[0])
753
739
 
754
- rsa := newWSARsa()
740
+ rsa := wsaRsaPool.Get().(*syscall.RawSockaddrAny)
755
741
  defer wsaRsaPool.Put(rsa)
756
742
  n, err := fd.execIO('r', func(o *operation) (qty uint32, err error) {
743
+ rsan := int32(unsafe.Sizeof(*rsa))
757
744
  var flags uint32
758
- err = syscall.WSARecvFrom(fd.Sysfd, newWsaBuf(buf), 1, &qty, &flags, &rsa.name, &rsa.namelen, &o.o, nil)
745
+ err = syscall.WSARecvFrom(fd.Sysfd, newWsaBuf(buf), 1, &qty, &flags, rsa, &rsan, &o.o, nil)
759
746
  return qty, err
760
747
  })
761
748
  err = fd.eofError(n, err)
762
749
  if err != nil {
763
750
  return n, nil, err
764
751
  }
765
- sa, _ := rsa.name.Sockaddr()
752
+ sa, _ := rsa.Sockaddr()
766
753
  return n, sa, nil
767
754
  }
768
755
 
@@ -781,18 +768,19 @@ func (fd *FD) ReadFromInet4(buf []byte, sa4 *syscall.SockaddrInet4) (int, error)
781
768
 
782
769
  fd.pin('r', &buf[0])
783
770
 
784
- rsa := newWSARsa()
771
+ rsa := wsaRsaPool.Get().(*syscall.RawSockaddrAny)
785
772
  defer wsaRsaPool.Put(rsa)
786
773
  n, err := fd.execIO('r', func(o *operation) (qty uint32, err error) {
774
+ rsan := int32(unsafe.Sizeof(*rsa))
787
775
  var flags uint32
788
- err = syscall.WSARecvFrom(fd.Sysfd, newWsaBuf(buf), 1, &qty, &flags, &rsa.name, &rsa.namelen, &o.o, nil)
776
+ err = syscall.WSARecvFrom(fd.Sysfd, newWsaBuf(buf), 1, &qty, &flags, rsa, &rsan, &o.o, nil)
789
777
  return qty, err
790
778
  })
791
779
  err = fd.eofError(n, err)
792
780
  if err != nil {
793
781
  return n, err
794
782
  }
795
- rawToSockaddrInet4(&rsa.name, sa4)
783
+ rawToSockaddrInet4(rsa, sa4)
796
784
  return n, err
797
785
  }
798
786
 
@@ -811,18 +799,19 @@ func (fd *FD) ReadFromInet6(buf []byte, sa6 *syscall.SockaddrInet6) (int, error)
811
799
 
812
800
  fd.pin('r', &buf[0])
813
801
 
814
- rsa := newWSARsa()
802
+ rsa := wsaRsaPool.Get().(*syscall.RawSockaddrAny)
815
803
  defer wsaRsaPool.Put(rsa)
816
804
  n, err := fd.execIO('r', func(o *operation) (qty uint32, err error) {
805
+ rsan := int32(unsafe.Sizeof(*rsa))
817
806
  var flags uint32
818
- err = syscall.WSARecvFrom(fd.Sysfd, newWsaBuf(buf), 1, &qty, &flags, &rsa.name, &rsa.namelen, &o.o, nil)
807
+ err = syscall.WSARecvFrom(fd.Sysfd, newWsaBuf(buf), 1, &qty, &flags, rsa, &rsan, &o.o, nil)
819
808
  return qty, err
820
809
  })
821
810
  err = fd.eofError(n, err)
822
811
  if err != nil {
823
812
  return n, err
824
813
  }
825
- rawToSockaddrInet6(&rsa.name, sa6)
814
+ rawToSockaddrInet6(rsa, sa6)
826
815
  return n, err
827
816
  }
828
817
 
@@ -1382,9 +1371,7 @@ func (fd *FD) ReadMsg(p []byte, oob []byte, flags int) (int, int, int, syscall.S
1382
1371
  p = p[:maxRW]
1383
1372
  }
1384
1373
 
1385
- rsa := newWSARsa()
1386
- defer wsaRsaPool.Put(rsa)
1387
- msg := newWSAMsg(p, oob, flags, rsa)
1374
+ msg := newWSAMsg(p, oob, flags, true)
1388
1375
  defer freeWSAMsg(msg)
1389
1376
  n, err := fd.execIO('r', func(o *operation) (qty uint32, err error) {
1390
1377
  err = windows.WSARecvMsg(fd.Sysfd, msg, &qty, &o.o, nil)
@@ -1409,9 +1396,7 @@ func (fd *FD) ReadMsgInet4(p []byte, oob []byte, flags int, sa4 *syscall.Sockadd
1409
1396
  p = p[:maxRW]
1410
1397
  }
1411
1398
 
1412
- rsa := newWSARsa()
1413
- defer wsaRsaPool.Put(rsa)
1414
- msg := newWSAMsg(p, oob, flags, rsa)
1399
+ msg := newWSAMsg(p, oob, flags, true)
1415
1400
  defer freeWSAMsg(msg)
1416
1401
  n, err := fd.execIO('r', func(o *operation) (qty uint32, err error) {
1417
1402
  err = windows.WSARecvMsg(fd.Sysfd, msg, &qty, &o.o, nil)
@@ -1435,9 +1420,7 @@ func (fd *FD) ReadMsgInet6(p []byte, oob []byte, flags int, sa6 *syscall.Sockadd
1435
1420
  p = p[:maxRW]
1436
1421
  }
1437
1422
 
1438
- rsa := newWSARsa()
1439
- defer wsaRsaPool.Put(rsa)
1440
- msg := newWSAMsg(p, oob, flags, rsa)
1423
+ msg := newWSAMsg(p, oob, flags, true)
1441
1424
  defer freeWSAMsg(msg)
1442
1425
  n, err := fd.execIO('r', func(o *operation) (qty uint32, err error) {
1443
1426
  err = windows.WSARecvMsg(fd.Sysfd, msg, &qty, &o.o, nil)
@@ -1461,18 +1444,15 @@ func (fd *FD) WriteMsg(p []byte, oob []byte, sa syscall.Sockaddr) (int, int, err
1461
1444
  }
1462
1445
  defer fd.writeUnlock()
1463
1446
 
1464
- var rsa *wsaRsa
1447
+ msg := newWSAMsg(p, oob, 0, sa != nil)
1448
+ defer freeWSAMsg(msg)
1465
1449
  if sa != nil {
1466
- rsa = newWSARsa()
1467
- defer wsaRsaPool.Put(rsa)
1468
1450
  var err error
1469
- rsa.namelen, err = sockaddrToRaw(&rsa.name, sa)
1451
+ msg.Namelen, err = sockaddrToRaw(msg.Name, sa)
1470
1452
  if err != nil {
1471
1453
  return 0, 0, err
1472
1454
  }
1473
1455
  }
1474
- msg := newWSAMsg(p, oob, 0, rsa)
1475
- defer freeWSAMsg(msg)
1476
1456
  n, err := fd.execIO('w', func(o *operation) (qty uint32, err error) {
1477
1457
  err = windows.WSASendMsg(fd.Sysfd, msg, 0, nil, &o.o, nil)
1478
1458
  return qty, err
@@ -1491,14 +1471,11 @@ func (fd *FD) WriteMsgInet4(p []byte, oob []byte, sa *syscall.SockaddrInet4) (in
1491
1471
  }
1492
1472
  defer fd.writeUnlock()
1493
1473
 
1494
- var rsa *wsaRsa
1474
+ msg := newWSAMsg(p, oob, 0, sa != nil)
1475
+ defer freeWSAMsg(msg)
1495
1476
  if sa != nil {
1496
- rsa = newWSARsa()
1497
- defer wsaRsaPool.Put(rsa)
1498
- rsa.namelen = sockaddrInet4ToRaw(&rsa.name, sa)
1477
+ msg.Namelen = sockaddrInet4ToRaw(msg.Name, sa)
1499
1478
  }
1500
- msg := newWSAMsg(p, oob, 0, rsa)
1501
- defer freeWSAMsg(msg)
1502
1479
  n, err := fd.execIO('w', func(o *operation) (qty uint32, err error) {
1503
1480
  err = windows.WSASendMsg(fd.Sysfd, msg, 0, nil, &o.o, nil)
1504
1481
  return qty, err
@@ -1517,14 +1494,11 @@ func (fd *FD) WriteMsgInet6(p []byte, oob []byte, sa *syscall.SockaddrInet6) (in
1517
1494
  }
1518
1495
  defer fd.writeUnlock()
1519
1496
 
1520
- var rsa *wsaRsa
1497
+ msg := newWSAMsg(p, oob, 0, sa != nil)
1498
+ defer freeWSAMsg(msg)
1521
1499
  if sa != nil {
1522
- rsa = newWSARsa()
1523
- defer wsaRsaPool.Put(rsa)
1524
- rsa.namelen = sockaddrInet6ToRaw(&rsa.name, sa)
1500
+ msg.Namelen = sockaddrInet6ToRaw(msg.Name, sa)
1525
1501
  }
1526
- msg := newWSAMsg(p, oob, 0, rsa)
1527
- defer freeWSAMsg(msg)
1528
1502
  n, err := fd.execIO('w', func(o *operation) (qty uint32, err error) {
1529
1503
  err = windows.WSASendMsg(fd.Sysfd, msg, 0, nil, &o.o, nil)
1530
1504
  return qty, err
@@ -68,10 +68,8 @@ func SendFile(fd *FD, src uintptr, size int64) (written int64, err error, handle
68
68
  chunkSize = size
69
69
  }
70
70
 
71
+ fd.setOffset(startpos + written)
71
72
  n, err := fd.execIO('w', func(o *operation) (uint32, error) {
72
- off := startpos + written
73
- o.o.OffsetHigh = uint32(off >> 32)
74
- o.o.Offset = uint32(off)
75
73
  err := syscall.TransmitFile(fd.Sysfd, hsrc, uint32(chunkSize), 0, &o.o, nil, syscall.TF_WRITE_BEHIND)
76
74
  if err != nil {
77
75
  return 0, err
@@ -80,6 +80,23 @@ func Mkdirat(dirfd int, path string, mode uint32) error {
80
80
  return nil
81
81
  }
82
82
 
83
+ func Fchmodat(dirfd int, path string, mode uint32, flags int) error {
84
+ p, err := syscall.BytePtrFromString(path)
85
+ if err != nil {
86
+ return err
87
+ }
88
+ _, _, errno := syscall.Syscall6(fchmodatTrap,
89
+ uintptr(dirfd),
90
+ uintptr(unsafe.Pointer(p)),
91
+ uintptr(mode),
92
+ uintptr(flags),
93
+ 0, 0)
94
+ if errno != 0 {
95
+ return errno
96
+ }
97
+ return nil
98
+ }
99
+
83
100
  func Fchownat(dirfd int, path string, uid, gid int, flags int) error {
84
101
  p, err := syscall.BytePtrFromString(path)
85
102
  if err != nil {
@@ -11,6 +11,7 @@ const (
11
11
  openatTrap uintptr = syscall.SYS_OPENAT
12
12
  readlinkatTrap uintptr = syscall.SYS_READLINKAT
13
13
  mkdiratTrap uintptr = syscall.SYS_MKDIRAT
14
+ fchmodatTrap uintptr = syscall.SYS_FCHMODAT
14
15
  fchownatTrap uintptr = syscall.SYS_FCHOWNAT
15
16
  linkatTrap uintptr = syscall.SYS_LINKAT
16
17
  symlinkatTrap uintptr = syscall.SYS_SYMLINKAT
@@ -23,6 +24,4 @@ const (
23
24
  AT_SYMLINK_NOFOLLOW = 0x100
24
25
 
25
26
  UTIME_OMIT = 0x3ffffffe
26
-
27
- O_PATH = 0x200000
28
27
  )
@@ -246,31 +246,14 @@ func Deleteat(dirfd syscall.Handle, name string, options uint32) error {
246
246
  var h syscall.Handle
247
247
  err := NtOpenFile(
248
248
  &h,
249
- FILE_READ_ATTRIBUTES|DELETE,
249
+ SYNCHRONIZE|FILE_READ_ATTRIBUTES|DELETE,
250
250
  objAttrs,
251
251
  &IO_STATUS_BLOCK{},
252
252
  FILE_SHARE_DELETE|FILE_SHARE_READ|FILE_SHARE_WRITE,
253
- FILE_OPEN_REPARSE_POINT|FILE_OPEN_FOR_BACKUP_INTENT|options,
253
+ FILE_OPEN_REPARSE_POINT|FILE_OPEN_FOR_BACKUP_INTENT|FILE_SYNCHRONOUS_IO_NONALERT|options,
254
254
  )
255
255
  if err != nil {
256
- if ntStatus, ok := err.(NTStatus); !ok || ntStatus != STATUS_ACCESS_DENIED {
257
- return ntCreateFileError(err, 0)
258
- }
259
-
260
- // Access denied, try opening with DELETE only.
261
- // This may succeed if the file has restrictive permissions
262
- // but the caller has delete child permission on the parent directory.
263
- err = NtOpenFile(
264
- &h,
265
- DELETE,
266
- objAttrs,
267
- &IO_STATUS_BLOCK{},
268
- FILE_SHARE_DELETE|FILE_SHARE_READ|FILE_SHARE_WRITE,
269
- FILE_OPEN_REPARSE_POINT|FILE_OPEN_FOR_BACKUP_INTENT|options,
270
- )
271
- if err != nil {
272
- return ntCreateFileError(err, 0)
273
- }
256
+ return ntCreateFileError(err, 0)
274
257
  }
275
258
  defer syscall.CloseHandle(h)
276
259
 
@@ -561,7 +561,6 @@ const (
561
561
  STATUS_NOT_SUPPORTED NTStatus = 0xC00000BB
562
562
  STATUS_INVALID_PARAMETER NTStatus = 0xC000000D
563
563
  STATUS_INVALID_INFO_CLASS NTStatus = 0xC0000003
564
- STATUS_ACCESS_DENIED NTStatus = 0xC0000022
565
564
  )
566
565
 
567
566
  const (
@@ -580,6 +579,3 @@ type FILE_MODE_INFORMATION struct {
580
579
  //sys NtSetInformationFile(handle syscall.Handle, iosb *IO_STATUS_BLOCK, inBuffer unsafe.Pointer, inBufferLen uint32, class uint32) (ntstatus error) = ntdll.NtSetInformationFile
581
580
  //sys RtlIsDosDeviceName_U(name *uint16) (ret uint32) = ntdll.RtlIsDosDeviceName_U
582
581
  //sys NtQueryInformationFile(handle syscall.Handle, iosb *IO_STATUS_BLOCK, inBuffer unsafe.Pointer, inBufferLen uint32, class uint32) (ntstatus error) = ntdll.NtQueryInformationFile
583
-
584
- //sys SetEntriesInAcl(countExplicitEntries uint32, explicitEntries *EXPLICIT_ACCESS, oldACL *ACL, newACL **ACL) (ret error) = advapi32.SetEntriesInAclW
585
- //sys SetNamedSecurityInfo(objectName string, objectType uint32, securityInformation uint32, owner *syscall.SID, group *syscall.SID, dacl *ACL, sacl *ACL) (ret error) = advapi32.SetNamedSecurityInfoW
@@ -301,85 +301,3 @@ const ValidFileFlagsMask = O_FILE_FLAG_OPEN_REPARSE_POINT |
301
301
  O_FILE_FLAG_NO_BUFFERING |
302
302
  O_FILE_FLAG_RANDOM_ACCESS |
303
303
  O_FILE_FLAG_WRITE_THROUGH
304
-
305
- // https://msdn.microsoft.com/en-us/library/windows/desktop/aa379636.aspx
306
- type TRUSTEE struct {
307
- MultipleTrustee *TRUSTEE
308
- MultipleTrusteeOperation uint32
309
- TrusteeForm uint32
310
- TrusteeType uint32
311
- Name uintptr
312
- }
313
-
314
- // https://msdn.microsoft.com/en-us/library/windows/desktop/aa379638.aspx
315
- const (
316
- TRUSTEE_IS_SID = 0x0
317
- TRUSTEE_IS_NAME = 0x1
318
- TRUSTEE_BAD_FORM = 0x2
319
- TRUSTEE_IS_OBJECTS_AND_SID = 0x3
320
- TRUSTEE_IS_OBJECTS_AND_NAME = 0x4
321
- )
322
-
323
- // https://msdn.microsoft.com/en-us/library/windows/desktop/aa446627.aspx
324
- type EXPLICIT_ACCESS struct {
325
- AccessPermissions uint32
326
- AccessMode uint32
327
- Inheritance uint32
328
- Trustee TRUSTEE
329
- }
330
-
331
- // https://msdn.microsoft.com/en-us/library/windows/desktop/aa374899.aspx
332
- const (
333
- NOT_USED_ACCESS = 0x0
334
- GRANT_ACCESS = 0x1
335
- SET_ACCESS = 0x2
336
- DENY_ACCESS = 0x3
337
- REVOKE_ACCESS = 0x4
338
- SET_AUDIT_SUCCESS = 0x5
339
- SET_AUDIT_FAILURE = 0x6
340
- )
341
-
342
- // https://msdn.microsoft.com/en-us/library/windows/desktop/aa446627.aspx
343
- const (
344
- NO_INHERITANCE = 0x0
345
- SUB_OBJECTS_ONLY_INHERIT = 0x1
346
- SUB_CONTAINERS_ONLY_INHERIT = 0x2
347
- SUB_CONTAINERS_AND_OBJECTS_INHERIT = 0x3
348
- INHERIT_NO_PROPAGATE = 0x4
349
- INHERIT_ONLY = 0x8
350
- )
351
-
352
- // https://msdn.microsoft.com/en-us/library/windows/desktop/aa379593.aspx
353
- const (
354
- SE_UNKNOWN_OBJECT_TYPE = 0x0
355
- SE_FILE_OBJECT = 0x1
356
- SE_SERVICE = 0x2
357
- SE_PRINTER = 0x3
358
- SE_REGISTRY_KEY = 0x4
359
- SE_LMSHARE = 0x5
360
- SE_KERNEL_OBJECT = 0x6
361
- SE_WINDOW_OBJECT = 0x7
362
- SE_DS_OBJECT = 0x8
363
- SE_DS_OBJECT_ALL = 0x9
364
- SE_PROVIDER_DEFINED_OBJECT = 0xa
365
- SE_WMIGUID_OBJECT = 0xb
366
- SE_REGISTRY_WOW64_32KEY = 0xc
367
- SE_REGISTRY_WOW64_64KEY = 0xd
368
- )
369
-
370
- // https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-dtyp/23e75ca3-98fd-4396-84e5-86cd9d40d343
371
- const (
372
- OWNER_SECURITY_INFORMATION = 0x00000001
373
- GROUP_SECURITY_INFORMATION = 0x00000002
374
- DACL_SECURITY_INFORMATION = 0x00000004
375
- SACL_SECURITY_INFORMATION = 0x00000008
376
- LABEL_SECURITY_INFORMATION = 0x00000010
377
- UNPROTECTED_SACL_SECURITY_INFORMATION = 0x10000000
378
- UNPROTECTED_DACL_SECURITY_INFORMATION = 0x20000000
379
- PROTECTED_SACL_SECURITY_INFORMATION = 0x40000000
380
- PROTECTED_DACL_SECURITY_INFORMATION = 0x80000000
381
- ATTRIBUTE_SECURITY_INFORMATION = 0x00000020
382
- SCOPE_SECURITY_INFORMATION = 0x00000040
383
- PROCESS_TRUST_LABEL_SECURITY_INFORMATION = 0x00000080
384
- BACKUP_SECURITY_INFORMATION = 0x00010000
385
- )
@@ -62,8 +62,6 @@ var (
62
62
  procOpenThreadToken = modadvapi32.NewProc("OpenThreadToken")
63
63
  procQueryServiceStatus = modadvapi32.NewProc("QueryServiceStatus")
64
64
  procRevertToSelf = modadvapi32.NewProc("RevertToSelf")
65
- procSetEntriesInAclW = modadvapi32.NewProc("SetEntriesInAclW")
66
- procSetNamedSecurityInfoW = modadvapi32.NewProc("SetNamedSecurityInfoW")
67
65
  procSetTokenInformation = modadvapi32.NewProc("SetTokenInformation")
68
66
  procProcessPrng = modbcryptprimitives.NewProc("ProcessPrng")
69
67
  procGetAdaptersAddresses = modiphlpapi.NewProc("GetAdaptersAddresses")
@@ -238,31 +236,6 @@ func RevertToSelf() (err error) {
238
236
  return
239
237
  }
240
238
 
241
- func SetEntriesInAcl(countExplicitEntries uint32, explicitEntries *EXPLICIT_ACCESS, oldACL *ACL, newACL **ACL) (ret error) {
242
- r0, _, _ := syscall.SyscallN(procSetEntriesInAclW.Addr(), uintptr(countExplicitEntries), uintptr(unsafe.Pointer(explicitEntries)), uintptr(unsafe.Pointer(oldACL)), uintptr(unsafe.Pointer(newACL)))
243
- if r0 != 0 {
244
- ret = syscall.Errno(r0)
245
- }
246
- return
247
- }
248
-
249
- func SetNamedSecurityInfo(objectName string, objectType uint32, securityInformation uint32, owner *syscall.SID, group *syscall.SID, dacl *ACL, sacl *ACL) (ret error) {
250
- var _p0 *uint16
251
- _p0, ret = syscall.UTF16PtrFromString(objectName)
252
- if ret != nil {
253
- return
254
- }
255
- return _SetNamedSecurityInfo(_p0, objectType, securityInformation, owner, group, dacl, sacl)
256
- }
257
-
258
- func _SetNamedSecurityInfo(objectName *uint16, objectType uint32, securityInformation uint32, owner *syscall.SID, group *syscall.SID, dacl *ACL, sacl *ACL) (ret error) {
259
- r0, _, _ := syscall.SyscallN(procSetNamedSecurityInfoW.Addr(), uintptr(unsafe.Pointer(objectName)), uintptr(objectType), uintptr(securityInformation), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(sacl)))
260
- if r0 != 0 {
261
- ret = syscall.Errno(r0)
262
- }
263
- return
264
- }
265
-
266
239
  func SetTokenInformation(tokenHandle syscall.Token, tokenInformationClass uint32, tokenInformation unsafe.Pointer, tokenInformationLength uint32) (err error) {
267
240
  r1, _, e1 := syscall.SyscallN(procSetTokenInformation.Addr(), uintptr(tokenHandle), uintptr(tokenInformationClass), uintptr(tokenInformation), uintptr(tokenInformationLength))
268
241
  if r1 == 0 {
@@ -105,4 +105,5 @@ Alternatively, the following GODEBUG settings are currently supported:
105
105
  The "omithttp2" build tag may be used to disable the HTTP/2 implementation
106
106
  contained in the http package.
107
107
  */
108
+
108
109
  package http
@@ -12,8 +12,6 @@ import (
12
12
  "syscall"
13
13
  )
14
14
 
15
- var testHookSupportsSendfile func() bool
16
-
17
15
  // sendFile copies the contents of r to c using the sendfile
18
16
  // system call to minimize copies.
19
17
  //
@@ -8,8 +8,6 @@ package net
8
8
 
9
9
  import "io"
10
10
 
11
- var testHookSupportsSendfile func() bool
12
-
13
11
  func supportsSendfile() bool {
14
12
  return false
15
13
  }
@@ -12,8 +12,5 @@ import "internal/syscall/windows"
12
12
  // https://learn.microsoft.com/en-us/windows/win32/api/mswsock/nf-mswsock-transmitfile
13
13
  // https://golang.org/issue/73746
14
14
  func supportsSendfile() bool {
15
- if testHookSupportsSendfile != nil {
16
- return testHookSupportsSendfile()
17
- }
18
15
  return windows.SupportUnlimitedTransmitFile()
19
16
  }