Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Seems Python handles this correctly (by raising an exception):

    >>> resource.setrlimit(resource.RLIMIT_NPROC, (0, 0))
    >>> os.fork()
    Traceback (most recent call last):
      File "<ipython-input-7-348c6e46312a>", line 1, in <module>
        os.fork()
    OSError: [Errno 11] Resource temporarily unavailable


There are plenty of little nice things like this in python that save you. So if you're porting python code to other platforms... be very careful!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: