]> Cypherpunks.ru repositories - gostls13.git/commitdiff
syscall: restore original NOFILE rlimit in child process
authorIan Lance Taylor <iant@golang.org>
Tue, 14 Mar 2023 03:59:14 +0000 (20:59 -0700)
committerIan Lance Taylor <iant@google.com>
Wed, 15 Mar 2023 17:21:30 +0000 (17:21 +0000)
If we increased the NOFILE rlimit when starting the program,
restore the original rlimit when forking a child process.

For #46279

Change-Id: Ia5d2af9ef435e5932965c15eec2e428d2130d230
Reviewed-on: https://go-review.googlesource.com/c/go/+/476097
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Bypass: Ian Lance Taylor <iant@google.com>

63 files changed:
src/runtime/syscall2_solaris.go
src/runtime/syscall_aix.go
src/runtime/syscall_solaris.go
src/syscall/asm_solaris_amd64.s
src/syscall/exec_bsd.go
src/syscall/exec_freebsd.go
src/syscall/exec_libc.go
src/syscall/exec_libc2.go
src/syscall/exec_linux.go
src/syscall/exec_unix.go
src/syscall/exec_unix_test.go
src/syscall/export_rlimit_test.go [new file with mode: 0644]
src/syscall/rlimit.go
src/syscall/syscall_aix.go
src/syscall/syscall_darwin.go
src/syscall/syscall_dragonfly.go
src/syscall/syscall_freebsd.go
src/syscall/syscall_linux.go
src/syscall/syscall_linux_386.go
src/syscall/syscall_linux_amd64.go
src/syscall/syscall_linux_arm.go
src/syscall/syscall_linux_arm64.go
src/syscall/syscall_linux_loong64.go
src/syscall/syscall_linux_mips64x.go
src/syscall/syscall_linux_mipsx.go
src/syscall/syscall_linux_ppc64x.go
src/syscall/syscall_linux_riscv64.go
src/syscall/syscall_linux_s390x.go
src/syscall/syscall_netbsd.go
src/syscall/syscall_openbsd.go
src/syscall/syscall_solaris.go
src/syscall/zsyscall_aix_ppc64.go
src/syscall/zsyscall_darwin_amd64.go
src/syscall/zsyscall_darwin_arm64.go
src/syscall/zsyscall_dragonfly_amd64.go
src/syscall/zsyscall_freebsd_386.go
src/syscall/zsyscall_freebsd_amd64.go
src/syscall/zsyscall_freebsd_arm.go
src/syscall/zsyscall_freebsd_arm64.go
src/syscall/zsyscall_freebsd_riscv64.go
src/syscall/zsyscall_linux_386.go
src/syscall/zsyscall_linux_amd64.go
src/syscall/zsyscall_linux_arm.go
src/syscall/zsyscall_linux_arm64.go
src/syscall/zsyscall_linux_loong64.go
src/syscall/zsyscall_linux_mips.go
src/syscall/zsyscall_linux_mips64.go
src/syscall/zsyscall_linux_mips64le.go
src/syscall/zsyscall_linux_mipsle.go
src/syscall/zsyscall_linux_ppc64.go
src/syscall/zsyscall_linux_ppc64le.go
src/syscall/zsyscall_linux_riscv64.go
src/syscall/zsyscall_linux_s390x.go
src/syscall/zsyscall_netbsd_386.go
src/syscall/zsyscall_netbsd_amd64.go
src/syscall/zsyscall_netbsd_arm.go
src/syscall/zsyscall_netbsd_arm64.go
src/syscall/zsyscall_openbsd_386.go
src/syscall/zsyscall_openbsd_amd64.go
src/syscall/zsyscall_openbsd_arm.go
src/syscall/zsyscall_openbsd_arm64.go
src/syscall/zsyscall_openbsd_mips64.go
src/syscall/zsyscall_solaris_amd64.go

index 331048920212230704c5c74cfd5069d12b220c86..d464f284bcb2f42de47286b65537bbddd30349fc 100644 (file)
@@ -17,6 +17,7 @@ import _ "unsafe" // for go:linkname
 //go:cgo_import_dynamic libc_ioctl ioctl "libc.so"
 //go:cgo_import_dynamic libc_setgid setgid "libc.so"
 //go:cgo_import_dynamic libc_setgroups setgroups "libc.so"
+//go:cgo_import_dynamic libc_setrlimit setrlimit "libc.so"
 //go:cgo_import_dynamic libc_setsid setsid "libc.so"
 //go:cgo_import_dynamic libc_setuid setuid "libc.so"
 //go:cgo_import_dynamic libc_setpgid setpgid "libc.so"
@@ -34,6 +35,7 @@ import _ "unsafe" // for go:linkname
 //go:linkname libc_ioctl libc_ioctl
 //go:linkname libc_setgid libc_setgid
 //go:linkname libc_setgroups libc_setgroups
+//go:linkname libc_setrlimit libc_setrlimit
 //go:linkname libc_setsid libc_setsid
 //go:linkname libc_setuid libc_setuid
 //go:linkname libc_setpgid libc_setpgid
index cc9e912613dcacd1bf9f5ca7eaa0ed80e2d320aa..e87d4d6d7acced85293cc084fe648a2fbe8e545e 100644 (file)
@@ -18,6 +18,7 @@ import "unsafe"
 //go:cgo_import_dynamic libc_ioctl ioctl "libc.a/shr_64.o"
 //go:cgo_import_dynamic libc_setgid setgid "libc.a/shr_64.o"
 //go:cgo_import_dynamic libc_setgroups setgroups "libc.a/shr_64.o"
+//go:cgo_import_dynamic libc_setrlimit setrlimit "libc.a/shr_64.o"
 //go:cgo_import_dynamic libc_setsid setsid "libc.a/shr_64.o"
 //go:cgo_import_dynamic libc_setuid setuid "libc.a/shr_64.o"
 //go:cgo_import_dynamic libc_setpgid setpgid "libc.a/shr_64.o"
@@ -31,6 +32,7 @@ import "unsafe"
 //go:linkname libc_ioctl libc_ioctl
 //go:linkname libc_setgid libc_setgid
 //go:linkname libc_setgroups libc_setgroups
+//go:linkname libc_setrlimit libc_setrlimit
 //go:linkname libc_setsid libc_setsid
 //go:linkname libc_setuid libc_setuid
 //go:linkname libc_setpgid libc_setpgid
@@ -45,6 +47,7 @@ var (
        libc_ioctl,
        libc_setgid,
        libc_setgroups,
+       libc_setrlimit,
        libc_setsid,
        libc_setuid,
        libc_setpgid libFunc
@@ -199,6 +202,13 @@ func syscall_setgroups1(ngid, gid uintptr) (err uintptr) {
        return
 }
 
+//go:linkname syscall_setrlimit1 syscall.setrlimit1
+//go:nosplit
+func syscall_setrlimit1(which uintptr, lim unsafe.Pointer) (err uintptr) {
+       _, err = syscall2(&libc_setrlimit, which, uintptr(lim))
+       return
+}
+
 //go:linkname syscall_setsid syscall.setsid
 //go:nosplit
 func syscall_setsid() (pid, err uintptr) {
index e7bab3b23fb54fb2c4ae4069e65b6cafadafa632..9faee9ec468952a506253e2f3bb57c9bce602433 100644 (file)
@@ -18,6 +18,7 @@ var (
        libc_ioctl,
        libc_setgid,
        libc_setgroups,
+       libc_setrlimit,
        libc_setsid,
        libc_setuid,
        libc_setpgid,
@@ -234,6 +235,19 @@ func syscall_setgroups(ngid, gid uintptr) (err uintptr) {
        return call.err
 }
 
+//go:nosplit
+//go:linkname syscall_setrlimit
+//go:cgo_unsafe_args
+func syscall_setrlimit(which uintptr, lim unsafe.Pointer) (err uintptr) {
+       call := libcall{
+               fn:   uintptr(unsafe.Pointer(&libc_setrlimit)),
+               n:    2,
+               args: uintptr(unsafe.Pointer(&which)),
+       }
+       asmcgocall(unsafe.Pointer(&asmsysvicall6x), unsafe.Pointer(&call))
+       return call.err
+}
+
 //go:nosplit
 //go:linkname syscall_setsid
 func syscall_setsid() (pid, err uintptr) {
index 6891e9c8f96d5e335badbd3bf2a91fb3b686322b..6dee29a9c718192c31dbeb3d30423d9cb2d2b967 100644 (file)
@@ -60,6 +60,9 @@ TEXT ·setgid(SB),NOSPLIT,$0
 TEXT ·setgroups1(SB),NOSPLIT,$0
        JMP     runtime·syscall_setgroups(SB)
 
+TEXT ·setrlimit1(SB),NOSPLIT,$0
+       JMP     runtime·syscall_setrlimit(SB)
+
 TEXT ·setsid(SB),NOSPLIT,$0
        JMP     runtime·syscall_setsid(SB)
 
index 379875561b263efa67dbe1f65935996a974b5f87..0b0cd24e690c2e469163f99c1cabd894b622534a 100644 (file)
@@ -64,6 +64,8 @@ func forkAndExecInChild(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr
                ngroups, groups uintptr
        )
 
+       rlim, rlimOK := origRlimitNofile.Load().(Rlimit)
+
        // guard against side effects of shuffling fds below.
        // Make sure that nextfd is beyond any currently open files so
        // that we can't run the risk of overwriting any of them.
@@ -273,6 +275,11 @@ func forkAndExecInChild(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr
                }
        }
 
+       // Restore original rlimit.
+       if rlimOK && rlim.Cur != 0 {
+               RawSyscall(SYS_SETRLIMIT, uintptr(RLIMIT_NOFILE), uintptr(unsafe.Pointer(&rlim)), 0)
+       }
+
        // Time to exec.
        _, _, err1 = RawSyscall(SYS_EXECVE,
                uintptr(unsafe.Pointer(argv0)),
index 41180561438db1e3585dede0a31a784311cf5156..bd198d09b426c4a13b177eba568caa580fa96892 100644 (file)
@@ -71,6 +71,8 @@ func forkAndExecInChild(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr
                upid            uintptr
        )
 
+       rlim, rlimOK := origRlimitNofile.Load().(Rlimit)
+
        // Record parent PID so child can test if it has died.
        ppid, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)
 
@@ -297,6 +299,11 @@ func forkAndExecInChild(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr
                }
        }
 
+       // Restore original rlimit.
+       if rlimOK && rlim.Cur != 0 {
+               RawSyscall(SYS_SETRLIMIT, uintptr(RLIMIT_NOFILE), uintptr(unsafe.Pointer(&rlim)), 0)
+       }
+
        // Time to exec.
        _, _, err1 = RawSyscall(SYS_EXECVE,
                uintptr(unsafe.Pointer(argv0)),
index 0f8a7b53750489f1879bd410eaf484d267436091..44557867eb7b6c83028247d5763c991b8e75f6e3 100644 (file)
@@ -53,6 +53,7 @@ func getpid() (pid uintptr, err Errno)
 func ioctl(fd uintptr, req uintptr, arg uintptr) (err Errno)
 func setgid(gid uintptr) (err Errno)
 func setgroups1(ngid uintptr, gid uintptr) (err Errno)
+func setrlimit1(which uintptr, lim unsafe.Pointer) (err Errno)
 func setsid() (pid uintptr, err Errno)
 func setuid(uid uintptr) (err Errno)
 func setpgid(pid uintptr, pgid uintptr) (err Errno)
@@ -90,6 +91,8 @@ func forkAndExecInChild(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr
                ngroups, groups uintptr
        )
 
+       rlim, rlimOK := origRlimitNofile.Load().(Rlimit)
+
        // guard against side effects of shuffling fds below.
        // Make sure that nextfd is beyond any currently open files so
        // that we can't run the risk of overwriting any of them.
@@ -292,6 +295,11 @@ func forkAndExecInChild(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr
                }
        }
 
+       // Restore original rlimit.
+       if rlimOK && rlim.Cur != 0 {
+               setrlimit1(RLIMIT_NOFILE, unsafe.Pointer(&rlim))
+       }
+
        // Time to exec.
        err1 = execve(
                uintptr(unsafe.Pointer(argv0)),
index 9b04f96c81908a6ee87545f1d020c2296eb2de33..4fca701d6b3d8f9645a30f3643d2498ea2b9705e 100644 (file)
@@ -65,6 +65,8 @@ func forkAndExecInChild(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr
                ngroups, groups uintptr
        )
 
+       rlim, rlimOK := origRlimitNofile.Load().(Rlimit)
+
        // guard against side effects of shuffling fds below.
        // Make sure that nextfd is beyond any currently open files so
        // that we can't run the risk of overwriting any of them.
@@ -269,6 +271,11 @@ func forkAndExecInChild(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr
                }
        }
 
+       // Restore original rlimit.
+       if rlimOK && rlim.Cur != 0 {
+               rawSyscall(abi.FuncPCABI0(libc_setrlimit_trampoline), uintptr(RLIMIT_NOFILE), uintptr(unsafe.Pointer(&rlim)), 0)
+       }
+
        // Time to exec.
        _, _, err1 = rawSyscall(abi.FuncPCABI0(libc_execve_trampoline),
                uintptr(unsafe.Pointer(argv0)),
index d5f00dd33e9896c503ef738f441f1624de874f9b..2a1f7ef1a7d7473cd137996fd983f3d45e94268b 100644 (file)
@@ -240,6 +240,8 @@ func forkAndExecInChild1(argv0 *byte, argv, envv []*byte, chroot, dir *byte, att
                c                         uintptr
        )
 
+       rlim, rlimOK := origRlimitNofile.Load().(Rlimit)
+
        if sys.UidMappings != nil {
                puid = []byte("/proc/self/uid_map\000")
                uidmap = formatIDMappings(sys.UidMappings)
@@ -609,6 +611,11 @@ func forkAndExecInChild1(argv0 *byte, argv, envv []*byte, chroot, dir *byte, att
                }
        }
 
+       // Restore original rlimit.
+       if rlimOK && rlim.Cur != 0 {
+               rawSetrlimit(RLIMIT_NOFILE, &rlim)
+       }
+
        // Enable tracing if requested.
        // Do this right before exec so that we don't unnecessarily trace the runtime
        // setting up after the fork. See issue #21428.
index 286be454d88f0263dd1fe29fea6ceced79c703fc..40e9b9feda5493886d32e11c326928b79a2d3010 100644 (file)
@@ -282,6 +282,11 @@ func Exec(argv0 string, argv []string, envv []string) (err error) {
        }
        runtime_BeforeExec()
 
+       rlim, rlimOK := origRlimitNofile.Load().(Rlimit)
+       if rlimOK && rlim.Cur != 0 {
+               Setrlimit(RLIMIT_NOFILE, &rlim)
+       }
+
        var err1 error
        if runtime.GOOS == "solaris" || runtime.GOOS == "illumos" || runtime.GOOS == "aix" {
                // RawSyscall should never be used on Solaris, illumos, or AIX.
index 942a254cb9d1a1146ab39913bdec19d700d6cae4..2e5e3df374756c105196ce7676a4b1a3541a2443 100644 (file)
@@ -7,12 +7,15 @@
 package syscall_test
 
 import (
+       "bytes"
+       "fmt"
        "internal/testenv"
        "io"
        "math/rand"
        "os"
        "os/exec"
        "os/signal"
+       "strconv"
        "syscall"
        "testing"
        "time"
@@ -345,3 +348,42 @@ func TestExecHelper(t *testing.T) {
 
        t.Error("syscall.Exec returned")
 }
+
+// Test that rlimit values are restored by exec.
+func TestRlimitRestored(t *testing.T) {
+       if os.Getenv("GO_WANT_HELPER_PROCESS") != "" {
+               fmt.Println(syscall.OrigRlimitNofile().Cur)
+               os.Exit(0)
+       }
+
+       orig := syscall.OrigRlimitNofile()
+       if orig.Cur == 0 {
+               t.Skip("skipping test because rlimit not adjusted at startup")
+       }
+
+       executable, err := os.Executable()
+       if err != nil {
+               executable = os.Args[0]
+       }
+
+       cmd := testenv.Command(t, executable, "-test.run=TestRlimitRestored")
+       cmd = testenv.CleanCmdEnv(cmd)
+       cmd.Env = append(cmd.Env, "GO_WANT_HELPER_PROCESS=1")
+
+       out, err := cmd.CombinedOutput()
+       if len(out) > 0 {
+               t.Logf("%s", out)
+       }
+       if err != nil {
+               t.Fatalf("subprocess failed: %v", err)
+       }
+       s := string(bytes.TrimSpace(out))
+       v, err := strconv.ParseUint(s, 10, 64)
+       if err != nil {
+               t.Fatalf("could not parse %q as number: %v", s, v)
+       }
+
+       if v != uint64(orig.Cur) {
+               t.Errorf("exec rlimit = %d, want %d", v, orig)
+       }
+}
diff --git a/src/syscall/export_rlimit_test.go b/src/syscall/export_rlimit_test.go
new file mode 100644 (file)
index 0000000..320e331
--- /dev/null
@@ -0,0 +1,14 @@
+// Copyright 2023 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+//go:build unix
+
+package syscall
+
+func OrigRlimitNofile() Rlimit {
+       if rlim, ok := origRlimitNofile.Load().(Rlimit); ok {
+               return rlim
+       }
+       return Rlimit{0, 0}
+}
index 2049200c00e822766e31a992553469942598dcf1..cc7935d37be12a23429846ed5e3f5991092c9f95 100644 (file)
@@ -6,6 +6,15 @@
 
 package syscall
 
+import (
+       "sync/atomic"
+)
+
+// origRlimitNofile, if not {0, 0}, is the original soft RLIMIT_NOFILE.
+// When we can assume that we are bootstrapping with Go 1.19,
+// this can be atomic.Pointer[Rlimit].
+var origRlimitNofile atomic.Value // of Rlimit
+
 // Some systems set an artificially low soft limit on open file count, for compatibility
 // with code that uses select and its hard-coded maximum file descriptor
 // (limited by the size of fd_set).
@@ -23,8 +32,19 @@ package syscall
 func init() {
        var lim Rlimit
        if err := Getrlimit(RLIMIT_NOFILE, &lim); err == nil && lim.Cur != lim.Max {
+               origRlimitNofile.Store(lim)
                lim.Cur = lim.Max
                adjustFileLimit(&lim)
-               Setrlimit(RLIMIT_NOFILE, &lim)
+               setrlimit(RLIMIT_NOFILE, &lim)
+       }
+}
+
+func Setrlimit(resource int, rlim *Rlimit) error {
+       err := setrlimit(resource, rlim)
+       if err == nil && resource == RLIMIT_NOFILE {
+               // Store zeroes in origRlimitNofile to tell StartProcess
+               // to not adjust the rlimit in the child process.
+               origRlimitNofile.Store(Rlimit{0, 0})
        }
+       return err
 }
index e4dde6b034e8414d02f4da2322cf231a4bd51aa6..30e6887cce5f7831d471bec40001e3fc8c2e9c10 100644 (file)
@@ -633,7 +633,7 @@ func PtraceDetach(pid int) (err error) { return ptrace64(PT_DETACH, int64(pid),
 //sys  Setpriority(which int, who int, prio int) (err error)
 //sysnb        Setregid(rgid int, egid int) (err error)
 //sysnb        Setreuid(ruid int, euid int) (err error)
-//sysnb        Setrlimit(which int, lim *Rlimit) (err error)
+//sysnb        setrlimit(which int, lim *Rlimit) (err error)
 //sys  Stat(path string, stat *Stat_t) (err error)
 //sys  Statfs(path string, buf *Statfs_t) (err error)
 //sys  Symlink(path string, link string) (err error)
index a39e99dc633a86df864a1d1e820bcc138b2db4c2..a9639e3913ac5dabbfaee3a8df391af89df7ccb1 100644 (file)
@@ -195,7 +195,7 @@ func Kill(pid int, signum Signal) (err error) { return kill(pid, int(signum), 1)
 //sys  Setprivexec(flag int) (err error)
 //sysnb        Setregid(rgid int, egid int) (err error)
 //sysnb        Setreuid(ruid int, euid int) (err error)
-//sysnb        Setrlimit(which int, lim *Rlimit) (err error)
+//sysnb        setrlimit(which int, lim *Rlimit) (err error)
 //sysnb        Setsid() (pid int, err error)
 //sysnb        Settimeofday(tp *Timeval) (err error)
 //sysnb        Setuid(uid int) (err error)
index 1a1f1f69425647377009da563481e3d28a237a42..6cb506b3009d5d1820a9e69ab21f0396bb4d0787 100644 (file)
@@ -240,7 +240,7 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
 //sys  Setpriority(which int, who int, prio int) (err error)
 //sysnb        Setregid(rgid int, egid int) (err error)
 //sysnb        Setreuid(ruid int, euid int) (err error)
-//sysnb        Setrlimit(which int, lim *Rlimit) (err error)
+//sysnb        setrlimit(which int, lim *Rlimit) (err error)
 //sysnb        Setsid() (pid int, err error)
 //sysnb        Settimeofday(tp *Timeval) (err error)
 //sysnb        Setuid(uid int) (err error)
index 0f3912644b86d081629bc06256755119ef0d9e86..a0faa817eaf2de23b9e50378a5c389bb3484db04 100644 (file)
@@ -234,7 +234,7 @@ func Mknod(path string, mode uint32, dev uint64) (err error) {
 //sys  Setpriority(which int, who int, prio int) (err error)
 //sysnb        Setregid(rgid int, egid int) (err error)
 //sysnb        Setreuid(ruid int, euid int) (err error)
-//sysnb        Setrlimit(which int, lim *Rlimit) (err error)
+//sysnb        setrlimit(which int, lim *Rlimit) (err error)
 //sysnb        Setsid() (pid int, err error)
 //sysnb        Settimeofday(tp *Timeval) (err error)
 //sysnb        Setuid(uid int) (err error)
index bf9d85637a9fc0efe5d2b020f269698b5f113d44..618b2e6d42f00434857216ab20101196088b7252 100644 (file)
@@ -1058,7 +1058,7 @@ func Getpgrp() (pid int) {
 //sys  Mknodat(dirfd int, path string, mode uint32, dev int) (err error)
 //sys  Nanosleep(time *Timespec, leftover *Timespec) (err error)
 //sys  PivotRoot(newroot string, putold string) (err error) = SYS_PIVOT_ROOT
-//sysnb prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) = SYS_PRLIMIT64
+//sysnb prlimit1(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) = SYS_PRLIMIT64
 //sys  read(fd int, p []byte) (n int, err error)
 //sys  Removexattr(path string, attr string) (err error)
 //sys  Setdomainname(p []byte) (err error)
@@ -1261,3 +1261,14 @@ func Munmap(b []byte) (err error) {
 //sys  Munlock(b []byte) (err error)
 //sys  Mlockall(flags int) (err error)
 //sys  Munlockall() (err error)
+
+// prlimit changes a resource limit. We use a single definition so that
+// we can tell StartProcess to not restore the original NOFILE limit.
+// This is unexported but can be called from x/sys/unix.
+func prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) {
+       err = prlimit1(pid, resource, newlimit, old)
+       if err == nil && newlimit != nil && resource == RLIMIT_NOFILE {
+               origRlimitNofile.Store(Rlimit{0, 0})
+       }
+       return err
+}
index 0c9c6aa7551db5e79f89d8f4327784e74070352f..9cbd9ac9f03113b34b280f9c2c97b21054dda77c 100644 (file)
@@ -107,9 +107,9 @@ func Getrlimit(resource int, rlim *Rlimit) (err error) {
        return
 }
 
-//sysnb setrlimit(resource int, rlim *rlimit32) (err error) = SYS_SETRLIMIT
+//sysnb setrlimit1(resource int, rlim *rlimit32) (err error) = SYS_SETRLIMIT
 
-func Setrlimit(resource int, rlim *Rlimit) (err error) {
+func setrlimit(resource int, rlim *Rlimit) (err error) {
        err = prlimit(0, resource, rlim, nil)
        if err != ENOSYS {
                return err
@@ -131,7 +131,34 @@ func Setrlimit(resource int, rlim *Rlimit) (err error) {
                return EINVAL
        }
 
-       return setrlimit(resource, &rl)
+       return setrlimit1(resource, &rl)
+}
+
+//go:nosplit
+func rawSetrlimit(resource int, rlim *Rlimit) Errno {
+       _, _, errno := RawSyscall6(SYS_PRLIMIT64, 0, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0, 0, 0)
+       if errno != ENOSYS {
+               return errno
+       }
+
+       rl := rlimit32{}
+       if rlim.Cur == rlimInf64 {
+               rl.Cur = rlimInf32
+       } else if rlim.Cur < uint64(rlimInf32) {
+               rl.Cur = uint32(rlim.Cur)
+       } else {
+               return EINVAL
+       }
+       if rlim.Max == rlimInf64 {
+               rl.Max = rlimInf32
+       } else if rlim.Max < uint64(rlimInf32) {
+               rl.Max = uint32(rlim.Max)
+       } else {
+               return EINVAL
+       }
+
+       _, _, errno = RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)
+       return errno
 }
 
 // Underlying system call writes to newoffset via pointer.
index 77e1393de1dd249cffb6885a7f4a4b225ed6bd41..aa85a523b20b99907fb0aa52e8ed9f8d67325324 100644 (file)
@@ -4,6 +4,10 @@
 
 package syscall
 
+import (
+       "unsafe"
+)
+
 const (
        _SYS_setgroups  = SYS_SETGROUPS
        _SYS_clone3     = 435
@@ -33,7 +37,7 @@ const (
 //sys  sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
 //sys  Setfsgid(gid int) (err error)
 //sys  Setfsuid(uid int) (err error)
-//sysnb        Setrlimit(resource int, rlim *Rlimit) (err error)
+//sysnb        setrlimit(resource int, rlim *Rlimit) (err error) = SYS_SETRLIMIT
 //sys  Shutdown(fd int, how int) (err error)
 //sys  Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
 //sys  Statfs(path string, buf *Statfs_t) (err error)
@@ -98,6 +102,12 @@ func Time(t *Time_t) (tt Time_t, err error) {
 //sys  Utime(path string, buf *Utimbuf) (err error)
 //sys  utimes(path string, times *[2]Timeval) (err error)
 
+//go:nosplit
+func rawSetrlimit(resource int, rlim *Rlimit) Errno {
+       _, _, errno := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)
+       return errno
+}
+
 func setTimespec(sec, nsec int64) Timespec {
        return Timespec{Sec: sec, Nsec: nsec}
 }
index f4740af5863decaf3ec2a9f765f68c300829499d..600ec3552db520bfe637271f3ef3ac7a3ac072a7 100644 (file)
@@ -159,9 +159,9 @@ func Getrlimit(resource int, rlim *Rlimit) (err error) {
        return
 }
 
-//sysnb setrlimit(resource int, rlim *rlimit32) (err error) = SYS_SETRLIMIT
+//sysnb setrlimit1(resource int, rlim *rlimit32) (err error) = SYS_SETRLIMIT
 
-func Setrlimit(resource int, rlim *Rlimit) (err error) {
+func setrlimit(resource int, rlim *Rlimit) (err error) {
        err = prlimit(0, resource, rlim, nil)
        if err != ENOSYS {
                return err
@@ -183,7 +183,34 @@ func Setrlimit(resource int, rlim *Rlimit) (err error) {
                return EINVAL
        }
 
-       return setrlimit(resource, &rl)
+       return setrlimit1(resource, &rl)
+}
+
+//go:nosplit
+func rawSetrlimit(resource int, rlim *Rlimit) Errno {
+       _, _, errno := RawSyscall6(SYS_PRLIMIT64, 0, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0, 0, 0)
+       if errno != ENOSYS {
+               return errno
+       }
+
+       rl := rlimit32{}
+       if rlim.Cur == rlimInf64 {
+               rl.Cur = rlimInf32
+       } else if rlim.Cur < uint64(rlimInf32) {
+               rl.Cur = uint32(rlim.Cur)
+       } else {
+               return EINVAL
+       }
+       if rlim.Max == rlimInf64 {
+               rl.Max = rlimInf32
+       } else if rlim.Max < uint64(rlimInf32) {
+               rl.Max = uint32(rlim.Max)
+       } else {
+               return EINVAL
+       }
+
+       _, _, errno = RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)
+       return errno
 }
 
 func (r *PtraceRegs) PC() uint64 { return uint64(r.Uregs[15]) }
index f42686262ac9302d1a9fc8da6de8e29b02cbeaec..42984ba2eddaa415d7bd917a188cf6f1b2105e75 100644 (file)
@@ -36,7 +36,7 @@ func Fstatat(fd int, path string, stat *Stat_t, flags int) error {
 //sys  sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
 //sys  Setfsgid(gid int) (err error)
 //sys  Setfsuid(uid int) (err error)
-//sysnb        setrlimit(resource int, rlim *Rlimit) (err error)
+//sysnb        setrlimit1(resource int, rlim *Rlimit) (err error)
 //sys  Shutdown(fd int, how int) (err error)
 //sys  Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
 
@@ -148,13 +148,23 @@ func Getrlimit(resource int, rlim *Rlimit) error {
        return getrlimit(resource, rlim)
 }
 
-// Setrlimit prefers the prlimit64 system call. See issue 38604.
-func Setrlimit(resource int, rlim *Rlimit) error {
+// setrlimit prefers the prlimit64 system call. See issue 38604.
+func setrlimit(resource int, rlim *Rlimit) error {
        err := prlimit(0, resource, rlim, nil)
        if err != ENOSYS {
                return err
        }
-       return setrlimit(resource, rlim)
+       return setrlimit1(resource, rlim)
+}
+
+//go:nosplit
+func rawSetrlimit(resource int, rlim *Rlimit) Errno {
+       _, _, errno := RawSyscall6(SYS_PRLIMIT64, 0, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0, 0, 0)
+       if errno != ENOSYS {
+               return errno
+       }
+       _, _, errno = RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)
+       return errno
 }
 
 func (r *PtraceRegs) PC() uint64 { return r.Pc }
index 5a0fa0834d0704bec0049b58690f3e8e8942947c..f8f01c2d225e50b6103ea91168bef3740c98124d 100644 (file)
@@ -187,11 +187,17 @@ func Getrlimit(resource int, rlim *Rlimit) error {
        return prlimit(0, resource, nil, rlim)
 }
 
-// Setrlimit prefers the prlimit64 system call.
-func Setrlimit(resource int, rlim *Rlimit) error {
+// setrlimit prefers the prlimit64 system call.
+func setrlimit(resource int, rlim *Rlimit) error {
        return prlimit(0, resource, rlim, nil)
 }
 
+//go:nosplit
+func rawSetrlimit(resource int, rlim *Rlimit) Errno {
+       _, _, errno := RawSyscall6(SYS_PRLIMIT64, 0, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0, 0, 0)
+       return errno
+}
+
 func (r *PtraceRegs) GetEra() uint64 { return r.Era }
 
 func (r *PtraceRegs) SetEra(era uint64) { r.Era = era }
index 8a0aa5c91e169503a25f46c84abd9bea5592cb45..47410d42601c6975c735aa9c8d18746b2b205891 100644 (file)
@@ -6,6 +6,10 @@
 
 package syscall
 
+import (
+       "unsafe"
+)
+
 const (
        _SYS_setgroups  = SYS_SETGROUPS
        _SYS_clone3     = 5435
@@ -33,7 +37,7 @@ const (
 //sys  sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
 //sys  Setfsgid(gid int) (err error)
 //sys  Setfsuid(uid int) (err error)
-//sysnb        Setrlimit(resource int, rlim *Rlimit) (err error)
+//sysnb        setrlimit(resource int, rlim *Rlimit) (err error) = SYS_SETRLIMIT
 //sys  Shutdown(fd int, how int) (err error)
 //sys  Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
 //sys  Statfs(path string, buf *Statfs_t) (err error)
@@ -89,6 +93,12 @@ func Time(t *Time_t) (tt Time_t, err error) {
 //sys  Utime(path string, buf *Utimbuf) (err error)
 //sys  utimes(path string, times *[2]Timeval) (err error)
 
+//go:nosplit
+func rawSetrlimit(resource int, rlim *Rlimit) Errno {
+       _, _, errno := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)
+       return errno
+}
+
 func setTimespec(sec, nsec int64) Timespec {
        return Timespec{Sec: sec, Nsec: nsec}
 }
index c8468fb5b596f6497e75dbaf5c1213cd5998e463..d8d5044b81aa632385e9648d4679ba7df66efc56 100644 (file)
@@ -152,9 +152,9 @@ func Getrlimit(resource int, rlim *Rlimit) (err error) {
        return
 }
 
-//sysnb setrlimit(resource int, rlim *rlimit32) (err error) = SYS_SETRLIMIT
+//sysnb setrlimit1(resource int, rlim *rlimit32) (err error) = SYS_SETRLIMIT
 
-func Setrlimit(resource int, rlim *Rlimit) (err error) {
+func setrlimit(resource int, rlim *Rlimit) (err error) {
        err = prlimit(0, resource, rlim, nil)
        if err != ENOSYS {
                return err
@@ -176,7 +176,34 @@ func Setrlimit(resource int, rlim *Rlimit) (err error) {
                return EINVAL
        }
 
-       return setrlimit(resource, &rl)
+       return setrlimit1(resource, &rl)
+}
+
+//go:nosplit
+func rawSetrlimit(resource int, rlim *Rlimit) Errno {
+       _, _, errno := RawSyscall6(SYS_PRLIMIT64, 0, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0, 0, 0)
+       if errno != ENOSYS {
+               return errno
+       }
+
+       rl := rlimit32{}
+       if rlim.Cur == rlimInf64 {
+               rl.Cur = rlimInf32
+       } else if rlim.Cur < uint64(rlimInf32) {
+               rl.Cur = uint32(rlim.Cur)
+       } else {
+               return EINVAL
+       }
+       if rlim.Max == rlimInf64 {
+               rl.Max = rlimInf32
+       } else if rlim.Max < uint64(rlimInf32) {
+               rl.Max = uint32(rlim.Max)
+       } else {
+               return EINVAL
+       }
+
+       _, _, errno = RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)
+       return errno
 }
 
 func (r *PtraceRegs) PC() uint64 { return uint64(r.Regs[64]) }
index 5c076d8beae356082357369a21394e8bce2fc826..36f7711dfa31185893775b5e5cd78851fcc514ca 100644 (file)
@@ -6,6 +6,10 @@
 
 package syscall
 
+import (
+       "unsafe"
+)
+
 const (
        _SYS_setgroups  = SYS_SETGROUPS
        _SYS_clone3     = 435
@@ -39,7 +43,7 @@ const (
 //sys  sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
 //sys  Setfsgid(gid int) (err error)
 //sys  Setfsuid(uid int) (err error)
-//sysnb        Setrlimit(resource int, rlim *Rlimit) (err error)
+//sysnb        setrlimit(resource int, rlim *Rlimit) (err error) = SYS_SETRLIMIT
 //sys  Shutdown(fd int, how int) (err error)
 //sys  Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
 //sys  Stat(path string, stat *Stat_t) (err error)
@@ -68,6 +72,12 @@ const (
 //sys  Utime(path string, buf *Utimbuf) (err error)
 //sys  utimes(path string, times *[2]Timeval) (err error)
 
+//go:nosplit
+func rawSetrlimit(resource int, rlim *Rlimit) Errno {
+       _, _, errno := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)
+       return errno
+}
+
 func setTimespec(sec, nsec int64) Timespec {
        return Timespec{Sec: sec, Nsec: nsec}
 }
index 3bb54600a83a24873ba118c66e77c5d3075ba7e8..44ff1d733e910b404554df1c41aa69357870c61d 100644 (file)
@@ -36,7 +36,7 @@ func Fstatat(fd int, path string, stat *Stat_t, flags int) error {
 //sys  sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
 //sys  Setfsgid(gid int) (err error)
 //sys  Setfsuid(uid int) (err error)
-//sysnb        Setrlimit(resource int, rlim *Rlimit) (err error)
+//sysnb        setrlimit(resource int, rlim *Rlimit) (err error) = SYS_SETRLIMIT
 //sys  Shutdown(fd int, how int) (err error)
 //sys  Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
 
@@ -143,6 +143,12 @@ func utimes(path string, tv *[2]Timeval) (err error) {
        return utimensat(_AT_FDCWD, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0)
 }
 
+//go:nosplit
+func rawSetrlimit(resource int, rlim *Rlimit) Errno {
+       _, _, errno := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)
+       return errno
+}
+
 func (r *PtraceRegs) PC() uint64 { return r.Pc }
 
 func (r *PtraceRegs) SetPC(pc uint64) { r.Pc = pc }
index cb83697be4c10a8ff04a95b8ecf4d4b6dc495917..44990f2b1bf99df81c1908403c4c184a91cfc01c 100644 (file)
@@ -36,7 +36,7 @@ const (
 //sys  sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
 //sys  Setfsgid(gid int) (err error)
 //sys  Setfsuid(uid int) (err error)
-//sysnb        Setrlimit(resource int, rlim *Rlimit) (err error)
+//sysnb        setrlimit(resource int, rlim *Rlimit) (err error) = SYS_SETRLIMIT
 //sys  Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
 //sys  Stat(path string, stat *Stat_t) (err error)
 //sys  Statfs(path string, buf *Statfs_t) (err error)
@@ -243,6 +243,12 @@ func Shutdown(s, how int) (err error) {
        return
 }
 
+//go:nosplit
+func rawSetrlimit(resource int, rlim *Rlimit) Errno {
+       _, _, errno := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)
+       return errno
+}
+
 func (r *PtraceRegs) PC() uint64 { return r.Psw.Addr }
 
 func (r *PtraceRegs) SetPC(pc uint64) { r.Psw.Addr = pc }
index 7f7c5b1c6bf4105bacebe3e5bbe454beafd8032a..333dd3ade67343ea5bc52467118955ad2ec98798 100644 (file)
@@ -224,7 +224,7 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
 //sys  Setpriority(which int, who int, prio int) (err error)
 //sysnb        Setregid(rgid int, egid int) (err error)
 //sysnb        Setreuid(ruid int, euid int) (err error)
-//sysnb        Setrlimit(which int, lim *Rlimit) (err error)
+//sysnb        setrlimit(which int, lim *Rlimit) (err error)
 //sysnb        Setsid() (pid int, err error)
 //sysnb        Settimeofday(tp *Timeval) (err error)
 //sysnb        Setuid(uid int) (err error)
index ba67ab1a57a27fd8f3a4a38149473ec19779c626..5784d5c583d718934abfabaeb8cff46df33ebbd1 100644 (file)
@@ -196,7 +196,7 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
 //sys  Setpriority(which int, who int, prio int) (err error)
 //sysnb        Setregid(rgid int, egid int) (err error)
 //sysnb        Setreuid(ruid int, euid int) (err error)
-//sysnb        Setrlimit(which int, lim *Rlimit) (err error)
+//sysnb        setrlimit(which int, lim *Rlimit) (err error)
 //sysnb        Setsid() (pid int, err error)
 //sysnb        Settimeofday(tp *Timeval) (err error)
 //sysnb        Setuid(uid int) (err error)
index 2cfb7f5d6a201c7360c8fdd60a78247cc779cf04..523a2a842977b22b404d85f59747d046bf15e904 100644 (file)
@@ -473,7 +473,7 @@ func sendmsgN(fd int, p, oob []byte, ptr unsafe.Pointer, salen _Socklen, flags i
 //sys  Setpriority(which int, who int, prio int) (err error)
 //sysnb        Setregid(rgid int, egid int) (err error)
 //sysnb        Setreuid(ruid int, euid int) (err error)
-//sysnb        Setrlimit(which int, lim *Rlimit) (err error)
+//sysnb        setrlimit(which int, lim *Rlimit) (err error)
 //sysnb        Setsid() (pid int, err error)
 //sysnb        Setuid(uid int) (err error)
 //sys  Shutdown(s int, how int) (err error) = libsocket.shutdown
index 56af51c48276fccfeaf9702fa41117598f1668b7..fb36fd33baf7581b5e84176f07a461a2e6b1c35e 100644 (file)
@@ -1271,7 +1271,7 @@ func Setreuid(ruid int, euid int) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Setrlimit(which int, lim *Rlimit) (err error) {
+func setrlimit(which int, lim *Rlimit) (err error) {
        _, _, e1 := rawSyscall6(uintptr(unsafe.Pointer(&libc_Setrlimit)), 2, uintptr(which), uintptr(unsafe.Pointer(lim)), 0, 0, 0, 0)
        if e1 != 0 {
                err = errnoErr(e1)
index 4872fbd529e99a060bf35e1fce1455ad0e9ed293..83680b381ad6a60541ebc8483e7e4b9050df5af5 100644 (file)
@@ -1480,7 +1480,7 @@ func libc_setreuid_trampoline()
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Setrlimit(which int, lim *Rlimit) (err error) {
+func setrlimit(which int, lim *Rlimit) (err error) {
        _, _, e1 := rawSyscall(abi.FuncPCABI0(libc_setrlimit_trampoline), uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
        if e1 != 0 {
                err = errnoErr(e1)
index 76d1ff84af2e245ffeadc86b49d3220b5b7b265b..08da23789ac5b72fef14bd931b07160fd70590b3 100644 (file)
@@ -1480,7 +1480,7 @@ func libc_setreuid_trampoline()
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Setrlimit(which int, lim *Rlimit) (err error) {
+func setrlimit(which int, lim *Rlimit) (err error) {
        _, _, e1 := rawSyscall(abi.FuncPCABI0(libc_setrlimit_trampoline), uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
        if e1 != 0 {
                err = errnoErr(e1)
index 5d5576d76ff64608d701aa5cee06a2f4323af85d..a591682b7dc6d76993bb9df53bc8d432088c3b9e 100644 (file)
@@ -1066,7 +1066,7 @@ func Setreuid(ruid int, euid int) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Setrlimit(which int, lim *Rlimit) (err error) {
+func setrlimit(which int, lim *Rlimit) (err error) {
        _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
        if e1 != 0 {
                err = errnoErr(e1)
index 3839dd707451a2ba142e59e1601a99d9f5fc6e15..e729adcc68aec1fa49e8c6f00ebe7f792339d97d 100644 (file)
@@ -1052,7 +1052,7 @@ func Setreuid(ruid int, euid int) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Setrlimit(which int, lim *Rlimit) (err error) {
+func setrlimit(which int, lim *Rlimit) (err error) {
        _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
        if e1 != 0 {
                err = errnoErr(e1)
index 109230216ccd859c26597b6330051698b7b53d0a..df0b817b2291088902024a8e1ccf95843c09e321 100644 (file)
@@ -1052,7 +1052,7 @@ func Setreuid(ruid int, euid int) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Setrlimit(which int, lim *Rlimit) (err error) {
+func setrlimit(which int, lim *Rlimit) (err error) {
        _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
        if e1 != 0 {
                err = errnoErr(e1)
index 53e48d5666c98b2fa0da3b3cb278ba0c1bf4b562..abd4bf1639977b6555aa5b8c3a890ef31e5d6fc4 100644 (file)
@@ -1052,7 +1052,7 @@ func Setreuid(ruid int, euid int) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Setrlimit(which int, lim *Rlimit) (err error) {
+func setrlimit(which int, lim *Rlimit) (err error) {
        _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
        if e1 != 0 {
                err = errnoErr(e1)
index 320ce1f76eed50e3d08f9be854792bf970a4a072..b86cfb5d85c5a90de90f57b34a2c6b41809cee6e 100644 (file)
@@ -1052,7 +1052,7 @@ func Setreuid(ruid int, euid int) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Setrlimit(which int, lim *Rlimit) (err error) {
+func setrlimit(which int, lim *Rlimit) (err error) {
        _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
        if e1 != 0 {
                err = errnoErr(e1)
index a63eafb4b457c086475eac3fe316cd18c35746ab..ad195e8cae7d15bd3ef12bbb28aa581b4ed59bf6 100644 (file)
@@ -1052,7 +1052,7 @@ func Setreuid(ruid int, euid int) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Setrlimit(which int, lim *Rlimit) (err error) {
+func setrlimit(which int, lim *Rlimit) (err error) {
        _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
        if e1 != 0 {
                err = errnoErr(e1)
index d57f0e980e6e6169cbf8239b7b689fb58a2ef488..8e0de44abff435a6430fba68bed197892c91f620 100644 (file)
@@ -701,7 +701,7 @@ func PivotRoot(newroot string, putold string) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) {
+func prlimit1(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) {
        _, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(newlimit)), uintptr(unsafe.Pointer(old)), 0, 0)
        if e1 != 0 {
                err = errnoErr(e1)
@@ -1401,7 +1401,7 @@ func getrlimit(resource int, rlim *rlimit32) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func setrlimit(resource int, rlim *rlimit32) (err error) {
+func setrlimit1(resource int, rlim *rlimit32) (err error) {
        _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)
        if e1 != 0 {
                err = errnoErr(e1)
index a895e55ee5b8c1bc61870dcfd52cffb1fbc0afe6..c3ee372fecbc3d3765a6393ef57e22ef32fefd29 100644 (file)
@@ -701,7 +701,7 @@ func PivotRoot(newroot string, putold string) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) {
+func prlimit1(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) {
        _, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(newlimit)), uintptr(unsafe.Pointer(old)), 0, 0)
        if e1 != 0 {
                err = errnoErr(e1)
@@ -1332,7 +1332,7 @@ func Setfsuid(uid int) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Setrlimit(resource int, rlim *Rlimit) (err error) {
+func setrlimit(resource int, rlim *Rlimit) (err error) {
        _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)
        if e1 != 0 {
                err = errnoErr(e1)
index 86d8e1c2d7e1b4f2b7548141b3fa50899e6d28ea..a72355f96f5a38c10ee7a8286dc16a3e210b9145 100644 (file)
@@ -701,7 +701,7 @@ func PivotRoot(newroot string, putold string) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) {
+func prlimit1(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) {
        _, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(newlimit)), uintptr(unsafe.Pointer(old)), 0, 0)
        if e1 != 0 {
                err = errnoErr(e1)
@@ -1604,7 +1604,7 @@ func getrlimit(resource int, rlim *rlimit32) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func setrlimit(resource int, rlim *rlimit32) (err error) {
+func setrlimit1(resource int, rlim *rlimit32) (err error) {
        _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)
        if e1 != 0 {
                err = errnoErr(e1)
index aed45ebe2559744dd8f5493068a0893718bac2e2..b7c7a38626adf372d4e7525d1443d6c6bd64c3b5 100644 (file)
@@ -701,7 +701,7 @@ func PivotRoot(newroot string, putold string) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) {
+func prlimit1(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) {
        _, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(newlimit)), uintptr(unsafe.Pointer(old)), 0, 0)
        if e1 != 0 {
                err = errnoErr(e1)
@@ -1302,7 +1302,7 @@ func Setfsuid(uid int) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func setrlimit(resource int, rlim *Rlimit) (err error) {
+func setrlimit1(resource int, rlim *Rlimit) (err error) {
        _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)
        if e1 != 0 {
                err = errnoErr(e1)
index 95ecce8a671af1f03782d0ac2a67206e2a2a1b32..51ebfc0eb9d947daefb7a935f5511c90ea5c62fb 100644 (file)
@@ -701,7 +701,7 @@ func PivotRoot(newroot string, putold string) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) {
+func prlimit1(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) {
        _, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(newlimit)), uintptr(unsafe.Pointer(old)), 0, 0)
        if e1 != 0 {
                err = errnoErr(e1)
index 3d7f0ce8ef330adaff0ac6dd65b15062e821e8ae..af75dc724a3f46666d1e0cb7ddaf0e3730875eb3 100644 (file)
@@ -701,7 +701,7 @@ func PivotRoot(newroot string, putold string) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) {
+func prlimit1(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) {
        _, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(newlimit)), uintptr(unsafe.Pointer(old)), 0, 0)
        if e1 != 0 {
                err = errnoErr(e1)
@@ -1679,7 +1679,7 @@ func getrlimit(resource int, rlim *rlimit32) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func setrlimit(resource int, rlim *rlimit32) (err error) {
+func setrlimit1(resource int, rlim *rlimit32) (err error) {
        _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)
        if e1 != 0 {
                err = errnoErr(e1)
index 98d50c593dfbf57b17eeb0d11a2f816493f1432a..c66730009bacfcb2ed082bbceec1e9a0bfad3596 100644 (file)
@@ -701,7 +701,7 @@ func PivotRoot(newroot string, putold string) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) {
+func prlimit1(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) {
        _, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(newlimit)), uintptr(unsafe.Pointer(old)), 0, 0)
        if e1 != 0 {
                err = errnoErr(e1)
@@ -1321,7 +1321,7 @@ func Setfsuid(uid int) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Setrlimit(resource int, rlim *Rlimit) (err error) {
+func setrlimit(resource int, rlim *Rlimit) (err error) {
        _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)
        if e1 != 0 {
                err = errnoErr(e1)
index b3e25aec2f6ccbb59e3f42d730d55335c1d8026a..407bea751ec107b75c2baa517da19249c4f32811 100644 (file)
@@ -701,7 +701,7 @@ func PivotRoot(newroot string, putold string) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) {
+func prlimit1(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) {
        _, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(newlimit)), uintptr(unsafe.Pointer(old)), 0, 0)
        if e1 != 0 {
                err = errnoErr(e1)
@@ -1321,7 +1321,7 @@ func Setfsuid(uid int) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Setrlimit(resource int, rlim *Rlimit) (err error) {
+func setrlimit(resource int, rlim *Rlimit) (err error) {
        _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)
        if e1 != 0 {
                err = errnoErr(e1)
index 1b4a4468f318838ebc02a2b181de541a0f89a196..7c5ea996681cba9bcf4c90794f6a9f44e49366ff 100644 (file)
@@ -701,7 +701,7 @@ func PivotRoot(newroot string, putold string) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) {
+func prlimit1(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) {
        _, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(newlimit)), uintptr(unsafe.Pointer(old)), 0, 0)
        if e1 != 0 {
                err = errnoErr(e1)
@@ -1679,7 +1679,7 @@ func getrlimit(resource int, rlim *rlimit32) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func setrlimit(resource int, rlim *rlimit32) (err error) {
+func setrlimit1(resource int, rlim *rlimit32) (err error) {
        _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)
        if e1 != 0 {
                err = errnoErr(e1)
index 1c521d0fcddc9f36a3d62a4cf4144dbda10fac31..1e82f4b45ccc2d4f99d0d43f72e051ddc8ab6a23 100644 (file)
@@ -701,7 +701,7 @@ func PivotRoot(newroot string, putold string) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) {
+func prlimit1(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) {
        _, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(newlimit)), uintptr(unsafe.Pointer(old)), 0, 0)
        if e1 != 0 {
                err = errnoErr(e1)
@@ -1394,7 +1394,7 @@ func Setfsuid(uid int) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Setrlimit(resource int, rlim *Rlimit) (err error) {
+func setrlimit(resource int, rlim *Rlimit) (err error) {
        _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)
        if e1 != 0 {
                err = errnoErr(e1)
index fc0f2ac00e6e9b99fcd4bfdb074c377def411a76..ddc1c8130ee43ebf8882af0c03ee9e56f91c5fcf 100644 (file)
@@ -701,7 +701,7 @@ func PivotRoot(newroot string, putold string) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) {
+func prlimit1(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) {
        _, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(newlimit)), uintptr(unsafe.Pointer(old)), 0, 0)
        if e1 != 0 {
                err = errnoErr(e1)
@@ -1394,7 +1394,7 @@ func Setfsuid(uid int) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Setrlimit(resource int, rlim *Rlimit) (err error) {
+func setrlimit(resource int, rlim *Rlimit) (err error) {
        _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)
        if e1 != 0 {
                err = errnoErr(e1)
index cc328fc100e302ff2a0efaad45d542bc95f7fc2b..c59cad035c82d4675320dbfe422483fc7f955c85 100644 (file)
@@ -701,7 +701,7 @@ func PivotRoot(newroot string, putold string) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) {
+func prlimit1(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) {
        _, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(newlimit)), uintptr(unsafe.Pointer(old)), 0, 0)
        if e1 != 0 {
                err = errnoErr(e1)
@@ -1302,7 +1302,7 @@ func Setfsuid(uid int) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Setrlimit(resource int, rlim *Rlimit) (err error) {
+func setrlimit(resource int, rlim *Rlimit) (err error) {
        _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)
        if e1 != 0 {
                err = errnoErr(e1)
index 3c5ee28941b645220db24202fc77c739a7c2db65..29be487f52db8aec400e2f4413e60544fec7eb76 100644 (file)
@@ -701,7 +701,7 @@ func PivotRoot(newroot string, putold string) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) {
+func prlimit1(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) {
        _, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(newlimit)), uintptr(unsafe.Pointer(old)), 0, 0)
        if e1 != 0 {
                err = errnoErr(e1)
@@ -1364,7 +1364,7 @@ func Setfsuid(uid int) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Setrlimit(resource int, rlim *Rlimit) (err error) {
+func setrlimit(resource int, rlim *Rlimit) (err error) {
        _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)
        if e1 != 0 {
                err = errnoErr(e1)
index 9b9285920601a801bc1f401c6b9825ee3b06d3f4..e401d02d0201f9f10a375a1dca20eb24756d70a0 100644 (file)
@@ -1030,7 +1030,7 @@ func Setreuid(ruid int, euid int) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Setrlimit(which int, lim *Rlimit) (err error) {
+func setrlimit(which int, lim *Rlimit) (err error) {
        _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
        if e1 != 0 {
                err = errnoErr(e1)
index ac34c00b5a293553e6116e0c7dd045e52ae60fae..a4f217b948fbda4814e86a1c649726cca73379ce 100644 (file)
@@ -1030,7 +1030,7 @@ func Setreuid(ruid int, euid int) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Setrlimit(which int, lim *Rlimit) (err error) {
+func setrlimit(which int, lim *Rlimit) (err error) {
        _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
        if e1 != 0 {
                err = errnoErr(e1)
index 2be5e7baa4d32e2a365e20f45e1a4898687a76b8..1f55614f64088afac15b721f8317b2089407ba27 100644 (file)
@@ -1030,7 +1030,7 @@ func Setreuid(ruid int, euid int) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Setrlimit(which int, lim *Rlimit) (err error) {
+func setrlimit(which int, lim *Rlimit) (err error) {
        _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
        if e1 != 0 {
                err = errnoErr(e1)
index 02a652bbbb24638359fdf3f75904d2b8ab77f234..be33fcd4128e782c627007fd0c49bf4a02c0e33a 100644 (file)
@@ -1030,7 +1030,7 @@ func Setreuid(ruid int, euid int) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Setrlimit(which int, lim *Rlimit) (err error) {
+func setrlimit(which int, lim *Rlimit) (err error) {
        _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
        if e1 != 0 {
                err = errnoErr(e1)
index 953e9616a8b50a3ef255b4b72e8bdd20eeb93709..714fa7e0a51fd0328c9f10a58baf14b1ba369c91 100644 (file)
@@ -1387,7 +1387,7 @@ func libc_setreuid_trampoline()
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Setrlimit(which int, lim *Rlimit) (err error) {
+func setrlimit(which int, lim *Rlimit) (err error) {
        _, _, e1 := rawSyscall(abi.FuncPCABI0(libc_setrlimit_trampoline), uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
        if e1 != 0 {
                err = errnoErr(e1)
index 8bc7f3d213c3dd7523d5b1db435f78f4e0e0b971..f948d64839a8bb892ea2133a676653d3fcf02e69 100644 (file)
@@ -1387,7 +1387,7 @@ func libc_setreuid_trampoline()
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Setrlimit(which int, lim *Rlimit) (err error) {
+func setrlimit(which int, lim *Rlimit) (err error) {
        _, _, e1 := rawSyscall(abi.FuncPCABI0(libc_setrlimit_trampoline), uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
        if e1 != 0 {
                err = errnoErr(e1)
index 8184436200aded492ba876947a6fcc704de83075..f56fcc4f81a4f5b82741507b64149797b7283a4d 100644 (file)
@@ -1387,7 +1387,7 @@ func libc_setreuid_trampoline()
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Setrlimit(which int, lim *Rlimit) (err error) {
+func setrlimit(which int, lim *Rlimit) (err error) {
        _, _, e1 := rawSyscall(abi.FuncPCABI0(libc_setrlimit_trampoline), uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
        if e1 != 0 {
                err = errnoErr(e1)
index fe17521e808e5ca403931c96f96eb2ba40646a48..c0d8f5cd17a09e7789420de4abd6d296b520f369 100644 (file)
@@ -1387,7 +1387,7 @@ func libc_setreuid_trampoline()
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Setrlimit(which int, lim *Rlimit) (err error) {
+func setrlimit(which int, lim *Rlimit) (err error) {
        _, _, e1 := rawSyscall(abi.FuncPCABI0(libc_setrlimit_trampoline), uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
        if e1 != 0 {
                err = errnoErr(e1)
index 2cf84653191b57e5797f8f2087a8a76b46a71959..2a91c3683136930887247c1a81a0d2f85ea3ece4 100644 (file)
@@ -1039,7 +1039,7 @@ func Setreuid(ruid int, euid int) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Setrlimit(which int, lim *Rlimit) (err error) {
+func setrlimit(which int, lim *Rlimit) (err error) {
        _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
        if e1 != 0 {
                err = errnoErr(e1)
index 19e5ec1fcd3643ac878e19d49ec86b39c0d9fb05..e25db63eba926ec9607158929d3c154168310653 100644 (file)
@@ -962,7 +962,7 @@ func Setreuid(ruid int, euid int) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Setrlimit(which int, lim *Rlimit) (err error) {
+func setrlimit(which int, lim *Rlimit) (err error) {
        _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&libc_Setrlimit)), 2, uintptr(which), uintptr(unsafe.Pointer(lim)), 0, 0, 0, 0)
        if e1 != 0 {
                err = errnoErr(e1)