/* ulimit.c (rsxnt) -- Copyright (c) 1996-1997 Rainer Schnitker */

#include "rsxnt.h"

long __ulimit (int cmd, long new_limit)
{
    EMXPROCESS *p = _rsxnt_get_process_ptr();

    switch (cmd) {

    case UL_GMEMLIM:
        return (long) p->heap_end;

    case UL_OBJREST:
        return (long) p->heap_end - (long) p->heap_start;

    default:
        return _rsxnt_errno(EINVAL);

    }
}
