I am playing with Go and setrlimit(). Here is some code from a test that executes after setting RLIMIT_NPROC to 0:

        err = exec.Command("true").Run()
if e, ok := err.(*os.PathError); !ok || e.Err.(unix.Errno) != unix.EAGAIN {
                t.Error(err.Error())
        }

/* Test succeeded: Run failed with EAGAIN as the process (thread) limit is exceeded. */

This seems to work, but I am surprised that Run() returns an os.PathError rather than an os.SyscallError. I would expect EAGAIN to be the latter.

Is this intentional? I guess I am looking for the reason for this so that my mind can more easily remember it.

Thank you!

--
Mike

:wq

--
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/20200328150650.E38C24E9%40smtp-auth.no-ip.com.

Reply via email to