diff --git a/0001-CVE-2024-9407-validate-bind-propagation-flag-setting.patch b/0001-CVE-2024-9407-validate-bind-propagation-flag-setting.patch deleted file mode 100644 index 96b1334..0000000 --- a/0001-CVE-2024-9407-validate-bind-propagation-flag-setting.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 222f80a6a2ab4efce95bb7c8da3606b5ad4a3170 Mon Sep 17 00:00:00 2001 -From: Nalin Dahyabhai -Date: Tue, 1 Oct 2024 11:01:45 -0400 -Subject: [PATCH 1/4] CVE-2024-9407: validate "bind-propagation" flag settings - -CVE-2024-9407: validate that the value for the "bind-propagation" flag -when handling "bind" and "cache" mounts in `buildah run` or in RUN -instructions is one of the values that we would accept without the -"bind-propagation=" prefix. - -Signed-off-by: Nalin Dahyabhai -(cherry picked from commit 732f77064830bb91062d475407b761ade2e4fe6b) -Signed-off-by: Danish Prakash ---- - internal/volumes/volumes.go | 12 ++++++++++++ - 1 file changed, 12 insertions(+) - -diff --git a/internal/volumes/volumes.go b/internal/volumes/volumes.go -index 515f846f3499..da6b768fdc21 100644 ---- a/internal/volumes/volumes.go -+++ b/internal/volumes/volumes.go -@@ -105,6 +105,12 @@ func GetBindMount(ctx *types.SystemContext, args []string, contextDir string, st - if !hasArgValue { - return newMount, "", fmt.Errorf("%v: %w", argName, errBadOptionArg) - } -+ switch argValue { -+ default: -+ return newMount, "", fmt.Errorf("%v: %q: %w", argName, argValue, errBadMntOption) -+ case "shared", "rshared", "private", "rprivate", "slave", "rslave": -+ // this should be the relevant parts of the same list of options we accepted above -+ } - newMount.Options = append(newMount.Options, argValue) - case "src", "source": - if !hasArgValue { -@@ -277,6 +283,12 @@ func GetCacheMount(args []string, store storage.Store, imageMountLabel string, a - if !hasArgValue { - return newMount, nil, fmt.Errorf("%v: %w", argName, errBadOptionArg) - } -+ switch argValue { -+ default: -+ return newMount, nil, fmt.Errorf("%v: %q: %w", argName, argValue, errBadMntOption) -+ case "shared", "rshared", "private", "rprivate", "slave", "rslave": -+ // this should be the relevant parts of the same list of options we accepted above -+ } - newMount.Options = append(newMount.Options, argValue) - case "id": - if !hasArgValue { --- -2.46.0 - diff --git a/0002-conmon-pkg-subscriptions-use-securejoin-for-the-cont.patch b/0001-pkg-subscriptions-use-securejoin-for-the-container-p.patch similarity index 90% rename from 0002-conmon-pkg-subscriptions-use-securejoin-for-the-cont.patch rename to 0001-pkg-subscriptions-use-securejoin-for-the-container-p.patch index 3a15506..0b52b72 100644 --- a/0002-conmon-pkg-subscriptions-use-securejoin-for-the-cont.patch +++ b/0001-pkg-subscriptions-use-securejoin-for-the-container-p.patch @@ -1,8 +1,7 @@ -From 290dbe53fdc8c31aa51f0851c57bda0f195fc1a6 Mon Sep 17 00:00:00 2001 +From b91b421970fdd5510ff47d9fc44e9b412bec3cb2 Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Wed, 2 Oct 2024 12:15:15 +0200 -Subject: [PATCH 2/4] [conmon] pkg/subscriptions: use securejoin for the - container path +Subject: [PATCH 1/4] pkg/subscriptions: use securejoin for the container path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -23,7 +22,7 @@ Signed-off-by: Danish Prakash 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/vendor/github.com/containers/common/pkg/subscriptions/subscriptions.go b/vendor/github.com/containers/common/pkg/subscriptions/subscriptions.go -index 6845914aa285..71ee68a5909c 100644 +index 6845914aa..71ee68a59 100644 --- a/vendor/github.com/containers/common/pkg/subscriptions/subscriptions.go +++ b/vendor/github.com/containers/common/pkg/subscriptions/subscriptions.go @@ -10,6 +10,7 @@ import ( @@ -48,5 +47,5 @@ index 6845914aa285..71ee68a5909c 100644 if errors.Is(err, os.ErrNotExist) { return nil -- -2.46.0 +2.48.1 diff --git a/0004-Use-securejoin.SecureJoin-when-forming-userns-paths.patch b/0002-Use-securejoin.SecureJoin-when-forming-userns-paths.patch similarity index 97% rename from 0004-Use-securejoin.SecureJoin-when-forming-userns-paths.patch rename to 0002-Use-securejoin.SecureJoin-when-forming-userns-paths.patch index bd11203..120525c 100644 --- a/0004-Use-securejoin.SecureJoin-when-forming-userns-paths.patch +++ b/0002-Use-securejoin.SecureJoin-when-forming-userns-paths.patch @@ -1,7 +1,7 @@ -From 1ca3365e5ccdbebefaf8732e6e3b317d364b8343 Mon Sep 17 00:00:00 2001 +From 2730f9260c9cc1cb352b86637b72398931401e62 Mon Sep 17 00:00:00 2001 From: Danish Prakash Date: Tue, 22 Oct 2024 12:46:17 +0530 -Subject: [PATCH 4/4] Use securejoin.SecureJoin when forming userns paths +Subject: [PATCH 2/4] Use securejoin.SecureJoin when forming userns paths We need to read /etc/passwd and /etc/group in the container to get an idea of how many UIDs and GIDs we need to allocate for a @@ -24,7 +24,7 @@ Signed-off-by: Danish Prakash .../github.com/containers/storage/userns.go | 87 +- .../containers/storage/userns_unsupported.go | 14 + .../cyphar/filepath-securejoin/LICENSE | 2 +- - .../cyphar/filepath-securejoin/README.md | 139 +- + .../cyphar/filepath-securejoin/README.md | 135 +- .../cyphar/filepath-securejoin/VERSION | 2 +- .../cyphar/filepath-securejoin/join.go | 85 +- .../filepath-securejoin/lookup_linux.go | 380 ++ @@ -40,7 +40,7 @@ Signed-off-by: Danish Prakash vendor/golang.org/x/sys/cpu/cpu_arm64.s | 8 + vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go | 1 + .../golang.org/x/sys/cpu/cpu_linux_arm64.go | 5 + - vendor/golang.org/x/sys/unix/asm_zos_s390x.s | 665 +- + vendor/golang.org/x/sys/unix/asm_zos_s390x.s | 675 +- vendor/golang.org/x/sys/unix/bpxsvc_zos.go | 657 ++ vendor/golang.org/x/sys/unix/bpxsvc_zos.s | 192 + vendor/golang.org/x/sys/unix/epoll_zos.go | 220 - @@ -51,7 +51,7 @@ Signed-off-by: Danish Prakash .../x/sys/unix/readdirent_getdirentries.go | 2 +- vendor/golang.org/x/sys/unix/sockcmsg_zos.go | 58 + .../golang.org/x/sys/unix/symaddr_zos_s390x.s | 75 + - .../x/sys/unix/syscall_zos_s390x.go | 1509 ++++- + .../x/sys/unix/syscall_zos_s390x.go | 1501 ++++- vendor/golang.org/x/sys/unix/sysvshm_unix.go | 2 +- .../x/sys/unix/sysvshm_unix_other.go | 2 +- vendor/golang.org/x/sys/unix/zerrors_linux.go | 29 +- @@ -60,7 +60,7 @@ Signed-off-by: Danish Prakash .../x/sys/unix/zerrors_linux_arm64.go | 1 + .../x/sys/unix/zerrors_zos_s390x.go | 233 +- .../x/sys/unix/zsymaddr_zos_s390x.s | 364 ++ - .../x/sys/unix/zsyscall_zos_s390x.go | 3113 ++++++++-- + .../x/sys/unix/zsyscall_zos_s390x.go | 2837 ++++++++- .../x/sys/unix/zsysnum_linux_386.go | 5 + .../x/sys/unix/zsysnum_linux_amd64.go | 5 + .../x/sys/unix/zsysnum_linux_arm.go | 5 + @@ -101,7 +101,7 @@ Signed-off-by: Danish Prakash .../golang.org/x/sys/windows/types_windows.go | 24 + .../x/sys/windows/zsyscall_windows.go | 135 +- vendor/modules.txt | 6 +- - 83 files changed, 10900 insertions(+), 4369 deletions(-) + 83 files changed, 10761 insertions(+), 4230 deletions(-) create mode 100644 vendor/github.com/containers/storage/userns_unsupported.go create mode 100644 vendor/github.com/cyphar/filepath-securejoin/lookup_linux.go create mode 100644 vendor/github.com/cyphar/filepath-securejoin/mkdir_linux.go @@ -120,7 +120,7 @@ Signed-off-by: Danish Prakash delete mode 100644 vendor/golang.org/x/sys/windows/empty.s diff --git a/go.mod b/go.mod -index 67d29132ef67..146e206d926c 100644 +index 67d29132e..146e206d9 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( @@ -142,7 +142,7 @@ index 67d29132ef67..146e206d926c 100644 sigs.k8s.io/yaml v1.4.0 ) diff --git a/go.sum b/go.sum -index cf951beb37c7..2fb6eccc7ab6 100644 +index cf951beb3..2fb6eccc7 100644 --- a/go.sum +++ b/go.sum @@ -77,8 +77,8 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3 @@ -168,7 +168,7 @@ index cf951beb37c7..2fb6eccc7ab6 100644 golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= diff --git a/vendor/github.com/containers/storage/.cirrus.yml b/vendor/github.com/containers/storage/.cirrus.yml -index 13bc20e7e90b..720489c01c71 100644 +index 13bc20e7e..720489c01 100644 --- a/vendor/github.com/containers/storage/.cirrus.yml +++ b/vendor/github.com/containers/storage/.cirrus.yml @@ -119,7 +119,7 @@ lint_task: @@ -181,7 +181,7 @@ index 13bc20e7e90b..720489c01c71 100644 fingerprint_script: cat go.sum folder: $GOPATH/pkg/mod diff --git a/vendor/github.com/containers/storage/userns.go b/vendor/github.com/containers/storage/userns.go -index 57120731be57..09919394c026 100644 +index 57120731b..09919394c 100644 --- a/vendor/github.com/containers/storage/userns.go +++ b/vendor/github.com/containers/storage/userns.go @@ -1,18 +1,21 @@ @@ -219,15 +219,15 @@ index 57120731be57..09919394c026 100644 + ) if passwdFile == "" { - passwdFile = filepath.Join(containerMount, "etc/passwd") -- } -- if groupFile == "" { -- groupFile = filepath.Join(groupFile, "etc/group") + passwd, err = secureOpen(containerMount, "/etc/passwd") + } else { + // User-specified override from a volume. Will not be in + // container root. + passwd, err = os.Open(passwdFile) } +- if groupFile == "" { +- groupFile = filepath.Join(groupFile, "etc/group") +- } - - size := 0 - @@ -310,7 +310,7 @@ index 57120731be57..09919394c026 100644 +} diff --git a/vendor/github.com/containers/storage/userns_unsupported.go b/vendor/github.com/containers/storage/userns_unsupported.go new file mode 100644 -index 000000000000..e37c18fe4381 +index 000000000..e37c18fe4 --- /dev/null +++ b/vendor/github.com/containers/storage/userns_unsupported.go @@ -0,0 +1,14 @@ @@ -329,7 +329,7 @@ index 000000000000..e37c18fe4381 + return nil, nil, errors.New("user namespaces are not supported on this platform") +} diff --git a/vendor/github.com/cyphar/filepath-securejoin/LICENSE b/vendor/github.com/cyphar/filepath-securejoin/LICENSE -index bec842f294f7..cb1ab88da0fa 100644 +index bec842f29..cb1ab88da 100644 --- a/vendor/github.com/cyphar/filepath-securejoin/LICENSE +++ b/vendor/github.com/cyphar/filepath-securejoin/LICENSE @@ -1,5 +1,5 @@ @@ -340,7 +340,7 @@ index bec842f294f7..cb1ab88da0fa 100644 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are diff --git a/vendor/github.com/cyphar/filepath-securejoin/README.md b/vendor/github.com/cyphar/filepath-securejoin/README.md -index 4eca0f235502..253956f86576 100644 +index 4eca0f235..253956f86 100644 --- a/vendor/github.com/cyphar/filepath-securejoin/README.md +++ b/vendor/github.com/cyphar/filepath-securejoin/README.md @@ -2,31 +2,24 @@ @@ -351,7 +351,8 @@ index 4eca0f235502..253956f86576 100644 -standard library][go#20126]. The purpose of this function is to be a "secure" -alternative to `filepath.Join`, and in particular it provides certain -guarantees that are not provided by `filepath.Join`. -- ++### Old API ### + -> **NOTE**: This code is *only* safe if you are not at risk of other processes -> modifying path components after you've used `SecureJoin`. If it is possible -> for a malicious process to modify path components of the resolved path, then @@ -364,23 +365,20 @@ index 4eca0f235502..253956f86576 100644 -> I have not done that yet. I might add it in the future as a helper function -> to help users verify the path (we can't just return `/proc/self/fd/` -> because that doesn't always work transparently for all users). -- --This is the function prototype: -+### Old API ### - --```go --func SecureJoin(root, unsafePath string) (string, error) --``` +This library was originally just an implementation of `SecureJoin` which was +[intended to be included in the Go standard library][go#20126] as a safer +`filepath.Join` that would restrict the path lookup to be inside a root +directory. -+ + +-This is the function prototype: +The implementation was based on code that existed in several container +runtimes. Unfortunately, this API is **fundamentally unsafe** against attackers +that can modify path components after `SecureJoin` returns and before the +caller uses the path, allowing for some fairly trivial TOCTOU attacks. -+ + +-```go +-func SecureJoin(root, unsafePath string) (string, error) +-``` +`SecureJoin` (and `SecureJoinVFS`) are still provided by this library to +support legacy users, but new users are strongly suggested to avoid using +`SecureJoin` and instead use the [new api](#new-api) or switch to @@ -508,14 +506,14 @@ index 4eca0f235502..253956f86576 100644 The license of this project is the same as Go, which is a BSD 3-clause license diff --git a/vendor/github.com/cyphar/filepath-securejoin/VERSION b/vendor/github.com/cyphar/filepath-securejoin/VERSION -index abd410582dea..0d91a54c7d43 100644 +index abd410582..0d91a54c7 100644 --- a/vendor/github.com/cyphar/filepath-securejoin/VERSION +++ b/vendor/github.com/cyphar/filepath-securejoin/VERSION @@ -1 +1 @@ -0.2.4 +0.3.0 diff --git a/vendor/github.com/cyphar/filepath-securejoin/join.go b/vendor/github.com/cyphar/filepath-securejoin/join.go -index aa32b85fb84c..bd86a48b0cc1 100644 +index aa32b85fb..bd86a48b0 100644 --- a/vendor/github.com/cyphar/filepath-securejoin/join.go +++ b/vendor/github.com/cyphar/filepath-securejoin/join.go @@ -1,5 +1,5 @@ @@ -665,7 +663,7 @@ index aa32b85fb84c..bd86a48b0cc1 100644 // SecureJoin is a wrapper around SecureJoinVFS that just uses the os.* library diff --git a/vendor/github.com/cyphar/filepath-securejoin/lookup_linux.go b/vendor/github.com/cyphar/filepath-securejoin/lookup_linux.go new file mode 100644 -index 000000000000..140ac18ff503 +index 000000000..140ac18ff --- /dev/null +++ b/vendor/github.com/cyphar/filepath-securejoin/lookup_linux.go @@ -0,0 +1,380 @@ @@ -1051,7 +1049,7 @@ index 000000000000..140ac18ff503 +} diff --git a/vendor/github.com/cyphar/filepath-securejoin/mkdir_linux.go b/vendor/github.com/cyphar/filepath-securejoin/mkdir_linux.go new file mode 100644 -index 000000000000..05e0bde9af4b +index 000000000..05e0bde9a --- /dev/null +++ b/vendor/github.com/cyphar/filepath-securejoin/mkdir_linux.go @@ -0,0 +1,228 @@ @@ -1285,7 +1283,7 @@ index 000000000000..05e0bde9af4b +} diff --git a/vendor/github.com/cyphar/filepath-securejoin/open_linux.go b/vendor/github.com/cyphar/filepath-securejoin/open_linux.go new file mode 100644 -index 000000000000..21700612c722 +index 000000000..21700612c --- /dev/null +++ b/vendor/github.com/cyphar/filepath-securejoin/open_linux.go @@ -0,0 +1,83 @@ @@ -1374,7 +1372,7 @@ index 000000000000..21700612c722 +} diff --git a/vendor/github.com/cyphar/filepath-securejoin/openat2_linux.go b/vendor/github.com/cyphar/filepath-securejoin/openat2_linux.go new file mode 100644 -index 000000000000..fc93db8644eb +index 000000000..fc93db864 --- /dev/null +++ b/vendor/github.com/cyphar/filepath-securejoin/openat2_linux.go @@ -0,0 +1,128 @@ @@ -1508,7 +1506,7 @@ index 000000000000..fc93db8644eb +} diff --git a/vendor/github.com/cyphar/filepath-securejoin/openat_linux.go b/vendor/github.com/cyphar/filepath-securejoin/openat_linux.go new file mode 100644 -index 000000000000..949fb5f2d82d +index 000000000..949fb5f2d --- /dev/null +++ b/vendor/github.com/cyphar/filepath-securejoin/openat_linux.go @@ -0,0 +1,59 @@ @@ -1573,7 +1571,7 @@ index 000000000000..949fb5f2d82d +} diff --git a/vendor/github.com/cyphar/filepath-securejoin/procfs_linux.go b/vendor/github.com/cyphar/filepath-securejoin/procfs_linux.go new file mode 100644 -index 000000000000..daac3f061712 +index 000000000..daac3f061 --- /dev/null +++ b/vendor/github.com/cyphar/filepath-securejoin/procfs_linux.go @@ -0,0 +1,481 @@ @@ -2060,7 +2058,7 @@ index 000000000000..daac3f061712 +} diff --git a/vendor/github.com/cyphar/filepath-securejoin/testing_mocks_linux.go b/vendor/github.com/cyphar/filepath-securejoin/testing_mocks_linux.go new file mode 100644 -index 000000000000..2a25d08e3785 +index 000000000..2a25d08e3 --- /dev/null +++ b/vendor/github.com/cyphar/filepath-securejoin/testing_mocks_linux.go @@ -0,0 +1,68 @@ @@ -2133,7 +2131,7 @@ index 000000000000..2a25d08e3785 + *testingForceProcThreadSelf >= forceProcSelf +} diff --git a/vendor/github.com/cyphar/filepath-securejoin/vfs.go b/vendor/github.com/cyphar/filepath-securejoin/vfs.go -index a82a5eae11eb..6e27c7dd8e1f 100644 +index a82a5eae1..6e27c7dd8 100644 --- a/vendor/github.com/cyphar/filepath-securejoin/vfs.go +++ b/vendor/github.com/cyphar/filepath-securejoin/vfs.go @@ -1,4 +1,4 @@ @@ -2143,7 +2141,7 @@ index a82a5eae11eb..6e27c7dd8e1f 100644 // license that can be found in the LICENSE file. diff --git a/vendor/golang.org/x/sys/cpu/cpu.go b/vendor/golang.org/x/sys/cpu/cpu.go -index 4756ad5f7951..8fa707aa4ba9 100644 +index 4756ad5f7..8fa707aa4 100644 --- a/vendor/golang.org/x/sys/cpu/cpu.go +++ b/vendor/golang.org/x/sys/cpu/cpu.go @@ -103,6 +103,7 @@ var ARM64 struct { @@ -2155,7 +2153,7 @@ index 4756ad5f7951..8fa707aa4ba9 100644 _ CacheLinePad } diff --git a/vendor/golang.org/x/sys/cpu/cpu_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_arm64.go -index f3eb993bf24b..0e27a21e1f82 100644 +index f3eb993bf..0e27a21e1 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_arm64.go +++ b/vendor/golang.org/x/sys/cpu/cpu_arm64.go @@ -28,6 +28,7 @@ func initOptions() { @@ -2183,7 +2181,7 @@ index f3eb993bf24b..0e27a21e1f82 100644 } diff --git a/vendor/golang.org/x/sys/cpu/cpu_arm64.s b/vendor/golang.org/x/sys/cpu/cpu_arm64.s -index fcb9a3888205..22cc99844a75 100644 +index fcb9a3888..22cc99844 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_arm64.s +++ b/vendor/golang.org/x/sys/cpu/cpu_arm64.s @@ -29,3 +29,11 @@ TEXT ·getpfr0(SB),NOSPLIT,$0-8 @@ -2199,7 +2197,7 @@ index fcb9a3888205..22cc99844a75 100644 + MOVD R0, ret+0(FP) + RET diff --git a/vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go -index a8acd3e3285d..6ac6e1efb208 100644 +index a8acd3e32..6ac6e1efb 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go +++ b/vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go @@ -9,3 +9,4 @@ package cpu @@ -2208,7 +2206,7 @@ index a8acd3e3285d..6ac6e1efb208 100644 func getpfr0() uint64 +func getzfr0() uint64 diff --git a/vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go -index a968b80fa6ab..3d386d0fc218 100644 +index a968b80fa..3d386d0fc 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go +++ b/vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go @@ -35,6 +35,8 @@ const ( @@ -2231,7 +2229,7 @@ index a968b80fa6ab..3d386d0fc218 100644 func isSet(hwc uint, value uint) bool { diff --git a/vendor/golang.org/x/sys/unix/asm_zos_s390x.s b/vendor/golang.org/x/sys/unix/asm_zos_s390x.s -index 2f67ba86d574..813dfad7d264 100644 +index 2f67ba86d..813dfad7d 100644 --- a/vendor/golang.org/x/sys/unix/asm_zos_s390x.s +++ b/vendor/golang.org/x/sys/unix/asm_zos_s390x.s @@ -9,9 +9,11 @@ @@ -2248,7 +2246,7 @@ index 2f67ba86d574..813dfad7d264 100644 // SS_*, where x=SAVSTACK_ASYNC #define SS_LE(x) 0(x) -@@ -19,405 +21,362 @@ +@@ -19,394 +21,125 @@ #define SS_ERRNO(x) 16(x) #define SS_ERRNOJR(x) 20(x) @@ -2320,30 +2318,18 @@ index 2f67ba86d574..813dfad7d264 100644 // Switch back to Go stack. - XOR R0, R0 // Restore R0 to $0. - MOVD R4, 0(R9) // Save stack pointer. -+ XOR R0, R0 // Restore R0 to $0. -+ MOVD R4, 0(R9) // Save stack pointer. - RET - +- RET +- -TEXT ·syscall_syscall(SB),NOSPLIT,$0-56 - BL runtime·entersyscall(SB) - MOVD a1+8(FP), R1 - MOVD a2+16(FP), R2 - MOVD a3+24(FP), R3 -+// func svcCall(fnptr unsafe.Pointer, argv *unsafe.Pointer, dsa *uint64) -+TEXT ·svcCall(SB), NOSPLIT, $0 -+ BL runtime·save_g(SB) // Save g and stack pointer -+ MOVW PSALAA, R8 -+ MOVD LCA64(R8), R8 -+ MOVD SAVSTACK_ASYNC(R8), R9 -+ MOVD R15, 0(R9) - +- - // Get library control area (LCA). - MOVW PSALAA, R8 - MOVD LCA64(R8), R8 -+ MOVD argv+8(FP), R1 // Move function arguments into registers -+ MOVD dsa+16(FP), g -+ MOVD fnptr+0(FP), R15 - +- - // Get function. - MOVD CAA(R8), R9 - MOVD EDCHPXV(R9), R9 @@ -2351,19 +2337,12 @@ index 2f67ba86d574..813dfad7d264 100644 - SLD $4, R5 - ADD R5, R9 - LMG 0(R9), R5, R6 -+ BYTE $0x0D // Branch to function -+ BYTE $0xEF - +- - // Restore LE stack. - MOVD SAVSTACK_ASYNC(R8), R9 - MOVD 0(R9), R4 - MOVD $0, 0(R9) -+ BL runtime·load_g(SB) // Restore g and stack pointer -+ MOVW PSALAA, R8 -+ MOVD LCA64(R8), R8 -+ MOVD SAVSTACK_ASYNC(R8), R9 -+ MOVD 0(R9), R15 - +- - // Call function. - LE_CALL - NOPH @@ -2381,8 +2360,8 @@ index 2f67ba86d574..813dfad7d264 100644 - MOVD R3, err+48(FP) -done: - BL runtime·exitsyscall(SB) - RET - +- RET +- -TEXT ·syscall_rawsyscall(SB),NOSPLIT,$0-56 - MOVD a1+8(FP), R1 - MOVD a2+16(FP), R2 @@ -2399,36 +2378,12 @@ index 2f67ba86d574..813dfad7d264 100644 - SLD $4, R5 - ADD R5, R9 - LMG 0(R9), R5, R6 -+// func svcLoad(name *byte) unsafe.Pointer -+TEXT ·svcLoad(SB), NOSPLIT, $0 -+ MOVD R15, R2 // Save go stack pointer -+ MOVD name+0(FP), R0 // Move SVC args into registers -+ MOVD $0x80000000, R1 -+ MOVD $0, R15 -+ SVC_LOAD -+ MOVW R15, R3 // Save return code from SVC -+ MOVD R2, R15 // Restore go stack pointer -+ CMP R3, $0 // Check SVC return code -+ BNE error -+ -+ MOVD $-2, R3 // Reset last bit of entry point to zero -+ AND R0, R3 -+ MOVD R3, ret+8(FP) // Return entry point returned by SVC -+ CMP R0, R3 // Check if last bit of entry point was set -+ BNE done -+ -+ MOVD R15, R2 // Save go stack pointer -+ MOVD $0, R15 // Move SVC args into registers (entry point still in r0 from SVC 08) -+ SVC_DELETE -+ MOVD R2, R15 // Restore go stack pointer - +- - // Restore LE stack. - MOVD SAVSTACK_ASYNC(R8), R9 - MOVD 0(R9), R4 - MOVD $0, 0(R9) -+error: -+ MOVD $0, ret+8(FP) // Return 0 on failure - +- - // Call function. - LE_CALL - NOPH @@ -2444,35 +2399,19 @@ index 2f67ba86d574..813dfad7d264 100644 - BL addrerrno<>(SB) - MOVWZ 0(R3), R3 - MOVD R3, err+48(FP) - done: -+ XOR R0, R0 // Reset r0 to 0 - RET - +-done: +- RET +- -TEXT ·syscall_syscall6(SB),NOSPLIT,$0-80 - BL runtime·entersyscall(SB) - MOVD a1+8(FP), R1 - MOVD a2+16(FP), R2 - MOVD a3+24(FP), R3 -+// func svcUnload(name *byte, fnptr unsafe.Pointer) int64 -+TEXT ·svcUnload(SB), NOSPLIT, $0 -+ MOVD R15, R2 // Save go stack pointer -+ MOVD name+0(FP), R0 // Move SVC args into registers -+ MOVD fnptr+8(FP), R15 -+ SVC_DELETE -+ XOR R0, R0 // Reset r0 to 0 -+ MOVD R15, R1 // Save SVC return code -+ MOVD R2, R15 // Restore go stack pointer -+ MOVD R1, ret+16(FP) // Return SVC return code -+ RET - -+// func gettid() uint64 -+TEXT ·gettid(SB), NOSPLIT, $0 - // Get library control area (LCA). +- +- // Get library control area (LCA). - MOVW PSALAA, R8 - MOVD LCA64(R8), R8 -+ MOVW PSALAA, R8 -+ MOVD LCA64(R8), R8 - +- - // Get function. - MOVD CAA(R8), R9 - MOVD EDCHPXV(R9), R9 @@ -2480,11 +2419,7 @@ index 2f67ba86d574..813dfad7d264 100644 - SLD $4, R5 - ADD R5, R9 - LMG 0(R9), R5, R6 -+ // Get CEECAATHDID -+ MOVD CAA(R8), R9 -+ MOVD CEECAATHDID(R9), R9 -+ MOVD R9, ret+0(FP) - +- - // Restore LE stack. - MOVD SAVSTACK_ASYNC(R8), R9 - MOVD 0(R9), R4 @@ -2515,8 +2450,8 @@ index 2f67ba86d574..813dfad7d264 100644 - MOVD R3, err+72(FP) -done: - BL runtime·exitsyscall(SB) - RET - +- RET +- -TEXT ·syscall_rawsyscall6(SB),NOSPLIT,$0-80 - MOVD a1+8(FP), R1 - MOVD a2+16(FP), R2 @@ -2533,17 +2468,8 @@ index 2f67ba86d574..813dfad7d264 100644 - SLD $4, R5 - ADD R5, R9 - LMG 0(R9), R5, R6 -+// -+// Call LE function, if the return is -1 -+// errno and errno2 is retrieved -+// -+TEXT ·CallLeFuncWithErr(SB), NOSPLIT, $0 -+ MOVW PSALAA, R8 -+ MOVD LCA64(R8), R8 -+ MOVD CAA(R8), R9 -+ MOVD g, GOCB(R9) - - // Restore LE stack. +- +- // Restore LE stack. - MOVD SAVSTACK_ASYNC(R8), R9 - MOVD 0(R9), R4 - MOVD $0, 0(R9) @@ -2558,61 +2484,7 @@ index 2f67ba86d574..813dfad7d264 100644 - - // Call function. - LE_CALL -+ MOVD SAVSTACK_ASYNC(R8), R9 // R9-> LE stack frame saving address -+ MOVD 0(R9), R4 // R4-> restore previously saved stack frame pointer -+ -+ MOVD parms_base+8(FP), R7 // R7 -> argument array -+ MOVD parms_len+16(FP), R8 // R8 number of arguments -+ -+ // arg 1 ---> R1 -+ CMP R8, $0 -+ BEQ docall -+ SUB $1, R8 -+ MOVD 0(R7), R1 -+ -+ // arg 2 ---> R2 -+ CMP R8, $0 -+ BEQ docall -+ SUB $1, R8 -+ ADD $8, R7 -+ MOVD 0(R7), R2 -+ -+ // arg 3 --> R3 -+ CMP R8, $0 -+ BEQ docall -+ SUB $1, R8 -+ ADD $8, R7 -+ MOVD 0(R7), R3 -+ -+ CMP R8, $0 -+ BEQ docall -+ MOVD $2176+16, R6 // starting LE stack address-8 to store 4th argument -+ -+repeat: -+ ADD $8, R7 -+ MOVD 0(R7), R0 // advance arg pointer by 8 byte -+ ADD $8, R6 // advance LE argument address by 8 byte -+ MOVD R0, (R4)(R6*1) // copy argument from go-slice to le-frame -+ SUB $1, R8 -+ CMP R8, $0 -+ BNE repeat -+ -+docall: -+ MOVD funcdesc+0(FP), R8 // R8-> function descriptor -+ LMG 0(R8), R5, R6 -+ MOVD $0, 0(R9) // R9 address of SAVSTACK_ASYNC -+ LE_CALL // balr R7, R6 (return #1) -+ NOPH -+ MOVD R3, ret+32(FP) -+ CMP R3, $-1 // compare result to -1 -+ BNE done -+ -+ // retrieve errno and errno2 -+ MOVD zosLibVec<>(SB), R8 -+ ADD $(__errno), R8 -+ LMG 0(R8), R5, R6 -+ LE_CALL // balr R7, R6 __errno (return #3) - NOPH +- NOPH - XOR R0, R0 // Restore R0 to $0. - MOVD R4, 0(R9) // Save stack pointer. - @@ -2625,20 +2497,9 @@ index 2f67ba86d574..813dfad7d264 100644 - BL ·rrno<>(SB) - MOVWZ 0(R3), R3 - MOVD R3, err+72(FP) -+ MOVWZ 0(R3), R3 -+ MOVD R3, err+48(FP) -+ MOVD zosLibVec<>(SB), R8 -+ ADD $(__err2ad), R8 -+ LMG 0(R8), R5, R6 -+ LE_CALL // balr R7, R6 __err2ad (return #2) -+ NOPH -+ MOVW (R3), R2 // retrieve errno2 -+ MOVD R2, errno2+40(FP) // store in return area -+ - done: -+ MOVD R4, 0(R9) // Save stack pointer. - RET - +-done: +- RET +- -TEXT ·syscall_syscall9(SB),NOSPLIT,$0 - BL runtime·entersyscall(SB) - MOVD a1+8(FP), R1 @@ -2656,17 +2517,8 @@ index 2f67ba86d574..813dfad7d264 100644 - SLD $4, R5 - ADD R5, R9 - LMG 0(R9), R5, R6 -+// -+// Call LE function, if the return is 0 -+// errno and errno2 is retrieved -+// -+TEXT ·CallLeFuncWithPtrReturn(SB), NOSPLIT, $0 -+ MOVW PSALAA, R8 -+ MOVD LCA64(R8), R8 -+ MOVD CAA(R8), R9 -+ MOVD g, GOCB(R9) - - // Restore LE stack. +- +- // Restore LE stack. - MOVD SAVSTACK_ASYNC(R8), R9 - MOVD 0(R9), R4 - MOVD $0, 0(R9) @@ -2687,51 +2539,7 @@ index 2f67ba86d574..813dfad7d264 100644 - - // Call function. - LE_CALL -+ MOVD SAVSTACK_ASYNC(R8), R9 // R9-> LE stack frame saving address -+ MOVD 0(R9), R4 // R4-> restore previously saved stack frame pointer -+ -+ MOVD parms_base+8(FP), R7 // R7 -> argument array -+ MOVD parms_len+16(FP), R8 // R8 number of arguments -+ -+ // arg 1 ---> R1 -+ CMP R8, $0 -+ BEQ docall -+ SUB $1, R8 -+ MOVD 0(R7), R1 -+ -+ // arg 2 ---> R2 -+ CMP R8, $0 -+ BEQ docall -+ SUB $1, R8 -+ ADD $8, R7 -+ MOVD 0(R7), R2 -+ -+ // arg 3 --> R3 -+ CMP R8, $0 -+ BEQ docall -+ SUB $1, R8 -+ ADD $8, R7 -+ MOVD 0(R7), R3 -+ -+ CMP R8, $0 -+ BEQ docall -+ MOVD $2176+16, R6 // starting LE stack address-8 to store 4th argument -+ -+repeat: -+ ADD $8, R7 -+ MOVD 0(R7), R0 // advance arg pointer by 8 byte -+ ADD $8, R6 // advance LE argument address by 8 byte -+ MOVD R0, (R4)(R6*1) // copy argument from go-slice to le-frame -+ SUB $1, R8 -+ CMP R8, $0 -+ BNE repeat -+ -+docall: -+ MOVD funcdesc+0(FP), R8 // R8-> function descriptor -+ LMG 0(R8), R5, R6 -+ MOVD $0, 0(R9) // R9 address of SAVSTACK_ASYNC -+ LE_CALL // balr R7, R6 (return #1) - NOPH +- NOPH - XOR R0, R0 // Restore R0 to $0. - MOVD R4, 0(R9) // Save stack pointer. - @@ -2786,16 +2594,7 @@ index 2f67ba86d574..813dfad7d264 100644 - - // Call function. - LE_CALL -+ MOVD R3, ret+32(FP) -+ CMP R3, $0 // compare result to 0 -+ BNE done -+ -+ // retrieve errno and errno2 -+ MOVD zosLibVec<>(SB), R8 -+ ADD $(__errno), R8 -+ LMG 0(R8), R5, R6 -+ LE_CALL // balr R7, R6 __errno (return #3) - NOPH +- NOPH - XOR R0, R0 // Restore R0 to $0. - MOVD R4, 0(R9) // Save stack pointer. - @@ -2809,32 +2608,50 @@ index 2f67ba86d574..813dfad7d264 100644 - MOVWZ 0(R3), R3 - MOVD R3, err+96(FP) -done: -- RET -- --// func svcCall(fnptr unsafe.Pointer, argv *unsafe.Pointer, dsa *uint64) ++ XOR R0, R0 // Restore R0 to $0. ++ MOVD R4, 0(R9) // Save stack pointer. + RET + + // func svcCall(fnptr unsafe.Pointer, argv *unsafe.Pointer, dsa *uint64) -TEXT ·svcCall(SB),NOSPLIT,$0 - BL runtime·save_g(SB) // Save g and stack pointer - MOVW PSALAA, R8 - MOVD LCA64(R8), R8 - MOVD SAVSTACK_ASYNC(R8), R9 - MOVD R15, 0(R9) -- ++TEXT ·svcCall(SB), NOSPLIT, $0 ++ BL runtime·save_g(SB) // Save g and stack pointer ++ MOVW PSALAA, R8 ++ MOVD LCA64(R8), R8 ++ MOVD SAVSTACK_ASYNC(R8), R9 ++ MOVD R15, 0(R9) + - MOVD argv+8(FP), R1 // Move function arguments into registers - MOVD dsa+16(FP), g - MOVD fnptr+0(FP), R15 -- ++ MOVD argv+8(FP), R1 // Move function arguments into registers ++ MOVD dsa+16(FP), g ++ MOVD fnptr+0(FP), R15 + - BYTE $0x0D // Branch to function - BYTE $0xEF -- ++ BYTE $0x0D // Branch to function ++ BYTE $0xEF + - BL runtime·load_g(SB) // Restore g and stack pointer - MOVW PSALAA, R8 - MOVD LCA64(R8), R8 - MOVD SAVSTACK_ASYNC(R8), R9 - MOVD 0(R9), R15 -- -- RET -- --// func svcLoad(name *byte) unsafe.Pointer ++ BL runtime·load_g(SB) // Restore g and stack pointer ++ MOVW PSALAA, R8 ++ MOVD LCA64(R8), R8 ++ MOVD SAVSTACK_ASYNC(R8), R9 ++ MOVD 0(R9), R15 + + RET + + // func svcLoad(name *byte) unsafe.Pointer -TEXT ·svcLoad(SB),NOSPLIT,$0 - MOVD R15, R2 // Save go stack pointer - MOVD name+0(FP), R0 // Move SVC args into registers @@ -2846,18 +2663,226 @@ index 2f67ba86d574..813dfad7d264 100644 - MOVD R2, R15 // Restore go stack pointer - CMP R3, $0 // Check SVC return code - BNE error -- ++TEXT ·svcLoad(SB), NOSPLIT, $0 ++ MOVD R15, R2 // Save go stack pointer ++ MOVD name+0(FP), R0 // Move SVC args into registers ++ MOVD $0x80000000, R1 ++ MOVD $0, R15 ++ SVC_LOAD ++ MOVW R15, R3 // Save return code from SVC ++ MOVD R2, R15 // Restore go stack pointer ++ CMP R3, $0 // Check SVC return code ++ BNE error + - MOVD $-2, R3 // Reset last bit of entry point to zero - AND R0, R3 - MOVD R3, addr+8(FP) // Return entry point returned by SVC - CMP R0, R3 // Check if last bit of entry point was set - BNE done -- ++ MOVD $-2, R3 // Reset last bit of entry point to zero ++ AND R0, R3 ++ MOVD R3, ret+8(FP) // Return entry point returned by SVC ++ CMP R0, R3 // Check if last bit of entry point was set ++ BNE done + - MOVD R15, R2 // Save go stack pointer - MOVD $0, R15 // Move SVC args into registers (entry point still in r0 from SVC 08) - BYTE $0x0A // SVC 09 DELETE - BYTE $0x09 - MOVD R2, R15 // Restore go stack pointer ++ MOVD R15, R2 // Save go stack pointer ++ MOVD $0, R15 // Move SVC args into registers (entry point still in r0 from SVC 08) ++ SVC_DELETE ++ MOVD R2, R15 // Restore go stack pointer + + error: +- MOVD $0, addr+8(FP) // Return 0 on failure ++ MOVD $0, ret+8(FP) // Return 0 on failure ++ + done: +- XOR R0, R0 // Reset r0 to 0 ++ XOR R0, R0 // Reset r0 to 0 + RET + + // func svcUnload(name *byte, fnptr unsafe.Pointer) int64 +-TEXT ·svcUnload(SB),NOSPLIT,$0 +- MOVD R15, R2 // Save go stack pointer +- MOVD name+0(FP), R0 // Move SVC args into registers +- MOVD addr+8(FP), R15 +- BYTE $0x0A // SVC 09 +- BYTE $0x09 +- XOR R0, R0 // Reset r0 to 0 +- MOVD R15, R1 // Save SVC return code +- MOVD R2, R15 // Restore go stack pointer +- MOVD R1, rc+0(FP) // Return SVC return code ++TEXT ·svcUnload(SB), NOSPLIT, $0 ++ MOVD R15, R2 // Save go stack pointer ++ MOVD name+0(FP), R0 // Move SVC args into registers ++ MOVD fnptr+8(FP), R15 ++ SVC_DELETE ++ XOR R0, R0 // Reset r0 to 0 ++ MOVD R15, R1 // Save SVC return code ++ MOVD R2, R15 // Restore go stack pointer ++ MOVD R1, ret+16(FP) // Return SVC return code + RET + + // func gettid() uint64 +@@ -417,7 +150,233 @@ TEXT ·gettid(SB), NOSPLIT, $0 + + // Get CEECAATHDID + MOVD CAA(R8), R9 +- MOVD 0x3D0(R9), R9 ++ MOVD CEECAATHDID(R9), R9 + MOVD R9, ret+0(FP) + + RET ++ ++// ++// Call LE function, if the return is -1 ++// errno and errno2 is retrieved ++// ++TEXT ·CallLeFuncWithErr(SB), NOSPLIT, $0 ++ MOVW PSALAA, R8 ++ MOVD LCA64(R8), R8 ++ MOVD CAA(R8), R9 ++ MOVD g, GOCB(R9) ++ ++ // Restore LE stack. ++ MOVD SAVSTACK_ASYNC(R8), R9 // R9-> LE stack frame saving address ++ MOVD 0(R9), R4 // R4-> restore previously saved stack frame pointer ++ ++ MOVD parms_base+8(FP), R7 // R7 -> argument array ++ MOVD parms_len+16(FP), R8 // R8 number of arguments ++ ++ // arg 1 ---> R1 ++ CMP R8, $0 ++ BEQ docall ++ SUB $1, R8 ++ MOVD 0(R7), R1 ++ ++ // arg 2 ---> R2 ++ CMP R8, $0 ++ BEQ docall ++ SUB $1, R8 ++ ADD $8, R7 ++ MOVD 0(R7), R2 ++ ++ // arg 3 --> R3 ++ CMP R8, $0 ++ BEQ docall ++ SUB $1, R8 ++ ADD $8, R7 ++ MOVD 0(R7), R3 ++ ++ CMP R8, $0 ++ BEQ docall ++ MOVD $2176+16, R6 // starting LE stack address-8 to store 4th argument ++ ++repeat: ++ ADD $8, R7 ++ MOVD 0(R7), R0 // advance arg pointer by 8 byte ++ ADD $8, R6 // advance LE argument address by 8 byte ++ MOVD R0, (R4)(R6*1) // copy argument from go-slice to le-frame ++ SUB $1, R8 ++ CMP R8, $0 ++ BNE repeat ++ ++docall: ++ MOVD funcdesc+0(FP), R8 // R8-> function descriptor ++ LMG 0(R8), R5, R6 ++ MOVD $0, 0(R9) // R9 address of SAVSTACK_ASYNC ++ LE_CALL // balr R7, R6 (return #1) ++ NOPH ++ MOVD R3, ret+32(FP) ++ CMP R3, $-1 // compare result to -1 ++ BNE done ++ ++ // retrieve errno and errno2 ++ MOVD zosLibVec<>(SB), R8 ++ ADD $(__errno), R8 ++ LMG 0(R8), R5, R6 ++ LE_CALL // balr R7, R6 __errno (return #3) ++ NOPH ++ MOVWZ 0(R3), R3 ++ MOVD R3, err+48(FP) ++ MOVD zosLibVec<>(SB), R8 ++ ADD $(__err2ad), R8 ++ LMG 0(R8), R5, R6 ++ LE_CALL // balr R7, R6 __err2ad (return #2) ++ NOPH ++ MOVW (R3), R2 // retrieve errno2 ++ MOVD R2, errno2+40(FP) // store in return area ++ ++done: ++ MOVD R4, 0(R9) // Save stack pointer. ++ RET ++ ++// ++// Call LE function, if the return is 0 ++// errno and errno2 is retrieved ++// ++TEXT ·CallLeFuncWithPtrReturn(SB), NOSPLIT, $0 ++ MOVW PSALAA, R8 ++ MOVD LCA64(R8), R8 ++ MOVD CAA(R8), R9 ++ MOVD g, GOCB(R9) ++ ++ // Restore LE stack. ++ MOVD SAVSTACK_ASYNC(R8), R9 // R9-> LE stack frame saving address ++ MOVD 0(R9), R4 // R4-> restore previously saved stack frame pointer ++ ++ MOVD parms_base+8(FP), R7 // R7 -> argument array ++ MOVD parms_len+16(FP), R8 // R8 number of arguments ++ ++ // arg 1 ---> R1 ++ CMP R8, $0 ++ BEQ docall ++ SUB $1, R8 ++ MOVD 0(R7), R1 ++ ++ // arg 2 ---> R2 ++ CMP R8, $0 ++ BEQ docall ++ SUB $1, R8 ++ ADD $8, R7 ++ MOVD 0(R7), R2 ++ ++ // arg 3 --> R3 ++ CMP R8, $0 ++ BEQ docall ++ SUB $1, R8 ++ ADD $8, R7 ++ MOVD 0(R7), R3 ++ ++ CMP R8, $0 ++ BEQ docall ++ MOVD $2176+16, R6 // starting LE stack address-8 to store 4th argument ++ ++repeat: ++ ADD $8, R7 ++ MOVD 0(R7), R0 // advance arg pointer by 8 byte ++ ADD $8, R6 // advance LE argument address by 8 byte ++ MOVD R0, (R4)(R6*1) // copy argument from go-slice to le-frame ++ SUB $1, R8 ++ CMP R8, $0 ++ BNE repeat ++ ++docall: ++ MOVD funcdesc+0(FP), R8 // R8-> function descriptor ++ LMG 0(R8), R5, R6 ++ MOVD $0, 0(R9) // R9 address of SAVSTACK_ASYNC ++ LE_CALL // balr R7, R6 (return #1) ++ NOPH ++ MOVD R3, ret+32(FP) ++ CMP R3, $0 // compare result to 0 ++ BNE done ++ ++ // retrieve errno and errno2 ++ MOVD zosLibVec<>(SB), R8 ++ ADD $(__errno), R8 ++ LMG 0(R8), R5, R6 ++ LE_CALL // balr R7, R6 __errno (return #3) ++ NOPH + MOVWZ 0(R3), R3 + MOVD R3, err+48(FP) + MOVD zosLibVec<>(SB), R8 @@ -2869,25 +2894,11 @@ index 2f67ba86d574..813dfad7d264 100644 + MOVD R2, errno2+40(FP) // store in return area + XOR R2, R2 + MOVWZ R2, (R3) // clear errno2 - --error: -- MOVD $0, addr+8(FP) // Return 0 on failure - done: -- XOR R0, R0 // Reset r0 to 0 ++ ++done: + MOVD R4, 0(R9) // Save stack pointer. - RET - --// func svcUnload(name *byte, fnptr unsafe.Pointer) int64 --TEXT ·svcUnload(SB),NOSPLIT,$0 -- MOVD R15, R2 // Save go stack pointer -- MOVD name+0(FP), R0 // Move SVC args into registers -- MOVD addr+8(FP), R15 -- BYTE $0x0A // SVC 09 -- BYTE $0x09 -- XOR R0, R0 // Reset r0 to 0 -- MOVD R15, R1 // Save SVC return code -- MOVD R2, R15 // Restore go stack pointer -- MOVD R1, rc+0(FP) // Return SVC return code ++ RET ++ +// +// function to test if a pointer can be safely dereferenced (content read) +// return 0 for succces @@ -2922,19 +2933,8 @@ index 2f67ba86d574..813dfad7d264 100644 + BYTE $0xB9; BYTE $0x82; BYTE $0x00; BYTE $0x99 // lbl2 xgr 9,9 + BYTE $0xE3; BYTE $0x92; BYTE $0x00; BYTE $0x00; BYTE $0x00; BYTE $0x24 // stg 9,0(2) + MOVD R3, ret+8(FP) // result in R3 - RET - --// func gettid() uint64 --TEXT ·gettid(SB), NOSPLIT, $0 -- // Get library control area (LCA). -- MOVW PSALAA, R8 -- MOVD LCA64(R8), R8 -- -- // Get CEECAATHDID -- MOVD CAA(R8), R9 -- MOVD 0x3D0(R9), R9 -- MOVD R9, ret+0(FP) -- ++ RET ++ +// +// function to test if a untptr can be loaded from a pointer +// return 1: the 8-byte content @@ -2961,10 +2961,10 @@ index 2f67ba86d574..813dfad7d264 100644 + BYTE $0xE3; BYTE $0x92; BYTE $0x00; BYTE $0x00; BYTE $0x00; BYTE $0x24 // stg 9,0(2) + MOVD R6, value+8(FP) // result in R6 + MOVD R3, error+16(FP) // error in R3 - RET ++ RET diff --git a/vendor/golang.org/x/sys/unix/bpxsvc_zos.go b/vendor/golang.org/x/sys/unix/bpxsvc_zos.go new file mode 100644 -index 000000000000..39d647d863a0 +index 000000000..39d647d86 --- /dev/null +++ b/vendor/golang.org/x/sys/unix/bpxsvc_zos.go @@ -0,0 +1,657 @@ @@ -3627,7 +3627,7 @@ index 000000000000..39d647d863a0 +} diff --git a/vendor/golang.org/x/sys/unix/bpxsvc_zos.s b/vendor/golang.org/x/sys/unix/bpxsvc_zos.s new file mode 100644 -index 000000000000..4bd4a179821b +index 000000000..4bd4a1798 --- /dev/null +++ b/vendor/golang.org/x/sys/unix/bpxsvc_zos.s @@ -0,0 +1,192 @@ @@ -3825,7 +3825,7 @@ index 000000000000..4bd4a179821b + RET diff --git a/vendor/golang.org/x/sys/unix/epoll_zos.go b/vendor/golang.org/x/sys/unix/epoll_zos.go deleted file mode 100644 -index 7753fddea817..000000000000 +index 7753fddea..000000000 --- a/vendor/golang.org/x/sys/unix/epoll_zos.go +++ /dev/null @@ -1,220 +0,0 @@ @@ -4051,7 +4051,7 @@ index 7753fddea817..000000000000 -} diff --git a/vendor/golang.org/x/sys/unix/fstatfs_zos.go b/vendor/golang.org/x/sys/unix/fstatfs_zos.go deleted file mode 100644 -index c8bde601e772..000000000000 +index c8bde601e..000000000 --- a/vendor/golang.org/x/sys/unix/fstatfs_zos.go +++ /dev/null @@ -1,163 +0,0 @@ @@ -4219,7 +4219,7 @@ index c8bde601e772..000000000000 - return err -} diff --git a/vendor/golang.org/x/sys/unix/mkerrors.sh b/vendor/golang.org/x/sys/unix/mkerrors.sh -index fdcaa974d23b..4ed2e488b616 100644 +index fdcaa974d..4ed2e488b 100644 --- a/vendor/golang.org/x/sys/unix/mkerrors.sh +++ b/vendor/golang.org/x/sys/unix/mkerrors.sh @@ -263,6 +263,7 @@ struct ltchars { @@ -4239,7 +4239,7 @@ index fdcaa974d23b..4ed2e488b616 100644 $2 ~ /^SIOC/ || $2 ~ /^TIOC/ || diff --git a/vendor/golang.org/x/sys/unix/mmap_nomremap.go b/vendor/golang.org/x/sys/unix/mmap_nomremap.go -index 4b68e59780a2..7f602ffd26d4 100644 +index 4b68e5978..7f602ffd2 100644 --- a/vendor/golang.org/x/sys/unix/mmap_nomremap.go +++ b/vendor/golang.org/x/sys/unix/mmap_nomremap.go @@ -2,7 +2,7 @@ @@ -4252,7 +4252,7 @@ index 4b68e59780a2..7f602ffd26d4 100644 package unix diff --git a/vendor/golang.org/x/sys/unix/pagesize_unix.go b/vendor/golang.org/x/sys/unix/pagesize_unix.go -index 4d0a3430edc5..0482408d7c6c 100644 +index 4d0a3430e..0482408d7 100644 --- a/vendor/golang.org/x/sys/unix/pagesize_unix.go +++ b/vendor/golang.org/x/sys/unix/pagesize_unix.go @@ -2,7 +2,7 @@ @@ -4265,7 +4265,7 @@ index 4d0a3430edc5..0482408d7c6c 100644 // For Unix, get the pagesize from the runtime. diff --git a/vendor/golang.org/x/sys/unix/readdirent_getdirentries.go b/vendor/golang.org/x/sys/unix/readdirent_getdirentries.go -index 130398b6b767..b903c00604b9 100644 +index 130398b6b..b903c0060 100644 --- a/vendor/golang.org/x/sys/unix/readdirent_getdirentries.go +++ b/vendor/golang.org/x/sys/unix/readdirent_getdirentries.go @@ -2,7 +2,7 @@ @@ -4279,7 +4279,7 @@ index 130398b6b767..b903c00604b9 100644 diff --git a/vendor/golang.org/x/sys/unix/sockcmsg_zos.go b/vendor/golang.org/x/sys/unix/sockcmsg_zos.go new file mode 100644 -index 000000000000..3e53dbc0286d +index 000000000..3e53dbc02 --- /dev/null +++ b/vendor/golang.org/x/sys/unix/sockcmsg_zos.go @@ -0,0 +1,58 @@ @@ -4343,7 +4343,7 @@ index 000000000000..3e53dbc0286d +} diff --git a/vendor/golang.org/x/sys/unix/symaddr_zos_s390x.s b/vendor/golang.org/x/sys/unix/symaddr_zos_s390x.s new file mode 100644 -index 000000000000..3c4f33cb6a80 +index 000000000..3c4f33cb6 --- /dev/null +++ b/vendor/golang.org/x/sys/unix/symaddr_zos_s390x.s @@ -0,0 +1,75 @@ @@ -4423,7 +4423,7 @@ index 000000000000..3c4f33cb6a80 + RET + diff --git a/vendor/golang.org/x/sys/unix/syscall_zos_s390x.go b/vendor/golang.org/x/sys/unix/syscall_zos_s390x.go -index b473038c6155..312ae6ac1d21 100644 +index b473038c6..312ae6ac1 100644 --- a/vendor/golang.org/x/sys/unix/syscall_zos_s390x.go +++ b/vendor/golang.org/x/sys/unix/syscall_zos_s390x.go @@ -4,11 +4,21 @@ @@ -5294,28 +5294,29 @@ index b473038c6155..312ae6ac1d21 100644 - wd, err := Getwd() - if err != nil { - return err +- } +//sys openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) = SYS___OPENAT_A -+ + +- if err := Fchdir(dirfd); err != nil { +- return err +func Openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) { + if flags&O_ACCMODE == 0 { + flags |= O_RDONLY } +- defer Chdir(wd) + return openat(dirfd, path, flags, mode) +} -- if err := Fchdir(dirfd); err != nil { -- return err +- return Mkfifo(path, mode) +//sys openat2(dirfd int, path string, open_how *OpenHow, size int) (fd int, err error) = SYS___OPENAT2_A + +func Openat2(dirfd int, path string, how *OpenHow) (fd int, err error) { + if how.Flags&O_ACCMODE == 0 { + how.Flags |= O_RDONLY - } -- defer Chdir(wd) ++ } + return openat2(dirfd, path, how, SizeofOpenHow) +} - -- return Mkfifo(path, mode) ++ +func ZosFdToPath(dirfd int) (path string, err error) { + var buffer [1024]byte + runtime.EnterSyscall() @@ -5531,26 +5532,27 @@ index b473038c6155..312ae6ac1d21 100644 func Getsockname(fd int) (sa Sockaddr, err error) { var rsa RawSockaddrAny var len _Socklen = SizeofSockaddrAny -@@ -1186,67 +1964,46 @@ func SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error) - return n, nil - } - --func Opendir(name string) (uintptr, error) { -- p, err := BytePtrFromString(name) -- if err != nil { -- return 0, err -- } +@@ -1191,10 +1969,13 @@ func Opendir(name string) (uintptr, error) { + if err != nil { + return 0, err + } - dir, _, e := syscall_syscall(SYS___OPENDIR_A, uintptr(unsafe.Pointer(p)), 0, 0) -- runtime.KeepAlive(unsafe.Pointer(p)) ++ err = nil ++ runtime.EnterSyscall() ++ dir, e2, e1 := CallLeFuncWithPtrReturn(GetZosLibVec()+SYS___OPENDIR_A<<4, uintptr(unsafe.Pointer(p))) ++ runtime.ExitSyscall() + runtime.KeepAlive(unsafe.Pointer(p)) - if e != 0 { - err = errnoErr(e) -- } -- return dir, err --} -- --// clearsyscall.Errno resets the errno value to 0. --func clearErrno() -- ++ if dir == 0 { ++ err = errnoErr2(e1, e2) + } + return dir, err + } +@@ -1202,51 +1983,27 @@ func Opendir(name string) (uintptr, error) { + // clearsyscall.Errno resets the errno value to 0. + func clearErrno() + -func Readdir(dir uintptr) (*Dirent, error) { - var ent Dirent - var res uintptr @@ -5575,26 +5577,10 @@ index b473038c6155..312ae6ac1d21 100644 - r0, _, e1 := syscall_syscall(SYS___READDIR_R_A, dirp, uintptr(unsafe.Pointer(entry)), uintptr(unsafe.Pointer(result))) - if int64(r0) == -1 { - err = errnoErr(Errno(e1)) -+func Opendir(name string) (uintptr, error) { -+ p, err := BytePtrFromString(name) -+ if err != nil { -+ return 0, err - } +- } - return -+ err = nil -+ runtime.EnterSyscall() -+ dir, e2, e1 := CallLeFuncWithPtrReturn(GetZosLibVec()+SYS___OPENDIR_A<<4, uintptr(unsafe.Pointer(p))) -+ runtime.ExitSyscall() -+ runtime.KeepAlive(unsafe.Pointer(p)) -+ if dir == 0 { -+ err = errnoErr2(e1, e2) -+ } -+ return dir, err - } - -+// clearsyscall.Errno resets the errno value to 0. -+func clearErrno() -+ +-} +- func Closedir(dir uintptr) error { - _, _, e := syscall_syscall(SYS_CLOSEDIR, dir, 0, 0) - if e != 0 { @@ -5645,8 +5631,9 @@ index b473038c6155..312ae6ac1d21 100644 } - return errno + return errnoErr2(e1, e2) -+} -+ + } + +-func Flock(fd int, how int) error { +func impl_Flock(fd int, how int) (err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FLOCK<<4, uintptr(fd), uintptr(how)) @@ -5679,9 +5666,8 @@ index b473038c6155..312ae6ac1d21 100644 + *funcref = legacyFlock + } + return (*funcref)(fd, how) - } - --func Flock(fd int, how int) error { ++} ++ +func legacyFlock(fd int, how int) error { var flock_type int16 @@ -5775,10 +5761,11 @@ index b473038c6155..312ae6ac1d21 100644 + *funcref = impl_Chtag + } else { + *funcref = legacy_Chtag -+ } + } +- return Fstatfs(fd, stat) + return (*funcref)(path, ccsid, textbit) -+} -+ + } + +func legacy_Chtag(path string, ccsid uint64, textbit uint64) error { + tag := ccsid<<16 | textbit<<15 + var tag_buff [8]byte @@ -5843,8 +5830,7 @@ index b473038c6155..312ae6ac1d21 100644 + return err + } + elapsed = runtime.Nanotime1() - t0 - } -- return Fstatfs(fd, stat) ++ } + // sleep the remainder + if total > elapsed { + rv, rc, _ = BpxCondTimedWait(uint32(0), uint32(total-elapsed), uint32(CW_CONDVAR), &secrem, &nsecrem) @@ -5857,8 +5843,8 @@ index b473038c6155..312ae6ac1d21 100644 + err = Errno(rc) + } + return err - } - ++} ++ +// End of Nanosleep + var ( @@ -5946,6 +5932,8 @@ index b473038c6155..312ae6ac1d21 100644 } -func Mount(source string, target string, fstype string, flags uintptr, data string) (err error) { +- if needspace := 8 - len(fstype); needspace <= 0 { +- fstype = fstype[:8] +func Getag(path string) (ccsid uint16, flag uint16, err error) { + var val [8]byte + sz, err := Getxattr(path, "ccsid", val[:]) @@ -6001,18 +5989,17 @@ index b473038c6155..312ae6ac1d21 100644 + funcref := get_MountAddr() + if validMount() { + *funcref = impl_Mount -+ } else { + } else { +- fstype += " "[:needspace] + *funcref = legacyMount + } + return (*funcref)(source, target, fstype, flags, data) +} + +func legacyMount(source string, target string, fstype string, flags uintptr, data string) (err error) { - if needspace := 8 - len(fstype); needspace <= 0 { -- fstype = fstype[:8] ++ if needspace := 8 - len(fstype); needspace <= 0 { + fstype = fstype[0:8] - } else { -- fstype += " "[:needspace] ++ } else { + fstype += " "[0:needspace] } return mount_LE(target, source, fstype, uint32(flags), int32(len(data)), data) @@ -6198,6 +6185,16 @@ index b473038c6155..312ae6ac1d21 100644 -func direntIno(buf []byte) (uint64, bool) { - return readInt(buf, unsafe.Offsetof(Dirent{}.Ino), unsafe.Sizeof(Dirent{}.Ino)) +-} +- +-func direntReclen(buf []byte) (uint64, bool) { +- return readInt(buf, unsafe.Offsetof(Dirent{}.Reclen), unsafe.Sizeof(Dirent{}.Reclen)) +-} +- +-func direntNamlen(buf []byte) (uint64, bool) { +- reclen, ok := direntReclen(buf) +- if !ok { +- return 0, false +func ZosConsolePrintf(format string, v ...interface{}) (int, error) { + type __cmsg struct { + _ uint16 @@ -6205,7 +6202,8 @@ index b473038c6155..312ae6ac1d21 100644 + __msg_length uint32 + __msg uintptr + _ [4]uint8 -+ } + } +- return reclen - uint64(unsafe.Offsetof(Dirent{}.Name)), true + msg := fmt.Sprintf(format, v...) + strptr := unsafe.Pointer((*reflect.StringHeader)(unsafe.Pointer(&msg)).Data) + len := (*reflect.StringHeader)(unsafe.Pointer(&msg)).Len @@ -6218,7 +6216,7 @@ index b473038c6155..312ae6ac1d21 100644 + return 0, fmt.Errorf("%s (errno2=0x%x)\n", err1.Error(), err2) + } + return 0, nil -+} + } +func ZosStringToEbcdicBytes(str string, nullterm bool) (ebcdicBytes []byte) { + if nullterm { + ebcdicBytes = []byte(str + "\x00") @@ -6238,10 +6236,8 @@ index b473038c6155..312ae6ac1d21 100644 + str = string(res) + } + return - } - --func direntReclen(buf []byte) (uint64, bool) { -- return readInt(buf, unsafe.Offsetof(Dirent{}.Reclen), unsafe.Sizeof(Dirent{}.Reclen)) ++} ++ +func fdToPath(dirfd int) (path string, err error) { + var buffer [1024]byte + // w_ctrl() @@ -6275,19 +6271,14 @@ index b473038c6155..312ae6ac1d21 100644 + } else { + return "", fmt.Errorf("fdToPath errno %d (errno2=0x%x)", errno, errno2) + } - } - --func direntNamlen(buf []byte) (uint64, bool) { -- reclen, ok := direntReclen(buf) -- if !ok { -- return 0, false ++} ++ +func impl_Mkfifoat(dirfd int, path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return - } -- return reclen - uint64(unsafe.Offsetof(Dirent{}.Name)), true ++ } + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___MKFIFOAT_A<<4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) + runtime.ExitSyscall() @@ -6318,13 +6309,13 @@ index b473038c6155..312ae6ac1d21 100644 + return err + } + return Mkfifo(dirname+"/"+path, mode) - } ++} + +//sys Posix_openpt(oflag int) (fd int, err error) = SYS_POSIX_OPENPT +//sys Grantpt(fildes int) (rc int, err error) = SYS_GRANTPT +//sys Unlockpt(fildes int) (rc int, err error) = SYS_UNLOCKPT diff --git a/vendor/golang.org/x/sys/unix/sysvshm_unix.go b/vendor/golang.org/x/sys/unix/sysvshm_unix.go -index 79a84f18b46d..672d6b0a8805 100644 +index 79a84f18b..672d6b0a8 100644 --- a/vendor/golang.org/x/sys/unix/sysvshm_unix.go +++ b/vendor/golang.org/x/sys/unix/sysvshm_unix.go @@ -2,7 +2,7 @@ @@ -6337,7 +6328,7 @@ index 79a84f18b46d..672d6b0a8805 100644 package unix diff --git a/vendor/golang.org/x/sys/unix/sysvshm_unix_other.go b/vendor/golang.org/x/sys/unix/sysvshm_unix_other.go -index 9eb0db664cbf..8b7977a28c06 100644 +index 9eb0db664..8b7977a28 100644 --- a/vendor/golang.org/x/sys/unix/sysvshm_unix_other.go +++ b/vendor/golang.org/x/sys/unix/sysvshm_unix_other.go @@ -2,7 +2,7 @@ @@ -6350,7 +6341,7 @@ index 9eb0db664cbf..8b7977a28c06 100644 package unix diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux.go b/vendor/golang.org/x/sys/unix/zerrors_linux.go -index 36bf8399f4fa..877a62b479a4 100644 +index 36bf8399f..877a62b47 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux.go @@ -491,6 +491,7 @@ const ( @@ -6517,7 +6508,7 @@ index 36bf8399f4fa..877a62b479a4 100644 XDP_USE_NEED_WAKEUP = 0x8 XDP_USE_SG = 0x10 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_386.go b/vendor/golang.org/x/sys/unix/zerrors_linux_386.go -index 42ff8c3c1b06..e4bc0bd57c7c 100644 +index 42ff8c3c1..e4bc0bd57 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_386.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_386.go @@ -118,6 +118,7 @@ const ( @@ -6529,7 +6520,7 @@ index 42ff8c3c1b06..e4bc0bd57c7c 100644 MAP_ANONYMOUS = 0x20 MAP_DENYWRITE = 0x800 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go -index dca436004fa4..689317afdbf3 100644 +index dca436004..689317afd 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go @@ -118,6 +118,7 @@ const ( @@ -6541,7 +6532,7 @@ index dca436004fa4..689317afdbf3 100644 MAP_ANONYMOUS = 0x20 MAP_DENYWRITE = 0x800 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go -index d8cae6d15340..14270508b040 100644 +index d8cae6d15..14270508b 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go @@ -87,6 +87,7 @@ const ( @@ -6553,7 +6544,7 @@ index d8cae6d15340..14270508b040 100644 FS_IOC_ENABLE_VERITY = 0x40806685 FS_IOC_GETFLAGS = 0x80086601 diff --git a/vendor/golang.org/x/sys/unix/zerrors_zos_s390x.go b/vendor/golang.org/x/sys/unix/zerrors_zos_s390x.go -index 4dfd2e051d35..da08b2ab3d93 100644 +index 4dfd2e051..da08b2ab3 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_zos_s390x.go +++ b/vendor/golang.org/x/sys/unix/zerrors_zos_s390x.go @@ -10,41 +10,99 @@ @@ -6904,7 +6895,7 @@ index 4dfd2e051d35..da08b2ab3d93 100644 {1002, "EDC8002I", "A socket descriptor is out of range."}, diff --git a/vendor/golang.org/x/sys/unix/zsymaddr_zos_s390x.s b/vendor/golang.org/x/sys/unix/zsymaddr_zos_s390x.s new file mode 100644 -index 000000000000..b77ff5db90d5 +index 000000000..b77ff5db9 --- /dev/null +++ b/vendor/golang.org/x/sys/unix/zsymaddr_zos_s390x.s @@ -0,0 +1,364 @@ @@ -7273,7 +7264,7 @@ index 000000000000..b77ff5db90d5 + MOVD R8, ret+0(FP) + RET diff --git a/vendor/golang.org/x/sys/unix/zsyscall_zos_s390x.go b/vendor/golang.org/x/sys/unix/zsyscall_zos_s390x.go -index 94f011238319..7ccf66b7ee0d 100644 +index 94f011238..7ccf66b7e 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_zos_s390x.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_zos_s390x.go @@ -1,4 +1,4 @@ @@ -7282,7 +7273,7 @@ index 94f011238319..7ccf66b7ee0d 100644 // Code generated by the command above; see README.md. DO NOT EDIT. //go:build zos && s390x -@@ -6,17 +6,100 @@ +@@ -6,22 +6,105 @@ package unix import ( @@ -7305,12 +7296,12 @@ index 94f011238319..7ccf66b7ee0d 100644 - err = errnoErr(e1) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) -+ } -+ return -+} -+ -+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -+ + } + return + } + + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func impl_Flistxattr(fd int, dest []byte) (sz int, err error) { + var _p0 unsafe.Pointer + if len(dest) > 0 { @@ -7377,15 +7368,20 @@ index 94f011238319..7ccf66b7ee0d 100644 + *funcref = impl_Fremovexattr + } else { + *funcref = error_Fremovexattr - } ++ } + return (*funcref)(fd, attr) +} + +func error_Fremovexattr(fd int, attr string) (err error) { + err = ENOSYS - return - } - ++ return ++} ++ ++// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT ++ + func read(fd int, p []byte) (n int, err error) { + var _p0 unsafe.Pointer + if len(p) > 0 { @@ -29,10 +112,12 @@ func read(fd int, p []byte) (n int, err error) { } else { _p0 = unsafe.Pointer(&_zero) @@ -7415,12 +7411,12 @@ index 94f011238319..7ccf66b7ee0d 100644 - err = errnoErr(e1) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) -+ } -+ return -+} -+ -+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -+ + } + return + } + + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func impl_Fgetxattr(fd int, attr string, dest []byte) (sz int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) @@ -7498,39 +7494,39 @@ index 94f011238319..7ccf66b7ee0d 100644 + *funcref = impl_Fsetxattr + } else { + *funcref = error_Fsetxattr - } ++ } + return (*funcref)(fd, attr, data, flag) +} + +func error_Fsetxattr(fd int, attr string, data []byte, flag int) (err error) { + err = ENOSYS - return - } - - // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - - func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { -- r0, _, e1 := syscall_syscall(SYS___ACCEPT_A, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) -+ runtime.EnterSyscall() -+ r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___ACCEPT_A<<4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) -+ runtime.ExitSyscall() -+ fd = int(r0) -+ if int64(r0) == -1 { -+ err = errnoErr2(e1, e2) -+ } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + -+func impl_accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) { + func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { +- r0, _, e1 := syscall_syscall(SYS___ACCEPT_A, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + runtime.EnterSyscall() -+ r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___ACCEPT4_A<<4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags)) ++ r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___ACCEPT_A<<4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + runtime.ExitSyscall() fd = int(r0) - if e1 != 0 { - err = errnoErr(e1) + if int64(r0) == -1 { ++ err = errnoErr2(e1, e2) + } + return + } + + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + ++func impl_accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) { ++ runtime.EnterSyscall() ++ r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___ACCEPT4_A<<4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags)) ++ runtime.ExitSyscall() ++ fd = int(r0) ++ if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } + return @@ -7547,18 +7543,18 @@ index 94f011238319..7ccf66b7ee0d 100644 + *funcref = impl_accept4 + } else { + *funcref = error_accept4 - } ++ } + return (*funcref)(s, rsa, addrlen, flags) +} + +func error_accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) { + fd = -1 + err = ENOSYS - return - } - - // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - ++ return ++} ++ ++// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT ++ func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { - _, _, e1 := syscall_syscall(SYS___BIND_A, uintptr(s), uintptr(addr), uintptr(addrlen)) - if e1 != 0 { @@ -7683,7 +7679,7 @@ index 94f011238319..7ccf66b7ee0d 100644 } return } -@@ -160,10 +379,52 @@ func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { +@@ -160,15 +379,57 @@ func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { @@ -7693,12 +7689,12 @@ index 94f011238319..7ccf66b7ee0d 100644 + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___GETSOCKNAME_A<<4, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) -+ } -+ return -+} -+ -+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -+ + } + return + } + + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func impl_Removexattr(path string, attr string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) @@ -7730,15 +7726,20 @@ index 94f011238319..7ccf66b7ee0d 100644 + *funcref = impl_Removexattr + } else { + *funcref = error_Removexattr - } ++ } + return (*funcref)(path, attr) +} + +func error_Removexattr(path string, attr string) (err error) { + err = ENOSYS - return - } - ++ return ++} ++ ++// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT ++ + func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { + var _p0 unsafe.Pointer + if len(p) > 0 { @@ -176,10 +437,12 @@ func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Sockl } else { _p0 = unsafe.Pointer(&_zero) @@ -8006,7 +8007,7 @@ index 94f011238319..7ccf66b7ee0d 100644 } return } -@@ -353,617 +693,2216 @@ func Dup(oldfd int) (fd int, err error) { +@@ -353,42 +693,359 @@ func Dup(oldfd int) (fd int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup2(oldfd int, newfd int) (err error) { @@ -8034,21 +8035,14 @@ index 94f011238319..7ccf66b7ee0d 100644 + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } - return - } - --// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT ++ return ++} ++ +//go:nosplit +func get_Dup3Addr() *(func(oldfd int, newfd int, flags int) (err error)) - --func Err2ad() (eadd *int) { -- ueadd, _, _ := syscall_syscall(SYS___ERR2AD, 0, 0, 0) -- eadd = (*int)(unsafe.Pointer(ueadd)) -- return --} ++ +var Dup3 = enter_Dup3 - --// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT ++ +func enter_Dup3(oldfd int, newfd int, flags int) (err error) { + funcref := get_Dup3Addr() + if funcptrtest(GetZosLibVec()+SYS_DUP3<<4, "") == 0 { @@ -8058,9 +8052,7 @@ index 94f011238319..7ccf66b7ee0d 100644 + } + return (*funcref)(oldfd, newfd, flags) +} - --func Exit(code int) { -- syscall_syscall(SYS_EXIT, uintptr(code), 0, 0) ++ +func error_Dup3(oldfd int, newfd int, flags int) (err error) { + err = ENOSYS return @@ -8068,10 +8060,9 @@ index 94f011238319..7ccf66b7ee0d 100644 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT --func Fchdir(fd int) (err error) { -- _, _, e1 := syscall_syscall(SYS_FCHDIR, uintptr(fd), 0, 0) -- if e1 != 0 { -- err = errnoErr(e1) +-func Err2ad() (eadd *int) { +- ueadd, _, _ := syscall_syscall(SYS___ERR2AD, 0, 0, 0) +- eadd = (*int)(unsafe.Pointer(ueadd)) +func impl_Dirfd(dirp uintptr) (fd int, err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_DIRFD<<4, uintptr(dirp)) @@ -8079,18 +8070,13 @@ index 94f011238319..7ccf66b7ee0d 100644 + fd = int(r0) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) - } - return - } - --// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT ++ } ++ return ++} ++ +//go:nosplit +func get_DirfdAddr() *(func(dirp uintptr) (fd int, err error)) - --func Fchmod(fd int, mode uint32) (err error) { -- _, _, e1 := syscall_syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0) -- if e1 != 0 { -- err = errnoErr(e1) ++ +var Dirfd = enter_Dirfd + +func enter_Dirfd(dirp uintptr) (fd int, err error) { @@ -8099,22 +8085,18 @@ index 94f011238319..7ccf66b7ee0d 100644 + *funcref = impl_Dirfd + } else { + *funcref = error_Dirfd - } ++ } + return (*funcref)(dirp) +} + +func error_Dirfd(dirp uintptr) (fd int, err error) { + fd = -1 + err = ENOSYS - return - } - - // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - --func Fchown(fd int, uid int, gid int) (err error) { -- _, _, e1 := syscall_syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid)) -- if e1 != 0 { -- err = errnoErr(e1) ++ return ++} ++ ++// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT ++ +func impl_EpollCreate(size int) (fd int, err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_EPOLL_CREATE<<4, uintptr(size)) @@ -8122,19 +8104,13 @@ index 94f011238319..7ccf66b7ee0d 100644 + fd = int(r0) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) - } - return - } - --// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT ++ } ++ return ++} ++ +//go:nosplit +func get_EpollCreateAddr() *(func(size int) (fd int, err error)) - --func FcntlInt(fd uintptr, cmd int, arg int) (retval int, err error) { -- r0, _, e1 := syscall_syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) -- retval = int(r0) -- if e1 != 0 { -- err = errnoErr(e1) ++ +var EpollCreate = enter_EpollCreate + +func enter_EpollCreate(size int) (fd int, err error) { @@ -8143,22 +8119,18 @@ index 94f011238319..7ccf66b7ee0d 100644 + *funcref = impl_EpollCreate + } else { + *funcref = error_EpollCreate - } ++ } + return (*funcref)(size) +} + +func error_EpollCreate(size int) (fd int, err error) { + fd = -1 + err = ENOSYS - return - } - - // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - --func fstat(fd int, stat *Stat_LE_t) (err error) { -- _, _, e1 := syscall_syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) -- if e1 != 0 { -- err = errnoErr(e1) ++ return ++} ++ ++// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT ++ +func impl_EpollCreate1(flags int) (fd int, err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_EPOLL_CREATE1<<4, uintptr(flags)) @@ -8166,18 +8138,13 @@ index 94f011238319..7ccf66b7ee0d 100644 + fd = int(r0) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) - } - return - } - --// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT ++ } ++ return ++} ++ +//go:nosplit +func get_EpollCreate1Addr() *(func(flags int) (fd int, err error)) - --func Fstatvfs(fd int, stat *Statvfs_t) (err error) { -- _, _, e1 := syscall_syscall(SYS_FSTATVFS, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) -- if e1 != 0 { -- err = errnoErr(e1) ++ +var EpollCreate1 = enter_EpollCreate1 + +func enter_EpollCreate1(flags int) (fd int, err error) { @@ -8186,40 +8153,31 @@ index 94f011238319..7ccf66b7ee0d 100644 + *funcref = impl_EpollCreate1 + } else { + *funcref = error_EpollCreate1 - } ++ } + return (*funcref)(flags) +} + +func error_EpollCreate1(flags int) (fd int, err error) { + fd = -1 + err = ENOSYS - return - } - - // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - --func Fsync(fd int) (err error) { -- _, _, e1 := syscall_syscall(SYS_FSYNC, uintptr(fd), 0, 0) -- if e1 != 0 { -- err = errnoErr(e1) ++ return ++} ++ ++// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT ++ +func impl_EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_EPOLL_CTL<<4, uintptr(epfd), uintptr(op), uintptr(fd), uintptr(unsafe.Pointer(event))) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) - } - return - } - --// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT ++ } ++ return ++} ++ +//go:nosplit +func get_EpollCtlAddr() *(func(epfd int, op int, fd int, event *EpollEvent) (err error)) - --func Ftruncate(fd int, length int64) (err error) { -- _, _, e1 := syscall_syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0) -- if e1 != 0 { -- err = errnoErr(e1) ++ +var EpollCtl = enter_EpollCtl + +func enter_EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) { @@ -8228,111 +8186,77 @@ index 94f011238319..7ccf66b7ee0d 100644 + *funcref = impl_EpollCtl + } else { + *funcref = error_EpollCtl - } -- return ++ } + return (*funcref)(epfd, op, fd, event) - } - --// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -- --func Getpagesize() (pgsize int) { -- r0, _, _ := syscall_syscall(SYS_GETPAGESIZE, 0, 0, 0) -- pgsize = int(r0) ++} ++ +func error_EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) { + err = ENOSYS - return - } - - // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - --func Mprotect(b []byte, prot int) (err error) { ++ return ++} ++ ++// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT ++ +func impl_EpollPwait(epfd int, events []EpollEvent, msec int, sigmask *int) (n int, err error) { - var _p0 unsafe.Pointer -- if len(b) > 0 { -- _p0 = unsafe.Pointer(&b[0]) ++ var _p0 unsafe.Pointer + if len(events) > 0 { + _p0 = unsafe.Pointer(&events[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } -- _, _, e1 := syscall_syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot)) -- if e1 != 0 { -- err = errnoErr(e1) ++ } else { ++ _p0 = unsafe.Pointer(&_zero) ++ } + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_EPOLL_PWAIT<<4, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), uintptr(unsafe.Pointer(sigmask))) + runtime.ExitSyscall() + n = int(r0) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) - } - return - } - --// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT ++ } ++ return ++} ++ +//go:nosplit +func get_EpollPwaitAddr() *(func(epfd int, events []EpollEvent, msec int, sigmask *int) (n int, err error)) - --func Msync(b []byte, flags int) (err error) { -- var _p0 unsafe.Pointer -- if len(b) > 0 { -- _p0 = unsafe.Pointer(&b[0]) ++ +var EpollPwait = enter_EpollPwait + +func enter_EpollPwait(epfd int, events []EpollEvent, msec int, sigmask *int) (n int, err error) { + funcref := get_EpollPwaitAddr() + if funcptrtest(GetZosLibVec()+SYS_EPOLL_PWAIT<<4, "") == 0 { + *funcref = impl_EpollPwait - } else { -- _p0 = unsafe.Pointer(&_zero) -- } -- _, _, e1 := syscall_syscall(SYS_MSYNC, uintptr(_p0), uintptr(len(b)), uintptr(flags)) -- if e1 != 0 { -- err = errnoErr(e1) ++ } else { + *funcref = error_EpollPwait - } ++ } + return (*funcref)(epfd, events, msec, sigmask) +} + +func error_EpollPwait(epfd int, events []EpollEvent, msec int, sigmask *int) (n int, err error) { + n = -1 + err = ENOSYS - return - } - - // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - --func Poll(fds []PollFd, timeout int) (n int, err error) { ++ return ++} ++ ++// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT ++ +func impl_EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { - var _p0 unsafe.Pointer -- if len(fds) > 0 { -- _p0 = unsafe.Pointer(&fds[0]) ++ var _p0 unsafe.Pointer + if len(events) > 0 { + _p0 = unsafe.Pointer(&events[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } -- r0, _, e1 := syscall_syscall(SYS_POLL, uintptr(_p0), uintptr(len(fds)), uintptr(timeout)) ++ } else { ++ _p0 = unsafe.Pointer(&_zero) ++ } + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_EPOLL_WAIT<<4, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec)) + runtime.ExitSyscall() - n = int(r0) -- if e1 != 0 { -- err = errnoErr(e1) ++ n = int(r0) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) - } - return - } - --// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT ++ } ++ return ++} ++ +//go:nosplit +func get_EpollWaitAddr() *(func(epfd int, events []EpollEvent, msec int) (n int, err error)) - --func Times(tms *Tms) (ticks uintptr, err error) { -- r0, _, e1 := syscall_syscall(SYS_TIMES, uintptr(unsafe.Pointer(tms)), 0, 0) -- ticks = uintptr(r0) -- if e1 != 0 { -- err = errnoErr(e1) ++ +var EpollWait = enter_EpollWait + +func enter_EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { @@ -8341,39 +8265,28 @@ index 94f011238319..7ccf66b7ee0d 100644 + *funcref = impl_EpollWait + } else { + *funcref = error_EpollWait - } ++ } + return (*funcref)(epfd, events, msec) +} + +func error_EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { + n = -1 + err = ENOSYS - return - } - - // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - --func W_Getmntent(buff *byte, size int) (lastsys int, err error) { -- r0, _, e1 := syscall_syscall(SYS_W_GETMNTENT, uintptr(unsafe.Pointer(buff)), uintptr(size), 0) -- lastsys = int(r0) -- if e1 != 0 { -- err = errnoErr(e1) -- } ++ return ++} ++ ++// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT ++ +func Errno2() (er2 int) { + runtime.EnterSyscall() + r0, _, _ := CallLeFuncWithErr(GetZosLibVec() + SYS___ERRNO2<<4) + runtime.ExitSyscall() + er2 = int(r0) - return - } - - // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - --func W_Getmntent_A(buff *byte, size int) (lastsys int, err error) { -- r0, _, e1 := syscall_syscall(SYS___W_GETMNTENT_A, uintptr(unsafe.Pointer(buff)), uintptr(size), 0) -- lastsys = int(r0) -- if e1 != 0 { -- err = errnoErr(e1) ++ return ++} ++ ++// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT ++ +func impl_Eventfd(initval uint, flags int) (fd int, err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_EVENTFD<<4, uintptr(initval), uintptr(flags)) @@ -8381,10 +8294,10 @@ index 94f011238319..7ccf66b7ee0d 100644 + fd = int(r0) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) - } - return - } - ++ } ++ return ++} ++ +//go:nosplit +func get_EventfdAddr() *(func(initval uint, flags int) (fd int, err error)) + @@ -8403,13 +8316,13 @@ index 94f011238319..7ccf66b7ee0d 100644 +func error_Eventfd(initval uint, flags int) (fd int, err error) { + fd = -1 + err = ENOSYS -+ return -+} -+ + return + } + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT --func mount_LE(path string, filesystem string, fstype string, mtm uint32, parmlen int32, parm string) (err error) { -+func Exit(code int) { + func Exit(code int) { +- syscall_syscall(SYS_EXIT, uintptr(code), 0, 0) + runtime.EnterSyscall() + CallLeFuncWithErr(GetZosLibVec()+SYS_EXIT<<4, uintptr(code)) + runtime.ExitSyscall() @@ -8419,43 +8332,23 @@ index 94f011238319..7ccf66b7ee0d 100644 +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func impl_Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } -- var _p1 *byte -- _p1, err = BytePtrFromString(filesystem) -- if err != nil { -- return -- } -- var _p2 *byte -- _p2, err = BytePtrFromString(fstype) -- if err != nil { -- return -- } -- var _p3 *byte -- _p3, err = BytePtrFromString(parm) -- if err != nil { -- return -- } -- _, _, e1 := syscall_syscall6(SYS___MOUNT_A, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(mtm), uintptr(parmlen), uintptr(unsafe.Pointer(_p3))) -- if e1 != 0 { -- err = errnoErr(e1) ++ var _p0 *byte ++ _p0, err = BytePtrFromString(path) ++ if err != nil { ++ return ++ } + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___FACCESSAT_A<<4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) - } - return - } - --// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT ++ } ++ return ++} ++ +//go:nosplit +func get_FaccessatAddr() *(func(dirfd int, path string, mode uint32, flags int) (err error)) - --func unmount(filesystem string, mtm int) (err error) { ++ +var Faccessat = enter_Faccessat + +func enter_Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { @@ -8470,45 +8363,47 @@ index 94f011238319..7ccf66b7ee0d 100644 + +func error_Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { + err = ENOSYS -+ return -+} -+ -+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -+ -+func Fchdir(fd int) (err error) { + return + } + + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + + func Fchdir(fd int) (err error) { +- _, _, e1 := syscall_syscall(SYS_FCHDIR, uintptr(fd), 0, 0) +- if e1 != 0 { +- err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FCHDIR<<4, uintptr(fd)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) -+ } -+ return -+} -+ -+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -+ -+func Fchmod(fd int, mode uint32) (err error) { + } + return + } +@@ -396,50 +1053,333 @@ func Fchdir(fd int) (err error) { + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + + func Fchmod(fd int, mode uint32) (err error) { +- _, _, e1 := syscall_syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0) +- if e1 != 0 { +- err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FCHMOD<<4, uintptr(fd), uintptr(mode)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) -+ } -+ return -+} -+ -+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -+ -+func impl_Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { - var _p0 *byte -- _p0, err = BytePtrFromString(filesystem) -+ _p0, err = BytePtrFromString(path) - if err != nil { - return } -- _, _, e1 := syscall_syscall(SYS___UMOUNT_A, uintptr(unsafe.Pointer(_p0)), uintptr(mtm), 0) -- if e1 != 0 { -- err = errnoErr(e1) + return + } + + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + ++func impl_Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { ++ var _p0 *byte ++ _p0, err = BytePtrFromString(path) ++ if err != nil { ++ return ++ } + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___FCHMODAT_A<<4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags)) + runtime.ExitSyscall() @@ -8540,7 +8435,10 @@ index 94f011238319..7ccf66b7ee0d 100644 + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + -+func Fchown(fd int, uid int, gid int) (err error) { + func Fchown(fd int, uid int, gid int) (err error) { +- _, _, e1 := syscall_syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid)) +- if e1 != 0 { +- err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FCHOWN<<4, uintptr(fd), uintptr(uid), uintptr(gid)) + runtime.ExitSyscall() @@ -8552,16 +8450,12 @@ index 94f011238319..7ccf66b7ee0d 100644 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT --func Chroot(path string) (err error) { +func impl_Fchownat(fd int, path string, uid int, gid int, flags int) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } -- _, _, e1 := syscall_syscall(SYS___CHROOT_A, uintptr(unsafe.Pointer(_p0)), 0, 0) -- if e1 != 0 { -- err = errnoErr(e1) ++ var _p0 *byte ++ _p0, err = BytePtrFromString(path) ++ if err != nil { ++ return ++ } + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___FCHOWNAT_A<<4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags)) + runtime.ExitSyscall() @@ -8582,26 +8476,25 @@ index 94f011238319..7ccf66b7ee0d 100644 + *funcref = impl_Fchownat + } else { + *funcref = error_Fchownat - } ++ } + return (*funcref)(fd, path, uid, gid, flags) +} + +func error_Fchownat(fd int, path string, uid int, gid int, flags int) (err error) { + err = ENOSYS - return - } - - // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - --func Uname(buf *Utsname) (err error) { -- _, _, e1 := syscall_rawsyscall(SYS___UNAME_A, uintptr(unsafe.Pointer(buf)), 0, 0) -- if e1 != 0 { -- err = errnoErr(e1) -+func FcntlInt(fd uintptr, cmd int, arg int) (retval int, err error) { ++ return ++} ++ ++// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT ++ + func FcntlInt(fd uintptr, cmd int, arg int) (retval int, err error) { +- r0, _, e1 := syscall_syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FCNTL<<4, uintptr(fd), uintptr(cmd), uintptr(arg)) + runtime.ExitSyscall() -+ retval = int(r0) + retval = int(r0) +- if e1 != 0 { +- err = errnoErr(e1) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } @@ -8610,7 +8503,6 @@ index 94f011238319..7ccf66b7ee0d 100644 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT --func Gethostname(buf []byte) (err error) { +func impl_Fdatasync(fd int) (err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FDATASYNC<<4, uintptr(fd)) @@ -8643,18 +8535,21 @@ index 94f011238319..7ccf66b7ee0d 100644 + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + -+func fstat(fd int, stat *Stat_LE_t) (err error) { + func fstat(fd int, stat *Stat_LE_t) (err error) { +- _, _, e1 := syscall_syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) +- if e1 != 0 { +- err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FSTAT<<4, uintptr(fd), uintptr(unsafe.Pointer(stat))) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) -+ } -+ return -+} -+ -+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -+ + } + return + } + + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func impl_fstatat(dirfd int, path string, stat *Stat_LE_t, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) @@ -8822,44 +8717,27 @@ index 94f011238319..7ccf66b7ee0d 100644 + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + -+func Fstatvfs(fd int, stat *Statvfs_t) (err error) { + func Fstatvfs(fd int, stat *Statvfs_t) (err error) { +- _, _, e1 := syscall_syscall(SYS_FSTATVFS, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) +- if e1 != 0 { +- err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FSTATVFS<<4, uintptr(fd), uintptr(unsafe.Pointer(stat))) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) -+ } -+ return -+} -+ -+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -+ -+func Fsync(fd int) (err error) { -+ runtime.EnterSyscall() -+ r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FSYNC<<4, uintptr(fd)) -+ runtime.ExitSyscall() -+ if int64(r0) == -1 { -+ err = errnoErr2(e1, e2) -+ } -+ return -+} -+ -+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -+ -+func impl_Futimes(fd int, tv []Timeval) (err error) { - var _p0 unsafe.Pointer -- if len(buf) > 0 { -- _p0 = unsafe.Pointer(&buf[0]) -+ if len(tv) > 0 { -+ _p0 = unsafe.Pointer(&tv[0]) - } else { - _p0 = unsafe.Pointer(&_zero) } -- _, _, e1 := syscall_syscall(SYS___GETHOSTNAME_A, uintptr(_p0), uintptr(len(buf)), 0) + return + } +@@ -447,28 +1387,461 @@ func Fstatvfs(fd int, stat *Statvfs_t) (err error) { + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + + func Fsync(fd int) (err error) { +- _, _, e1 := syscall_syscall(SYS_FSYNC, uintptr(fd), 0, 0) - if e1 != 0 { - err = errnoErr(e1) + runtime.EnterSyscall() -+ r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FUTIMES<<4, uintptr(fd), uintptr(_p0), uintptr(len(tv))) ++ r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FSYNC<<4, uintptr(fd)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) @@ -8867,13 +8745,27 @@ index 94f011238319..7ccf66b7ee0d 100644 return } --// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + ++func impl_Futimes(fd int, tv []Timeval) (err error) { ++ var _p0 unsafe.Pointer ++ if len(tv) > 0 { ++ _p0 = unsafe.Pointer(&tv[0]) ++ } else { ++ _p0 = unsafe.Pointer(&_zero) ++ } ++ runtime.EnterSyscall() ++ r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FUTIMES<<4, uintptr(fd), uintptr(_p0), uintptr(len(tv))) ++ runtime.ExitSyscall() ++ if int64(r0) == -1 { ++ err = errnoErr2(e1, e2) ++ } ++ return ++} ++ +//go:nosplit +func get_FutimesAddr() *(func(fd int, tv []Timeval) (err error)) - --func Getegid() (egid int) { -- r0, _, _ := syscall_rawsyscall(SYS_GETEGID, 0, 0, 0) -- egid = int(r0) ++ +var Futimes = enter_Futimes + +func enter_Futimes(fd int, tv []Timeval) (err error) { @@ -8888,14 +8780,11 @@ index 94f011238319..7ccf66b7ee0d 100644 + +func error_Futimes(fd int, tv []Timeval) (err error) { + err = ENOSYS - return - } - - // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - --func Geteuid() (uid int) { -- r0, _, _ := syscall_rawsyscall(SYS_GETEUID, 0, 0, 0) -- uid = int(r0) ++ return ++} ++ ++// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT ++ +func impl_Futimesat(dirfd int, path string, tv []Timeval) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) @@ -8934,29 +8823,29 @@ index 94f011238319..7ccf66b7ee0d 100644 + +func error_Futimesat(dirfd int, path string, tv []Timeval) (err error) { + err = ENOSYS - return - } - - // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - --func Getgid() (gid int) { -- r0, _, _ := syscall_rawsyscall(SYS_GETGID, 0, 0, 0) -- gid = int(r0) -+func Ftruncate(fd int, length int64) (err error) { ++ return ++} ++ ++// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT ++ + func Ftruncate(fd int, length int64) (err error) { +- _, _, e1 := syscall_syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0) +- if e1 != 0 { +- err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_FTRUNCATE<<4, uintptr(fd), uintptr(length)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) -+ } + } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT --func Getpid() (pid int) { -- r0, _, _ := syscall_rawsyscall(SYS_GETPID, 0, 0, 0) -- pid = int(r0) +-func Getpagesize() (pgsize int) { +- r0, _, _ := syscall_syscall(SYS_GETPAGESIZE, 0, 0, 0) +- pgsize = int(r0) +func impl_Getrandom(buf []byte, flags int) (n int, err error) { + var _p0 unsafe.Pointer + if len(buf) > 0 { @@ -8992,16 +8881,11 @@ index 94f011238319..7ccf66b7ee0d 100644 +func error_Getrandom(buf []byte, flags int) (n int, err error) { + n = -1 + err = ENOSYS - return - } - - // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - --func Getpgid(pid int) (pgid int, err error) { -- r0, _, e1 := syscall_rawsyscall(SYS_GETPGID, uintptr(pid), 0, 0) -- pgid = int(r0) -- if e1 != 0 { -- err = errnoErr(e1) ++ return ++} ++ ++// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT ++ +func impl_InotifyInit() (fd int, err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec() + SYS_INOTIFY_INIT<<4) @@ -9024,21 +8908,18 @@ index 94f011238319..7ccf66b7ee0d 100644 + *funcref = impl_InotifyInit + } else { + *funcref = error_InotifyInit - } ++ } + return (*funcref)() +} + +func error_InotifyInit() (fd int, err error) { + fd = -1 + err = ENOSYS - return - } - - // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - --func Getppid() (pid int) { -- r0, _, _ := syscall_rawsyscall(SYS_GETPPID, 0, 0, 0) -- pid = int(r0) ++ return ++} ++ ++// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT ++ +func impl_InotifyInit1(flags int) (fd int, err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_INOTIFY_INIT1<<4, uintptr(flags)) @@ -9316,36 +9197,31 @@ index 94f011238319..7ccf66b7ee0d 100644 + +func error_Lutimes(path string, tv []Timeval) (err error) { + err = ENOSYS -+ return -+} -+ -+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -+ -+func Mprotect(b []byte, prot int) (err error) { -+ var _p0 unsafe.Pointer -+ if len(b) > 0 { -+ _p0 = unsafe.Pointer(&b[0]) -+ } else { -+ _p0 = unsafe.Pointer(&_zero) -+ } + return + } + +@@ -481,9 +1854,11 @@ func Mprotect(b []byte, prot int) (err error) { + } else { + _p0 = unsafe.Pointer(&_zero) + } +- _, _, e1 := syscall_syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot)) +- if e1 != 0 { +- err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_MPROTECT<<4, uintptr(_p0), uintptr(len(b)), uintptr(prot)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) -+ } -+ return -+} -+ -+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -+ -+func Msync(b []byte, flags int) (err error) { -+ var _p0 unsafe.Pointer -+ if len(b) > 0 { -+ _p0 = unsafe.Pointer(&b[0]) -+ } else { -+ _p0 = unsafe.Pointer(&_zero) -+ } + } + return + } +@@ -497,9 +1872,23 @@ func Msync(b []byte, flags int) (err error) { + } else { + _p0 = unsafe.Pointer(&_zero) + } +- _, _, e1 := syscall_syscall(SYS_MSYNC, uintptr(_p0), uintptr(len(b)), uintptr(flags)) +- if e1 != 0 { +- err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_MSYNC<<4, uintptr(_p0), uintptr(len(b)), uintptr(flags)) + runtime.ExitSyscall() @@ -9363,31 +9239,28 @@ index 94f011238319..7ccf66b7ee0d 100644 + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) -+ } -+ return -+} -+ -+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -+ -+func Poll(fds []PollFd, timeout int) (n int, err error) { -+ var _p0 unsafe.Pointer -+ if len(fds) > 0 { -+ _p0 = unsafe.Pointer(&fds[0]) -+ } else { -+ _p0 = unsafe.Pointer(&_zero) -+ } + } + return + } +@@ -513,21 +1902,106 @@ func Poll(fds []PollFd, timeout int) (n int, err error) { + } else { + _p0 = unsafe.Pointer(&_zero) + } +- r0, _, e1 := syscall_syscall(SYS_POLL, uintptr(_p0), uintptr(len(fds)), uintptr(timeout)) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_POLL<<4, uintptr(_p0), uintptr(len(fds)), uintptr(timeout)) + runtime.ExitSyscall() -+ n = int(r0) + n = int(r0) +- if e1 != 0 { +- err = errnoErr(e1) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) -+ } -+ return -+} -+ -+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -+ + } + return + } + + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Readdir_r(dirp uintptr, entry *direntLE, result **direntLE) (err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___READDIR_R_A<<4, uintptr(dirp), uintptr(unsafe.Pointer(entry)), uintptr(unsafe.Pointer(result))) @@ -9469,100 +9342,94 @@ index 94f011238319..7ccf66b7ee0d 100644 + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + -+func Times(tms *Tms) (ticks uintptr, err error) { + func Times(tms *Tms) (ticks uintptr, err error) { +- r0, _, e1 := syscall_syscall(SYS_TIMES, uintptr(unsafe.Pointer(tms)), 0, 0) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_TIMES<<4, uintptr(unsafe.Pointer(tms))) + runtime.ExitSyscall() -+ ticks = uintptr(r0) + ticks = uintptr(r0) +- if e1 != 0 { +- err = errnoErr(e1) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) -+ } -+ return -+} -+ -+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -+ -+func W_Getmntent(buff *byte, size int) (lastsys int, err error) { + } + return + } +@@ -535,10 +2009,12 @@ func Times(tms *Tms) (ticks uintptr, err error) { + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + + func W_Getmntent(buff *byte, size int) (lastsys int, err error) { +- r0, _, e1 := syscall_syscall(SYS_W_GETMNTENT, uintptr(unsafe.Pointer(buff)), uintptr(size), 0) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_W_GETMNTENT<<4, uintptr(unsafe.Pointer(buff)), uintptr(size)) + runtime.ExitSyscall() -+ lastsys = int(r0) + lastsys = int(r0) +- if e1 != 0 { +- err = errnoErr(e1) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) -+ } -+ return -+} -+ -+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -+ -+func W_Getmntent_A(buff *byte, size int) (lastsys int, err error) { + } + return + } +@@ -546,10 +2022,12 @@ func W_Getmntent(buff *byte, size int) (lastsys int, err error) { + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + + func W_Getmntent_A(buff *byte, size int) (lastsys int, err error) { +- r0, _, e1 := syscall_syscall(SYS___W_GETMNTENT_A, uintptr(unsafe.Pointer(buff)), uintptr(size), 0) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___W_GETMNTENT_A<<4, uintptr(unsafe.Pointer(buff)), uintptr(size)) + runtime.ExitSyscall() -+ lastsys = int(r0) + lastsys = int(r0) +- if e1 != 0 { +- err = errnoErr(e1) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) -+ } -+ return -+} -+ -+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -+ -+func mount_LE(path string, filesystem string, fstype string, mtm uint32, parmlen int32, parm string) (err error) { -+ var _p0 *byte -+ _p0, err = BytePtrFromString(path) -+ if err != nil { -+ return -+ } -+ var _p1 *byte -+ _p1, err = BytePtrFromString(filesystem) -+ if err != nil { -+ return -+ } -+ var _p2 *byte -+ _p2, err = BytePtrFromString(fstype) -+ if err != nil { -+ return -+ } -+ var _p3 *byte -+ _p3, err = BytePtrFromString(parm) -+ if err != nil { -+ return -+ } + } + return + } +@@ -577,24 +2055,28 @@ func mount_LE(path string, filesystem string, fstype string, mtm uint32, parmlen + if err != nil { + return + } +- _, _, e1 := syscall_syscall6(SYS___MOUNT_A, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(mtm), uintptr(parmlen), uintptr(unsafe.Pointer(_p3))) +- if e1 != 0 { +- err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___MOUNT_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(mtm), uintptr(parmlen), uintptr(unsafe.Pointer(_p3))) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) -+ } -+ return -+} -+ -+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -+ + } + return + } + + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +-func unmount(filesystem string, mtm int) (err error) { +func unmount_LE(filesystem string, mtm int) (err error) { -+ var _p0 *byte -+ _p0, err = BytePtrFromString(filesystem) -+ if err != nil { -+ return -+ } + var _p0 *byte + _p0, err = BytePtrFromString(filesystem) + if err != nil { + return + } +- _, _, e1 := syscall_syscall(SYS___UMOUNT_A, uintptr(unsafe.Pointer(_p0)), uintptr(mtm), 0) +- if e1 != 0 { +- err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___UMOUNT_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(mtm)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) -+ } -+ return -+} -+ -+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -+ -+func Chroot(path string) (err error) { -+ var _p0 *byte -+ _p0, err = BytePtrFromString(path) -+ if err != nil { -+ return -+ } + } + return + } +@@ -607,9 +2089,24 @@ func Chroot(path string) (err error) { + if err != nil { + return + } +- _, _, e1 := syscall_syscall(SYS___CHROOT_A, uintptr(unsafe.Pointer(_p0)), 0, 0) +- if e1 != 0 { +- err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___CHROOT_A<<4, uintptr(unsafe.Pointer(_p0))) + runtime.ExitSyscall() @@ -9581,22 +9448,25 @@ index 94f011238319..7ccf66b7ee0d 100644 + ret = int(r0) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) -+ } -+ return -+} -+ -+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -+ -+func Uname(buf *Utsname) (err error) { + } + return + } +@@ -617,15 +2114,47 @@ func Chroot(path string) (err error) { + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + + func Uname(buf *Utsname) (err error) { +- _, _, e1 := syscall_rawsyscall(SYS___UNAME_A, uintptr(unsafe.Pointer(buf)), 0, 0) +- if e1 != 0 { +- err = errnoErr(e1) + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_____OSNAME_A<<4, uintptr(unsafe.Pointer(buf))) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) -+ } -+ return -+} -+ -+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -+ + } + return + } + + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func impl_Unshare(flags int) (err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_UNSHARE<<4, uintptr(flags)) @@ -9629,92 +9499,126 @@ index 94f011238319..7ccf66b7ee0d 100644 + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + -+func Gethostname(buf []byte) (err error) { -+ var _p0 unsafe.Pointer -+ if len(buf) > 0 { -+ _p0 = unsafe.Pointer(&buf[0]) -+ } else { -+ _p0 = unsafe.Pointer(&_zero) -+ } + func Gethostname(buf []byte) (err error) { + var _p0 unsafe.Pointer + if len(buf) > 0 { +@@ -633,33 +2162,19 @@ func Gethostname(buf []byte) (err error) { + } else { + _p0 = unsafe.Pointer(&_zero) + } +- _, _, e1 := syscall_syscall(SYS___GETHOSTNAME_A, uintptr(_p0), uintptr(len(buf)), 0) +- if e1 != 0 { +- err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___GETHOSTNAME_A<<4, uintptr(_p0), uintptr(len(buf))) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) -+ } -+ return -+} -+ -+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -+ -+func Getgid() (gid int) { + } + return + } + + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +-func Getegid() (egid int) { +- r0, _, _ := syscall_rawsyscall(SYS_GETEGID, 0, 0, 0) +- egid = int(r0) +- return +-} +- +-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +- +-func Geteuid() (uid int) { +- r0, _, _ := syscall_rawsyscall(SYS_GETEUID, 0, 0, 0) +- uid = int(r0) +- return +-} +- +-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +- + func Getgid() (gid int) { +- r0, _, _ := syscall_rawsyscall(SYS_GETGID, 0, 0, 0) + r0, _, _ := CallLeFuncWithErr(GetZosLibVec() + SYS_GETGID<<4) -+ gid = int(r0) -+ return -+} -+ -+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -+ -+func Getpid() (pid int) { + gid = int(r0) + return + } +@@ -667,7 +2182,7 @@ func Getgid() (gid int) { + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + + func Getpid() (pid int) { +- r0, _, _ := syscall_rawsyscall(SYS_GETPID, 0, 0, 0) + r0, _, _ := CallLeFuncWithErr(GetZosLibVec() + SYS_GETPID<<4) -+ pid = int(r0) -+ return -+} -+ -+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -+ -+func Getpgid(pid int) (pgid int, err error) { + pid = int(r0) + return + } +@@ -675,10 +2190,10 @@ func Getpid() (pid int) { + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + + func Getpgid(pid int) (pgid int, err error) { +- r0, _, e1 := syscall_rawsyscall(SYS_GETPGID, uintptr(pid), 0, 0) + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_GETPGID<<4, uintptr(pid)) -+ pgid = int(r0) + pgid = int(r0) +- if e1 != 0 { +- err = errnoErr(e1) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) -+ } -+ return -+} -+ -+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -+ -+func Getppid() (pid int) { + } + return + } +@@ -686,7 +2201,7 @@ func Getpgid(pid int) (pgid int, err error) { + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + + func Getppid() (pid int) { +- r0, _, _ := syscall_rawsyscall(SYS_GETPPID, 0, 0, 0) + r0, _, _ := CallLeFuncWithErr(GetZosLibVec() + SYS_GETPPID<<4) -+ pid = int(r0) -+ return -+} -+ -+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -+ -+func Getpriority(which int, who int) (prio int, err error) { + pid = int(r0) + return + } +@@ -694,10 +2209,12 @@ func Getppid() (pid int) { + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + + func Getpriority(which int, who int) (prio int, err error) { +- r0, _, e1 := syscall_syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_GETPRIORITY<<4, uintptr(which), uintptr(who)) + runtime.ExitSyscall() -+ prio = int(r0) + prio = int(r0) +- if e1 != 0 { +- err = errnoErr(e1) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) -+ } -+ return -+} -+ -+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -+ -+func Getrlimit(resource int, rlim *Rlimit) (err error) { + } + return + } +@@ -705,9 +2222,9 @@ func Getpriority(which int, who int) (prio int, err error) { + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + + func Getrlimit(resource int, rlim *Rlimit) (err error) { +- _, _, e1 := syscall_rawsyscall(SYS_GETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) +- if e1 != 0 { +- err = errnoErr(e1) + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_GETRLIMIT<<4, uintptr(resource), uintptr(unsafe.Pointer(rlim))) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) -+ } -+ return -+} -+ -+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -+ -+func getrusage(who int, rusage *rusage_zos) (err error) { + } + return + } +@@ -715,20 +2232,40 @@ func Getrlimit(resource int, rlim *Rlimit) (err error) { + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + + func getrusage(who int, rusage *rusage_zos) (err error) { +- _, _, e1 := syscall_rawsyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) +- if e1 != 0 { +- err = errnoErr(e1) + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_GETRUSAGE<<4, uintptr(who), uintptr(unsafe.Pointer(rusage))) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) -+ } -+ return -+} -+ -+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -+ + } + return + } + + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getegid() (egid int) { + runtime.EnterSyscall() + r0, _, _ := CallLeFuncWithErr(GetZosLibVec() + SYS_GETEGID<<4) @@ -9735,74 +9639,72 @@ index 94f011238319..7ccf66b7ee0d 100644 + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + -+func Getsid(pid int) (sid int, err error) { + func Getsid(pid int) (sid int, err error) { +- r0, _, e1 := syscall_rawsyscall(SYS_GETSID, uintptr(pid), 0, 0) + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_GETSID<<4, uintptr(pid)) -+ sid = int(r0) + sid = int(r0) +- if e1 != 0 { +- err = errnoErr(e1) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) -+ } -+ return -+} -+ -+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -+ -+func Getuid() (uid int) { + } + return + } +@@ -736,7 +2273,7 @@ func Getsid(pid int) (sid int, err error) { + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + + func Getuid() (uid int) { +- r0, _, _ := syscall_rawsyscall(SYS_GETUID, 0, 0, 0) + r0, _, _ := CallLeFuncWithErr(GetZosLibVec() + SYS_GETUID<<4) -+ uid = int(r0) -+ return -+} -+ -+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -+ -+func Kill(pid int, sig Signal) (err error) { + uid = int(r0) + return + } +@@ -744,9 +2281,9 @@ func Getuid() (uid int) { + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + + func Kill(pid int, sig Signal) (err error) { +- _, _, e1 := syscall_rawsyscall(SYS_KILL, uintptr(pid), uintptr(sig), 0) +- if e1 != 0 { +- err = errnoErr(e1) + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_KILL<<4, uintptr(pid), uintptr(sig)) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) -+ } -+ return -+} -+ -+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -+ -+func Lchown(path string, uid int, gid int) (err error) { -+ var _p0 *byte -+ _p0, err = BytePtrFromString(path) -+ if err != nil { -+ return -+ } + } + return + } +@@ -759,9 +2296,11 @@ func Lchown(path string, uid int, gid int) (err error) { + if err != nil { + return + } +- _, _, e1 := syscall_syscall(SYS___LCHOWN_A, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) +- if e1 != 0 { +- err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___LCHOWN_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) -+ } -+ return -+} -+ -+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -+ -+func Link(path string, link string) (err error) { -+ var _p0 *byte -+ _p0, err = BytePtrFromString(path) -+ if err != nil { -+ return -+ } -+ var _p1 *byte -+ _p1, err = BytePtrFromString(link) -+ if err != nil { -+ return -+ } + } + return + } +@@ -779,19 +2318,65 @@ func Link(path string, link string) (err error) { + if err != nil { + return + } +- _, _, e1 := syscall_syscall(SYS___LINK_A, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) +- if e1 != 0 { +- err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___LINK_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1))) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) -+ } -+ return -+} -+ -+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -+ + } + return + } + + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func impl_Linkat(oldDirFd int, oldPath string, newDirFd int, newPath string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(oldPath) @@ -9845,52 +9747,51 @@ index 94f011238319..7ccf66b7ee0d 100644 + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + -+func Listen(s int, n int) (err error) { + func Listen(s int, n int) (err error) { +- _, _, e1 := syscall_syscall(SYS_LISTEN, uintptr(s), uintptr(n), 0) +- if e1 != 0 { +- err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_LISTEN<<4, uintptr(s), uintptr(n)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) -+ } -+ return -+} -+ -+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -+ -+func lstat(path string, stat *Stat_LE_t) (err error) { -+ var _p0 *byte -+ _p0, err = BytePtrFromString(path) -+ if err != nil { -+ return -+ } + } + return + } +@@ -804,9 +2389,11 @@ func lstat(path string, stat *Stat_LE_t) (err error) { + if err != nil { + return + } +- _, _, e1 := syscall_syscall(SYS___LSTAT_A, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) +- if e1 != 0 { +- err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___LSTAT_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat))) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) -+ } -+ return -+} -+ -+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -+ -+func Mkdir(path string, mode uint32) (err error) { -+ var _p0 *byte -+ _p0, err = BytePtrFromString(path) -+ if err != nil { -+ return -+ } + } + return + } +@@ -819,24 +2406,65 @@ func Mkdir(path string, mode uint32) (err error) { + if err != nil { + return + } +- _, _, e1 := syscall_syscall(SYS___MKDIR_A, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) +- if e1 != 0 { +- err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___MKDIR_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(mode)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) -+ } -+ return -+} -+ -+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -+ + } + return + } + + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func impl_Mkdirat(dirfd int, path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) @@ -9928,40 +9829,41 @@ index 94f011238319..7ccf66b7ee0d 100644 + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + -+func Mkfifo(path string, mode uint32) (err error) { -+ var _p0 *byte -+ _p0, err = BytePtrFromString(path) -+ if err != nil { -+ return -+ } + func Mkfifo(path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } +- _, _, e1 := syscall_syscall(SYS___MKFIFO_A, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) +- if e1 != 0 { +- err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___MKFIFO_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(mode)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) -+ } -+ return -+} -+ -+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -+ -+func Mknod(path string, mode uint32, dev int) (err error) { -+ var _p0 *byte -+ _p0, err = BytePtrFromString(path) -+ if err != nil { -+ return -+ } + } + return + } +@@ -849,15 +2477,96 @@ func Mknod(path string, mode uint32, dev int) (err error) { + if err != nil { + return + } +- _, _, e1 := syscall_syscall(SYS___MKNOD_A, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) +- if e1 != 0 { +- err = errnoErr(e1) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___MKNOD_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) -+ } -+ return -+} -+ -+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -+ + } + return + } + + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func impl_Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) @@ -10041,41 +9943,36 @@ index 94f011238319..7ccf66b7ee0d 100644 + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + -+func Pread(fd int, p []byte, offset int64) (n int, err error) { -+ var _p0 unsafe.Pointer -+ if len(p) > 0 { -+ _p0 = unsafe.Pointer(&p[0]) -+ } else { -+ _p0 = unsafe.Pointer(&_zero) -+ } + func Pread(fd int, p []byte, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(p) > 0 { +@@ -865,10 +2574,12 @@ func Pread(fd int, p []byte, offset int64) (n int, err error) { + } else { + _p0 = unsafe.Pointer(&_zero) + } +- r0, _, e1 := syscall_syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_PREAD<<4, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset)) + runtime.ExitSyscall() -+ n = int(r0) -+ if int64(r0) == -1 { -+ err = errnoErr2(e1, e2) -+ } - return - } - - // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - --func Getpriority(which int, who int) (prio int, err error) { -- r0, _, e1 := syscall_syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0) -- prio = int(r0) + n = int(r0) - if e1 != 0 { - err = errnoErr(e1) -+func Pwrite(fd int, p []byte, offset int64) (n int, err error) { -+ var _p0 unsafe.Pointer -+ if len(p) > 0 { -+ _p0 = unsafe.Pointer(&p[0]) -+ } else { -+ _p0 = unsafe.Pointer(&_zero) -+ } ++ if int64(r0) == -1 { ++ err = errnoErr2(e1, e2) + } + return + } +@@ -882,36 +2593,78 @@ func Pwrite(fd int, p []byte, offset int64) (n int, err error) { + } else { + _p0 = unsafe.Pointer(&_zero) + } +- r0, _, e1 := syscall_syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_PWRITE<<4, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset)) + runtime.ExitSyscall() -+ n = int(r0) + n = int(r0) +- if e1 != 0 { +- err = errnoErr(e1) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } @@ -10084,10 +9981,11 @@ index 94f011238319..7ccf66b7ee0d 100644 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT --func Getrlimit(resource int, rlim *Rlimit) (err error) { -- _, _, e1 := syscall_rawsyscall(SYS_GETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) -- if e1 != 0 { -- err = errnoErr(e1) +-func Readlink(path string, buf []byte) (n int, err error) { +- var _p0 *byte +- _p0, err = BytePtrFromString(path) +- if err != nil { +- return +func impl_Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___PRCTL_A<<4, uintptr(option), uintptr(arg2), uintptr(arg3), uintptr(arg4), uintptr(arg5)) @@ -10095,64 +9993,50 @@ index 94f011238319..7ccf66b7ee0d 100644 + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } - return - } - --// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +- var _p1 unsafe.Pointer +- if len(buf) > 0 { +- _p1 = unsafe.Pointer(&buf[0]) ++ return ++} ++ +//go:nosplit +func get_PrctlAddr() *(func(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error)) - --func getrusage(who int, rusage *rusage_zos) (err error) { -- _, _, e1 := syscall_rawsyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) -- if e1 != 0 { -- err = errnoErr(e1) ++ +var Prctl = enter_Prctl + +func enter_Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error) { + funcref := get_PrctlAddr() + if funcptrtest(GetZosLibVec()+SYS___PRCTL_A<<4, "") == 0 { + *funcref = impl_Prctl -+ } else { + } else { +- _p1 = unsafe.Pointer(&_zero) + *funcref = error_Prctl } -- return -+ return (*funcref)(option, arg2, arg3, arg4, arg5) - } - --// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -- --func Getsid(pid int) (sid int, err error) { -- r0, _, e1 := syscall_rawsyscall(SYS_GETSID, uintptr(pid), 0, 0) -- sid = int(r0) +- r0, _, e1 := syscall_syscall(SYS___READLINK_A, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) +- n = int(r0) - if e1 != 0 { - err = errnoErr(e1) -- } ++ return (*funcref)(option, arg2, arg3, arg4, arg5) ++} ++ +func error_Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error) { + err = ENOSYS - return - } - - // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - --func Getuid() (uid int) { -- r0, _, _ := syscall_rawsyscall(SYS_GETUID, 0, 0, 0) -- uid = int(r0) ++ return ++} ++ ++// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT ++ +func impl_Prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) { + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_PRLIMIT<<4, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(newlimit)), uintptr(unsafe.Pointer(old))) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) -+ } + } return } --// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +//go:nosplit +func get_PrlimitAddr() *(func(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error)) - --func Kill(pid int, sig Signal) (err error) { -- _, _, e1 := syscall_rawsyscall(SYS_KILL, uintptr(pid), uintptr(sig), 0) -- if e1 != 0 { -- err = errnoErr(e1) ++ +var Prlimit = enter_Prlimit + +func enter_Prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) { @@ -10161,31 +10045,23 @@ index 94f011238319..7ccf66b7ee0d 100644 + *funcref = impl_Prlimit + } else { + *funcref = error_Prlimit - } ++ } + return (*funcref)(pid, resource, newlimit, old) +} + +func error_Prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) { + err = ENOSYS - return - } - ++ return ++} ++ // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT --func Lchown(path string, uid int, gid int) (err error) { -+func Rename(from string, to string) (err error) { - var _p0 *byte -- _p0, err = BytePtrFromString(path) -+ _p0, err = BytePtrFromString(from) -+ if err != nil { -+ return -+ } -+ var _p1 *byte -+ _p1, err = BytePtrFromString(to) + func Rename(from string, to string) (err error) { +@@ -925,24 +2678,112 @@ func Rename(from string, to string) (err error) { if err != nil { return } -- _, _, e1 := syscall_syscall(SYS___LCHOWN_A, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) +- _, _, e1 := syscall_syscall(SYS___RENAME_A, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - if e1 != 0 { - err = errnoErr(e1) + runtime.EnterSyscall() @@ -10199,40 +10075,29 @@ index 94f011238319..7ccf66b7ee0d 100644 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT --func Link(path string, link string) (err error) { +func impl_Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) { - var _p0 *byte -- _p0, err = BytePtrFromString(path) ++ var _p0 *byte + _p0, err = BytePtrFromString(oldpath) - if err != nil { - return - } - var _p1 *byte -- _p1, err = BytePtrFromString(link) ++ if err != nil { ++ return ++ } ++ var _p1 *byte + _p1, err = BytePtrFromString(newpath) - if err != nil { - return - } -- _, _, e1 := syscall_syscall(SYS___LINK_A, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) -- if e1 != 0 { -- err = errnoErr(e1) ++ if err != nil { ++ return ++ } + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___RENAMEAT_A<<4, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) - } - return - } - --// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT ++ } ++ return ++} ++ +//go:nosplit +func get_RenameatAddr() *(func(olddirfd int, oldpath string, newdirfd int, newpath string) (err error)) - --func Listen(s int, n int) (err error) { -- _, _, e1 := syscall_syscall(SYS_LISTEN, uintptr(s), uintptr(n), 0) -- if e1 != 0 { -- err = errnoErr(e1) ++ +var Renameat = enter_Renameat + +func enter_Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) { @@ -10241,55 +10106,40 @@ index 94f011238319..7ccf66b7ee0d 100644 + *funcref = impl_Renameat + } else { + *funcref = error_Renameat - } ++ } + return (*funcref)(olddirfd, oldpath, newdirfd, newpath) +} + +func error_Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) { + err = ENOSYS - return - } - - // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - --func lstat(path string, stat *Stat_LE_t) (err error) { ++ return ++} ++ ++// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT ++ +func impl_Renameat2(olddirfd int, oldpath string, newdirfd int, newpath string, flags uint) (err error) { - var _p0 *byte -- _p0, err = BytePtrFromString(path) ++ var _p0 *byte + _p0, err = BytePtrFromString(oldpath) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(newpath) - if err != nil { - return - } -- _, _, e1 := syscall_syscall(SYS___LSTAT_A, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) -- if e1 != 0 { -- err = errnoErr(e1) ++ if err != nil { ++ return ++ } + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___RENAMEAT2_A<<4, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) - } - return - } - --// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT ++ } ++ return ++} ++ +//go:nosplit +func get_Renameat2Addr() *(func(olddirfd int, oldpath string, newdirfd int, newpath string, flags uint) (err error)) - --func Mkdir(path string, mode uint32) (err error) { -- var _p0 *byte -- _p0, err = BytePtrFromString(path) -- if err != nil { -- return -- } -- _, _, e1 := syscall_syscall(SYS___MKDIR_A, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) -- if e1 != 0 { -- err = errnoErr(e1) ++ +var Renameat2 = enter_Renameat2 + +func enter_Renameat2(olddirfd int, oldpath string, newdirfd int, newpath string, flags uint) (err error) { @@ -10298,25 +10148,24 @@ index 94f011238319..7ccf66b7ee0d 100644 + *funcref = impl_Renameat2 + } else { + *funcref = error_Renameat2 - } ++ } + return (*funcref)(olddirfd, oldpath, newdirfd, newpath, flags) +} + +func error_Renameat2(olddirfd int, oldpath string, newdirfd int, newpath string, flags uint) (err error) { + err = ENOSYS - return - } - - // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - --func Mkfifo(path string, mode uint32) (err error) { -+func Rmdir(path string) (err error) { ++ return ++} ++ ++// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT ++ + func Rmdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } -- _, _, e1 := syscall_syscall(SYS___MKFIFO_A, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) +- _, _, e1 := syscall_syscall(SYS___RMDIR_A, uintptr(unsafe.Pointer(_p0)), 0, 0) - if e1 != 0 { - err = errnoErr(e1) + runtime.EnterSyscall() @@ -10327,23 +10176,17 @@ index 94f011238319..7ccf66b7ee0d 100644 } return } - +@@ -950,20 +2791,118 @@ func Rmdir(path string) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT --func Mknod(path string, mode uint32, dev int) (err error) { -- var _p0 *byte -- _p0, err = BytePtrFromString(path) -- if err != nil { -- return -- } -- _, _, e1 := syscall_syscall(SYS___MKNOD_A, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) -- if e1 != 0 { -- err = errnoErr(e1) -+func Seek(fd int, offset int64, whence int) (off int64, err error) { + func Seek(fd int, offset int64, whence int) (off int64, err error) { +- r0, _, e1 := syscall_syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence)) + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_LSEEK<<4, uintptr(fd), uintptr(offset), uintptr(whence)) + runtime.ExitSyscall() -+ off = int64(r0) + off = int64(r0) +- if e1 != 0 { +- err = errnoErr(e1) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) } @@ -10352,23 +10195,13 @@ index 94f011238319..7ccf66b7ee0d 100644 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT --func Pread(fd int, p []byte, offset int64) (n int, err error) { -- var _p0 unsafe.Pointer -- if len(p) > 0 { -- _p0 = unsafe.Pointer(&p[0]) -- } else { -- _p0 = unsafe.Pointer(&_zero) +func Setegid(egid int) (err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SETEGID<<4, uintptr(egid)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) - } -- r0, _, e1 := syscall_syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) -- n = int(r0) -- if e1 != 0 { -- err = errnoErr(e1) ++ } + return +} + @@ -10380,117 +10213,63 @@ index 94f011238319..7ccf66b7ee0d 100644 + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) - } - return - } - - // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - --func Pwrite(fd int, p []byte, offset int64) (n int, err error) { ++ } ++ return ++} ++ ++// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT ++ +func impl_Sethostname(p []byte) (err error) { - var _p0 unsafe.Pointer - if len(p) > 0 { - _p0 = unsafe.Pointer(&p[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } -- r0, _, e1 := syscall_syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) -- n = int(r0) -- if e1 != 0 { -- err = errnoErr(e1) ++ var _p0 unsafe.Pointer ++ if len(p) > 0 { ++ _p0 = unsafe.Pointer(&p[0]) ++ } else { ++ _p0 = unsafe.Pointer(&_zero) ++ } + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___SETHOSTNAME_A<<4, uintptr(_p0), uintptr(len(p))) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) - } - return - } - --// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT ++ } ++ return ++} ++ +//go:nosplit +func get_SethostnameAddr() *(func(p []byte) (err error)) - --func Readlink(path string, buf []byte) (n int, err error) { -- var _p0 *byte -- _p0, err = BytePtrFromString(path) -- if err != nil { -- return -- } -- var _p1 unsafe.Pointer -- if len(buf) > 0 { -- _p1 = unsafe.Pointer(&buf[0]) ++ +var Sethostname = enter_Sethostname + +func enter_Sethostname(p []byte) (err error) { + funcref := get_SethostnameAddr() + if funcptrtest(GetZosLibVec()+SYS___SETHOSTNAME_A<<4, "") == 0 { + *funcref = impl_Sethostname - } else { -- _p1 = unsafe.Pointer(&_zero) ++ } else { + *funcref = error_Sethostname - } -- r0, _, e1 := syscall_syscall(SYS___READLINK_A, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) -- n = int(r0) -- if e1 != 0 { -- err = errnoErr(e1) -- } -- return ++ } + return (*funcref)(p) - } - --// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -- --func Rename(from string, to string) (err error) { -- var _p0 *byte -- _p0, err = BytePtrFromString(from) -- if err != nil { -- return -- } -- var _p1 *byte -- _p1, err = BytePtrFromString(to) -- if err != nil { -- return -- } -- _, _, e1 := syscall_syscall(SYS___RENAME_A, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) -- if e1 != 0 { -- err = errnoErr(e1) -- } ++} ++ +func error_Sethostname(p []byte) (err error) { + err = ENOSYS - return - } - - // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - --func Rmdir(path string) (err error) { -- var _p0 *byte -- _p0, err = BytePtrFromString(path) -- if err != nil { -- return -- } -- _, _, e1 := syscall_syscall(SYS___RMDIR_A, uintptr(unsafe.Pointer(_p0)), 0, 0) -- if e1 != 0 { -- err = errnoErr(e1) ++ return ++} ++ ++// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT ++ +func impl_Setns(fd int, nstype int) (err error) { + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS_SETNS<<4, uintptr(fd), uintptr(nstype)) + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) - } - return - } - --// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT ++ } ++ return ++} ++ +//go:nosplit +func get_SetnsAddr() *(func(fd int, nstype int) (err error)) - --func Seek(fd int, offset int64, whence int) (off int64, err error) { -- r0, _, e1 := syscall_syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence)) -- off = int64(r0) -- if e1 != 0 { -- err = errnoErr(e1) ++ +var Setns = enter_Setns + +func enter_Setns(fd int, nstype int) (err error) { @@ -10499,17 +10278,17 @@ index 94f011238319..7ccf66b7ee0d 100644 + *funcref = impl_Setns + } else { + *funcref = error_Setns - } ++ } + return (*funcref)(fd, nstype) +} + +func error_Setns(fd int, nstype int) (err error) { + err = ENOSYS - return - } - - // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - ++ return ++} ++ ++// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT ++ func Setpriority(which int, who int, prio int) (err error) { - _, _, e1 := syscall_syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio)) - if e1 != 0 { @@ -10660,12 +10439,12 @@ index 94f011238319..7ccf66b7ee0d 100644 + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) -+ } -+ return -+} -+ -+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -+ + } + return + } + + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func impl_Symlinkat(oldPath string, dirfd int, newPath string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(oldPath) @@ -10682,10 +10461,10 @@ index 94f011238319..7ccf66b7ee0d 100644 + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) - } - return - } - ++ } ++ return ++} ++ +//go:nosplit +func get_SymlinkatAddr() *(func(oldPath string, dirfd int, newPath string) (err error)) + @@ -10706,8 +10485,8 @@ index 94f011238319..7ccf66b7ee0d 100644 + return +} + - // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - ++// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT ++ func Sync() { - syscall_syscall(SYS_SYNC, 0, 0, 0) + runtime.EnterSyscall() @@ -10772,7 +10551,7 @@ index 94f011238319..7ccf66b7ee0d 100644 oldmask = int(r0) return } -@@ -1142,10 +3143,49 @@ func Unlink(path string) (err error) { +@@ -1142,24 +3143,65 @@ func Unlink(path string) (err error) { if err != nil { return } @@ -10784,12 +10563,12 @@ index 94f011238319..7ccf66b7ee0d 100644 + runtime.ExitSyscall() + if int64(r0) == -1 { + err = errnoErr2(e1, e2) -+ } -+ return -+} -+ -+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -+ + } + return + } + + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func impl_Unlinkat(dirfd int, path string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) @@ -10816,16 +10595,20 @@ index 94f011238319..7ccf66b7ee0d 100644 + *funcref = impl_Unlinkat + } else { + *funcref = error_Unlinkat - } ++ } + return (*funcref)(dirfd, path, flags) +} + +func error_Unlinkat(dirfd int, path string, flags int) (err error) { + err = ENOSYS - return - } - -@@ -1157,9 +3197,11 @@ func Utime(path string, utim *Utimbuf) (err error) { ++ return ++} ++ ++// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT ++ + func Utime(path string, utim *Utimbuf) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) if err != nil { return } @@ -10840,7 +10623,7 @@ index 94f011238319..7ccf66b7ee0d 100644 } return } -@@ -1172,11 +3214,91 @@ func open(path string, mode int, perm uint32) (fd int, err error) { +@@ -1172,25 +3214,119 @@ func open(path string, mode int, perm uint32) (fd int, err error) { if err != nil { return } @@ -10848,15 +10631,17 @@ index 94f011238319..7ccf66b7ee0d 100644 + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___OPEN_A<<4, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) + runtime.ExitSyscall() -+ fd = int(r0) + fd = int(r0) +- if e1 != 0 { +- err = errnoErr(e1) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) -+ } -+ return -+} -+ -+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -+ + } + return + } + + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func impl_openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) @@ -10905,9 +10690,7 @@ index 94f011238319..7ccf66b7ee0d 100644 + runtime.EnterSyscall() + r0, e2, e1 := CallLeFuncWithErr(GetZosLibVec()+SYS___OPENAT2_A<<4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(open_how)), uintptr(size)) + runtime.ExitSyscall() - fd = int(r0) -- if e1 != 0 { -- err = errnoErr(e1) ++ fd = int(r0) + if int64(r0) == -1 { + err = errnoErr2(e1, e2) + } @@ -10925,17 +10708,21 @@ index 94f011238319..7ccf66b7ee0d 100644 + *funcref = impl_openat2 + } else { + *funcref = error_openat2 - } ++ } + return (*funcref)(dirfd, path, open_how, size) +} + +func error_openat2(dirfd int, path string, open_how *OpenHow, size int) (fd int, err error) { + fd = -1 + err = ENOSYS - return - } - -@@ -1188,9 +3310,23 @@ func remove(path string) (err error) { ++ return ++} ++ ++// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT ++ + func remove(path string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) if err != nil { return } @@ -11101,7 +10888,7 @@ index 94f011238319..7ccf66b7ee0d 100644 return } diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go -index 0cc3ce496e22..53aef5dc58df 100644 +index 0cc3ce496..53aef5dc5 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go @@ -452,4 +452,9 @@ const ( @@ -11115,7 +10902,7 @@ index 0cc3ce496e22..53aef5dc58df 100644 + SYS_LSM_LIST_MODULES = 461 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go -index 856d92d69ef9..71d524763d34 100644 +index 856d92d69..71d524763 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go @@ -374,4 +374,9 @@ const ( @@ -11129,7 +10916,7 @@ index 856d92d69ef9..71d524763d34 100644 + SYS_LSM_LIST_MODULES = 461 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go -index 8d467094cf57..c747706131cb 100644 +index 8d467094c..c74770613 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go @@ -416,4 +416,9 @@ const ( @@ -11143,7 +10930,7 @@ index 8d467094cf57..c747706131cb 100644 + SYS_LSM_LIST_MODULES = 461 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go -index edc173244d0d..f96e214f6d40 100644 +index edc173244..f96e214f6 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go @@ -319,4 +319,9 @@ const ( @@ -11157,7 +10944,7 @@ index edc173244d0d..f96e214f6d40 100644 + SYS_LSM_LIST_MODULES = 461 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go -index 445eba206155..28425346cf18 100644 +index 445eba206..28425346c 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go @@ -313,4 +313,9 @@ const ( @@ -11171,7 +10958,7 @@ index 445eba206155..28425346cf18 100644 + SYS_LSM_LIST_MODULES = 461 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go -index adba01bca701..d0953018dae0 100644 +index adba01bca..d0953018d 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go @@ -436,4 +436,9 @@ const ( @@ -11185,7 +10972,7 @@ index adba01bca701..d0953018dae0 100644 + SYS_LSM_LIST_MODULES = 4461 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go -index 014c4e9c7a75..295c7f4b8184 100644 +index 014c4e9c7..295c7f4b8 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go @@ -366,4 +366,9 @@ const ( @@ -11199,7 +10986,7 @@ index 014c4e9c7a75..295c7f4b8184 100644 + SYS_LSM_LIST_MODULES = 5461 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go -index ccc97d74d05d..d1a9eaca7a41 100644 +index ccc97d74d..d1a9eaca7 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go @@ -366,4 +366,9 @@ const ( @@ -11213,7 +11000,7 @@ index ccc97d74d05d..d1a9eaca7a41 100644 + SYS_LSM_LIST_MODULES = 5461 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go -index ec2b64a95d74..bec157c39fd0 100644 +index ec2b64a95..bec157c39 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go @@ -436,4 +436,9 @@ const ( @@ -11227,7 +11014,7 @@ index ec2b64a95d74..bec157c39fd0 100644 + SYS_LSM_LIST_MODULES = 4461 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go -index 21a839e338b3..7ee7bdc435cf 100644 +index 21a839e33..7ee7bdc43 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go @@ -443,4 +443,9 @@ const ( @@ -11241,7 +11028,7 @@ index 21a839e338b3..7ee7bdc435cf 100644 + SYS_LSM_LIST_MODULES = 461 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go -index c11121ec3b4d..fad1f25b449d 100644 +index c11121ec3..fad1f25b4 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go @@ -415,4 +415,9 @@ const ( @@ -11255,7 +11042,7 @@ index c11121ec3b4d..fad1f25b449d 100644 + SYS_LSM_LIST_MODULES = 461 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go -index 909b631fcb45..7d3e16357d61 100644 +index 909b631fc..7d3e16357 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go @@ -415,4 +415,9 @@ const ( @@ -11269,7 +11056,7 @@ index 909b631fcb45..7d3e16357d61 100644 + SYS_LSM_LIST_MODULES = 461 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go -index e49bed16ea6b..0ed53ad9f7e9 100644 +index e49bed16e..0ed53ad9f 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go @@ -320,4 +320,9 @@ const ( @@ -11283,7 +11070,7 @@ index e49bed16ea6b..0ed53ad9f7e9 100644 + SYS_LSM_LIST_MODULES = 461 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go -index 66017d2d32b3..2fba04ad5006 100644 +index 66017d2d3..2fba04ad5 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go @@ -381,4 +381,9 @@ const ( @@ -11297,7 +11084,7 @@ index 66017d2d32b3..2fba04ad5006 100644 + SYS_LSM_LIST_MODULES = 461 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go -index 47bab18dcedb..621d00d741bf 100644 +index 47bab18dc..621d00d74 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go @@ -394,4 +394,9 @@ const ( @@ -11311,7 +11098,7 @@ index 47bab18dcedb..621d00d741bf 100644 + SYS_LSM_LIST_MODULES = 461 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_zos_s390x.go b/vendor/golang.org/x/sys/unix/zsysnum_zos_s390x.go -index b2e308581990..5e8c263ca9c6 100644 +index b2e308581..5e8c263ca 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_zos_s390x.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_zos_s390x.go @@ -1,2669 +1,2852 @@ @@ -16830,7 +16617,7 @@ index b2e308581990..5e8c263ca9c6 100644 + ) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux.go b/vendor/golang.org/x/sys/unix/ztypes_linux.go -index eff6bcdef814..4740b834854b 100644 +index eff6bcdef..4740b8348 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux.go @@ -1178,7 +1178,8 @@ const ( @@ -16967,7 +16754,7 @@ index eff6bcdef814..4740b834854b 100644 + Protocol uint8 +} diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_386.go b/vendor/golang.org/x/sys/unix/ztypes_linux_386.go -index 438a30affadc..fd402da43fce 100644 +index 438a30aff..fd402da43 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_386.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_386.go @@ -477,14 +477,6 @@ const ( @@ -16986,7 +16773,7 @@ index 438a30affadc..fd402da43fce 100644 Name [64]int8 Driver_name [64]int8 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go -index adceca3553b6..eb7a5e1864ad 100644 +index adceca355..eb7a5e186 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go @@ -492,15 +492,6 @@ const ( @@ -17006,7 +16793,7 @@ index adceca3553b6..eb7a5e1864ad 100644 Name [64]int8 Driver_name [64]int8 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go b/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go -index eeaa00a37d69..d78ac108b6c2 100644 +index eeaa00a37..d78ac108b 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go @@ -470,15 +470,6 @@ const ( @@ -17026,7 +16813,7 @@ index eeaa00a37d69..d78ac108b6c2 100644 Name [64]uint8 Driver_name [64]uint8 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go -index 6739aa91d4e2..cd06d47f1f7c 100644 +index 6739aa91d..cd06d47f1 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go @@ -471,15 +471,6 @@ const ( @@ -17046,7 +16833,7 @@ index 6739aa91d4e2..cd06d47f1f7c 100644 Name [64]int8 Driver_name [64]int8 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go -index 9920ef6317d0..2f28fe26c1a5 100644 +index 9920ef631..2f28fe26c 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go @@ -472,15 +472,6 @@ const ( @@ -17066,7 +16853,7 @@ index 9920ef6317d0..2f28fe26c1a5 100644 Name [64]int8 Driver_name [64]int8 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go -index 2923b799a48c..71d6cac2f1aa 100644 +index 2923b799a..71d6cac2f 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go @@ -476,15 +476,6 @@ const ( @@ -17086,7 +16873,7 @@ index 2923b799a48c..71d6cac2f1aa 100644 Name [64]int8 Driver_name [64]int8 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go -index ce2750ee415d..8596d4535638 100644 +index ce2750ee4..8596d4535 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go @@ -474,15 +474,6 @@ const ( @@ -17106,7 +16893,7 @@ index ce2750ee415d..8596d4535638 100644 Name [64]int8 Driver_name [64]int8 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go -index 3038811d70bb..cd60ea18662b 100644 +index 3038811d7..cd60ea186 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go @@ -474,15 +474,6 @@ const ( @@ -17126,7 +16913,7 @@ index 3038811d70bb..cd60ea18662b 100644 Name [64]int8 Driver_name [64]int8 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go -index efc6fed18c1f..b0ae420c489d 100644 +index efc6fed18..b0ae420c4 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go @@ -476,15 +476,6 @@ const ( @@ -17146,7 +16933,7 @@ index efc6fed18c1f..b0ae420c489d 100644 Name [64]int8 Driver_name [64]int8 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go -index 9a654b75a90f..8359728759bc 100644 +index 9a654b75a..835972875 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go @@ -482,15 +482,6 @@ const ( @@ -17166,7 +16953,7 @@ index 9a654b75a90f..8359728759bc 100644 Name [64]uint8 Driver_name [64]uint8 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go -index 40d358e33e31..69eb6a5c6892 100644 +index 40d358e33..69eb6a5c6 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go @@ -481,15 +481,6 @@ const ( @@ -17186,7 +16973,7 @@ index 40d358e33e31..69eb6a5c6892 100644 Name [64]uint8 Driver_name [64]uint8 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go -index 148c6ceb869c..5f583cb62bf3 100644 +index 148c6ceb8..5f583cb62 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go @@ -481,15 +481,6 @@ const ( @@ -17206,7 +16993,7 @@ index 148c6ceb869c..5f583cb62bf3 100644 Name [64]uint8 Driver_name [64]uint8 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go -index 72ba81543ef7..15adc04142f2 100644 +index 72ba81543..15adc0414 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go @@ -499,15 +499,6 @@ const ( @@ -17226,7 +17013,7 @@ index 72ba81543ef7..15adc04142f2 100644 Name [64]uint8 Driver_name [64]uint8 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go b/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go -index 71e765508e26..cf3ce9003770 100644 +index 71e765508..cf3ce9003 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go @@ -495,15 +495,6 @@ const ( @@ -17246,7 +17033,7 @@ index 71e765508e26..cf3ce9003770 100644 Name [64]int8 Driver_name [64]int8 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go -index 4abbdb9de932..590b56739c5b 100644 +index 4abbdb9de..590b56739 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go @@ -476,15 +476,6 @@ const ( @@ -17266,7 +17053,7 @@ index 4abbdb9de932..590b56739c5b 100644 Name [64]int8 Driver_name [64]int8 diff --git a/vendor/golang.org/x/sys/unix/ztypes_zos_s390x.go b/vendor/golang.org/x/sys/unix/ztypes_zos_s390x.go -index 54f31be63737..d9a13af4684b 100644 +index 54f31be63..d9a13af46 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_zos_s390x.go +++ b/vendor/golang.org/x/sys/unix/ztypes_zos_s390x.go @@ -25,10 +25,13 @@ const ( @@ -17452,7 +17239,7 @@ index 54f31be63737..d9a13af4684b 100644 + Ctime int64 +} diff --git a/vendor/golang.org/x/sys/windows/aliases.go b/vendor/golang.org/x/sys/windows/aliases.go -index ce2d713d62e4..16f90560a23a 100644 +index ce2d713d6..16f90560a 100644 --- a/vendor/golang.org/x/sys/windows/aliases.go +++ b/vendor/golang.org/x/sys/windows/aliases.go @@ -2,7 +2,7 @@ @@ -17466,7 +17253,7 @@ index ce2d713d62e4..16f90560a23a 100644 diff --git a/vendor/golang.org/x/sys/windows/empty.s b/vendor/golang.org/x/sys/windows/empty.s deleted file mode 100644 -index ba64caca5d35..000000000000 +index ba64caca5..000000000 --- a/vendor/golang.org/x/sys/windows/empty.s +++ /dev/null @@ -1,8 +0,0 @@ @@ -17479,7 +17266,7 @@ index ba64caca5d35..000000000000 -// This file is here to allow bodyless functions with go:linkname for Go 1.11 -// and earlier (see https://golang.org/issue/23311). diff --git a/vendor/golang.org/x/sys/windows/security_windows.go b/vendor/golang.org/x/sys/windows/security_windows.go -index 26be94a8a7b6..6f7d2ac70a93 100644 +index 26be94a8a..6f7d2ac70 100644 --- a/vendor/golang.org/x/sys/windows/security_windows.go +++ b/vendor/golang.org/x/sys/windows/security_windows.go @@ -68,6 +68,7 @@ type UserInfo10 struct { @@ -17491,7 +17278,7 @@ index 26be94a8a7b6..6f7d2ac70a93 100644 const ( // do not reorder diff --git a/vendor/golang.org/x/sys/windows/syscall_windows.go b/vendor/golang.org/x/sys/windows/syscall_windows.go -index 6395a031d45d..6525c62f3c2f 100644 +index 6395a031d..6525c62f3 100644 --- a/vendor/golang.org/x/sys/windows/syscall_windows.go +++ b/vendor/golang.org/x/sys/windows/syscall_windows.go @@ -165,6 +165,7 @@ func NewCallbackCDecl(fn interface{}) uintptr { @@ -17597,7 +17384,7 @@ index 6395a031d45d..6525c62f3c2f 100644 + EV_RING = 0x0100 +) diff --git a/vendor/golang.org/x/sys/windows/types_windows.go b/vendor/golang.org/x/sys/windows/types_windows.go -index 359780f6ace5..d8cb71db0a61 100644 +index 359780f6a..d8cb71db0 100644 --- a/vendor/golang.org/x/sys/windows/types_windows.go +++ b/vendor/golang.org/x/sys/windows/types_windows.go @@ -3380,3 +3380,27 @@ type BLOB struct { @@ -17629,7 +17416,7 @@ index 359780f6ace5..d8cb71db0a61 100644 + wReserved1 uint16 +} diff --git a/vendor/golang.org/x/sys/windows/zsyscall_windows.go b/vendor/golang.org/x/sys/windows/zsyscall_windows.go -index e8791c82c30f..9f73df75b5fe 100644 +index e8791c82c..9f73df75b 100644 --- a/vendor/golang.org/x/sys/windows/zsyscall_windows.go +++ b/vendor/golang.org/x/sys/windows/zsyscall_windows.go @@ -188,6 +188,8 @@ var ( @@ -17916,7 +17703,7 @@ index e8791c82c30f..9f73df75b5fe 100644 r0, _, _ := syscall.Syscall6(procNetUserGetInfo.Addr(), 4, uintptr(unsafe.Pointer(serverName)), uintptr(unsafe.Pointer(userName)), uintptr(level), uintptr(unsafe.Pointer(buf)), 0, 0) if r0 != 0 { diff --git a/vendor/modules.txt b/vendor/modules.txt -index 8fb57ec98c6e..f80fa20346be 100644 +index 8fb57ec98..f80fa2034 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -307,8 +307,8 @@ github.com/coreos/go-systemd/v22/dbus @@ -17940,5 +17727,5 @@ index 8fb57ec98c6e..f80fa20346be 100644 golang.org/x/sys/cpu golang.org/x/sys/plan9 -- -2.46.0 +2.48.1 diff --git a/0003-Properly-validate-cache-IDs-and-sources.patch b/0003-Properly-validate-cache-IDs-and-sources.patch deleted file mode 100644 index 46b822f..0000000 --- a/0003-Properly-validate-cache-IDs-and-sources.patch +++ /dev/null @@ -1,115 +0,0 @@ -From b48b2e689270ee7cc8c13464cbae1b5405fcb901 Mon Sep 17 00:00:00 2001 -From: Matt Heon -Date: Wed, 9 Oct 2024 15:23:03 -0400 -Subject: [PATCH 3/4] Properly validate cache IDs and sources - -The `--mount type=cache` argument to the `RUN` instruction in -Dockerfiles was using `filepath.Join` on user input, allowing -crafted paths to be used to gain access to paths on the host, -when the command should normally be limited only to Buildah;s own -cache and context directories. Switch to `filepath.SecureJoin` to -resolve the issue. - -Fixes CVE-2024-9675 - -Signed-off-by: Matt Heon -Signed-off-by: Danish Prakash ---- - internal/volumes/volumes.go | 22 +++++++++++++++------- - tests/bud.bats | 34 ++++++++++++++++++++++++++++++++++ - 2 files changed, 49 insertions(+), 7 deletions(-) - -diff --git a/internal/volumes/volumes.go b/internal/volumes/volumes.go -index da6b768fdc21..2dd04d9c32a4 100644 ---- a/internal/volumes/volumes.go -+++ b/internal/volumes/volumes.go -@@ -23,6 +23,7 @@ import ( - "github.com/containers/storage/pkg/idtools" - "github.com/containers/storage/pkg/lockfile" - "github.com/containers/storage/pkg/unshare" -+ digest "github.com/opencontainers/go-digest" - specs "github.com/opencontainers/runtime-spec/specs-go" - selinux "github.com/opencontainers/selinux/go-selinux" - ) -@@ -374,10 +375,13 @@ func GetCacheMount(args []string, store storage.Store, imageMountLabel string, a - return newMount, nil, fmt.Errorf("no stage found with name %s", fromStage) - } - // path should be /contextDir/specified path -- newMount.Source = filepath.Join(mountPoint, filepath.Clean(string(filepath.Separator)+newMount.Source)) -+ evaluated, err := copier.Eval(mountPoint, string(filepath.Separator)+newMount.Source, copier.EvalOptions{}) -+ if err != nil { -+ return newMount, nil, err -+ } -+ newMount.Source = evaluated - } else { -- // we need to create cache on host if no image is being used -- -+ // we need to create the cache directory on the host if no image is being used - // since type is cache and cache can be reused by consecutive builds - // create a common cache directory, which persists on hosts within temp lifecycle - // add subdirectory if specified -@@ -391,11 +395,15 @@ func GetCacheMount(args []string, store storage.Store, imageMountLabel string, a - } - - if id != "" { -- newMount.Source = filepath.Join(cacheParent, filepath.Clean(id)) -- buildahLockFilesDir = filepath.Join(BuildahCacheLockfileDir, filepath.Clean(id)) -+ // Don't let the user control where we place the directory. -+ dirID := digest.FromString(id).Encoded()[:16] -+ newMount.Source = filepath.Join(cacheParent, dirID) -+ buildahLockFilesDir = filepath.Join(BuildahCacheLockfileDir, dirID) - } else { -- newMount.Source = filepath.Join(cacheParent, filepath.Clean(newMount.Destination)) -- buildahLockFilesDir = filepath.Join(BuildahCacheLockfileDir, filepath.Clean(newMount.Destination)) -+ // Don't let the user control where we place the directory. -+ dirID := digest.FromString(newMount.Destination).Encoded()[:16] -+ newMount.Source = filepath.Join(cacheParent, dirID) -+ buildahLockFilesDir = filepath.Join(BuildahCacheLockfileDir, dirID) - } - idPair := idtools.IDPair{ - UID: uid, -diff --git a/tests/bud.bats b/tests/bud.bats -index b6982bbc0ee4..e28fc3dd8add 100644 ---- a/tests/bud.bats -+++ b/tests/bud.bats -@@ -6659,3 +6659,37 @@ _EOF - assert "$status" -eq 2 "exit code from ls" - expect_output --substring "No such file or directory" - } -+ -+@test "build-check-cve-2024-9675" { -+ _prefetch alpine -+ -+ touch ${TEST_SCRATCH_DIR}/file.txt -+ -+ cat > ${TEST_SCRATCH_DIR}/Containerfile < ${TEST_SCRATCH_DIR}/Containerfile < ${TEST_SCRATCH_DIR}/cve20249675/Containerfile < +Date: Wed, 12 Feb 2025 15:33:28 +0100 +Subject: [PATCH 4/4] http2: close connections when receiving too many headers + (#1) + +Maintaining HPACK state requires that we parse and process +all HEADERS and CONTINUATION frames on a connection. +When a request's headers exceed MaxHeaderBytes, we don't +allocate memory to store the excess headers but we do +parse them. This permits an attacker to cause an HTTP/2 +endpoint to read arbitrary amounts of data, all associated +with a request which is going to be rejected. + +Set a limit on the amount of excess header frames we +will process before closing a connection. + +Thanks to Bartek Nowotarski for reporting this issue. + +Fixes CVE-2023-45288 +Fixes bsc#1236531 + +This is a backport of +https://go.googlesource.com/net/+/ba872109ef2dc8f1da778651bd1fd3792d0e4587%5E%21/#F0 +--- + vendor/golang.org/x/net/http2/frame.go | 31 ++++++++++++++++++++++++++ + 1 file changed, 31 insertions(+) + +diff --git a/vendor/golang.org/x/net/http2/frame.go b/vendor/golang.org/x/net/http2/frame.go +index e2b298d85..a5a94411d 100644 +--- a/vendor/golang.org/x/net/http2/frame.go ++++ b/vendor/golang.org/x/net/http2/frame.go +@@ -1564,6 +1564,7 @@ func (fr *Framer) readMetaFrame(hf *HeadersFrame) (*MetaHeadersFrame, error) { + if size > remainSize { + hdec.SetEmitEnabled(false) + mh.Truncated = true ++ remainSize = 0 + return + } + remainSize -= size +@@ -1576,6 +1577,36 @@ func (fr *Framer) readMetaFrame(hf *HeadersFrame) (*MetaHeadersFrame, error) { + var hc headersOrContinuation = hf + for { + frag := hc.HeaderBlockFragment() ++ ++ // Avoid parsing large amounts of headers that we will then discard. ++ // If the sender exceeds the max header list size by too much, ++ // skip parsing the fragment and close the connection. ++ // ++ // "Too much" is either any CONTINUATION frame after we've already ++ // exceeded the max header list size (in which case remainSize is 0), ++ // or a frame whose encoded size is more than twice the remaining ++ // header list bytes we're willing to accept. ++ if int64(len(frag)) > int64(2*remainSize) { ++ if VerboseLogs { ++ log.Printf("http2: header list too large") ++ } ++ // It would be nice to send a RST_STREAM before sending the GOAWAY, ++ // but the struture of the server's frame writer makes this difficult. ++ return nil, ConnectionError(ErrCodeProtocol) ++ } ++ ++ // Also close the connection after any CONTINUATION frame following an ++ // invalid header, since we stop tracking the size of the headers after ++ // an invalid one. ++ if invalid != nil { ++ if VerboseLogs { ++ log.Printf("http2: invalid header: %v", invalid) ++ } ++ // It would be nice to send a RST_STREAM before sending the GOAWAY, ++ // but the struture of the server's frame writer makes this difficult. ++ return nil, ConnectionError(ErrCodeProtocol) ++ } ++ + if _, err := hdec.Write(frag); err != nil { + return nil, ConnectionError(ErrCodeCompression) + } +-- +2.48.1 + diff --git a/buildah-1.35.4.tar.xz b/buildah-1.35.4.tar.xz deleted file mode 100644 index 85c156f..0000000 --- a/buildah-1.35.4.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:40273dedadfa7c9856257a23732513f4f019c33b5be8f354578dc148baf58416 -size 11846224 diff --git a/buildah-1.35.5.tar.xz b/buildah-1.35.5.tar.xz new file mode 100644 index 0000000..80fa337 --- /dev/null +++ b/buildah-1.35.5.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:62a178cd7a6ad1f997db3b656096dad3a5cb940c92888d24ad65c9fa04dc35d5 +size 11840508 diff --git a/buildah.changes b/buildah.changes index 9ea738c..283c35c 100644 --- a/buildah.changes +++ b/buildah.changes @@ -1,3 +1,44 @@ +------------------------------------------------------------------- +Wed Feb 12 16:14:32 UTC 2025 - Dan Čermák + +- Add patch for CVE-2023-45288 (bsc#1236507) + + Rebase patches: + * 0001-pkg-subscriptions-use-securejoin-for-the-container-p.patch + * 0002-Use-securejoin.SecureJoin-when-forming-userns-paths.patch + + Added patch: + * 0004-http2-close-connections-when-receiving-too-many-head.patch + (CVE-2023-45288 - bsc#1236531) + + +------------------------------------------------------------------- +Mon Jan 27 08:06:43 UTC 2025 - danish.prakash@suse.com + +- Update to version 1.35.5 (fix for CVE-2024-11218; bsc#1236272): + * Tag v1.35.5 + * Fix TOCTOU error when bind and cache mounts use "src" values + * define.TempDirForURL(): always use an intermediate subdirectory + * internal/volume.GetBindMount(): discard writes in bind mounts + * pkg/overlay: add a MountLabel flag to Options + * pkg/overlay: add a ForceMount flag to Options + * Add internal/volumes.bindFromChroot() + * Add an internal/open package + * Properly validate cache IDs and sources + * CVE-2024-9407: validate "bind-propagation" flag settings + * Allow cache mounts to be stages or additional build contexts + * Integration tests: switch some base images + * Disable most packit copr targets + * Cross-build on Fedora +- Rename patches: + * 0002-conmon-pkg-subscriptions-use-securejoin-for-the-cont.patch => + 0001-pkg-subscriptions-use-securejoin-for-the-container-p.patch + * 0004-Use-securejoin.SecureJoin-when-forming-userns-paths.patch => + 0002-Use-securejoin.SecureJoin-when-forming-userns-paths.patch +- Removed patches(merged upstream): + * 0001-CVE-2024-9407-validate-bind-propagation-flag-setting.patch + * 0003-Properly-validate-cache-IDs-and-sources.patch + ------------------------------------------------------------------- Tue Oct 22 08:30:04 UTC 2024 - Danish Prakash diff --git a/buildah.spec b/buildah.spec index f858bae..3b4722d 100644 --- a/buildah.spec +++ b/buildah.spec @@ -19,7 +19,7 @@ %define project github.com/containers/buildah Name: buildah -Version: 1.35.4 +Version: 1.35.5 Release: 0 Summary: Tool for building OCI containers License: Apache-2.0 @@ -27,10 +27,9 @@ Group: System/Management URL: https://%{project} Source0: %{name}-%{version}.tar.xz Source1: %{name}-rpmlintrc -Patch0: 0001-CVE-2024-9407-validate-bind-propagation-flag-setting.patch -Patch1: 0002-conmon-pkg-subscriptions-use-securejoin-for-the-cont.patch -Patch2: 0003-Properly-validate-cache-IDs-and-sources.patch -Patch3: 0004-Use-securejoin.SecureJoin-when-forming-userns-paths.patch +Patch0: 0001-pkg-subscriptions-use-securejoin-for-the-container-p.patch +Patch1: 0002-Use-securejoin.SecureJoin-when-forming-userns-paths.patch +Patch3: 0004-http2-close-connections-when-receiving-too-many-head.patch BuildRequires: bash-completion BuildRequires: device-mapper-devel BuildRequires: fdupes