setrlimit

#include < sys/time.h >
#include < sys/resource.h >

#include < unistd.h >
#include < stdio.h >

int main()
{
    struct rlimit rlim;
    
    rlim.rlim_cur = 1;
    rlim.rlim_max = 2;
    if (setrlimit(RLIMIT_CPU, &rlim) < 0){
        perror("setrlimit");
        return 1;
    }
    
    for(;;){
        chdir(".");
    }
    return 0;
}

libsystem_kernel.dylib`chdir:
0x7fff8cd39b38 <+0>: movl $0x200000c, %eax
0x7fff8cd39b3d <+5>: movq %rcx, %r10
0x7fff8cd39b40 <+8>: syscall
-> 0x7fff8cd39b42 <+10>: jae 0x7fff8cd39b4c ; <+20>
0x7fff8cd39b44 <+12>: movq %rax, %rdi
0x7fff8cd39b47 <+15>: jmp 0x7fff8cd34c53 ; cerror_nocancel
0x7fff8cd39b4c <+20>: retq
0x7fff8cd39b4d <+21>: nop
0x7fff8cd39b4e <+22>: nop
0x7fff8cd39b4f <+23>: nop