internal static void SetResourceLimits(RlimitResources id, ulong value) { RLimit t = new RLimit(); int r1 = GetRLimit(id, out t); ulong hard_limit = t.MaximumLimit; t = new RLimit(); t.CurrentLimit = Math.Min(value, hard_limit); t.MaximumLimit = hard_limit; int r2 = SetRLimit(id, ref t); t = new RLimit(); t.CurrentLimit = value; t.MaximumLimit = value; int r3 = SetRLimit(id, ref t); }
internal static extern int SetRLimit(RlimitResources resourceType, ref RLimit limits);
internal static extern int GetRLimit(RlimitResources resourceType, out RLimit limits);
internal static partial int SetRLimit(RlimitResources resourceType, ref RLimit limits);
internal static partial int GetRLimit(RlimitResources resourceType, out RLimit limits);