def rlimitTestAndSet(name, limit):
 (soft, hard) = getrlimit(name)
 if (soft < limit):
  hardLimit = (hard if (limit < hard) else limit)
  setrlimit(name, (limit, hardLimit))

def rlimitTestAndSet ( name , limit ) : ( soft , hard ) = getrlimit ( name ) if ( soft < limit ) : hardLimit = ( hard if ( limit < hard ) else limit ) setrlimit ( name , ( limit , hardLimit ) )
helper function to set rlimits .