Hi all,

look at my code restricts_the_process.c:

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

    int
    main() {

        if(pledge("",NULL) == -1)
                   err(1,"pledge");

        printf("Pledged\n");

        return 0;

    }

I try to compile and run:

    $ gcc -o restricts_the_process restricts_the_process.c

    $ ./restricts_the_process

    $ Abort trap (core dumped)

    $ ls -la

    -rw-------       1 deface  deface  191640 Apr 25 10:40 restricts_the_pr.core     -rwxr-xr-x     1 deface  deface    12448 Apr 25 10:24 restricts_the_process     -rw-r--r--       1 deface  deface        160 Apr 25 10:22 restricts_the_process.c

Its ok, because of promises value of "" restricts the process to the _exit(2) system call. (man 2)

but why the dumped core file has named like (restricts_the_pr.core) and not restricts_the_process.core?

Could you be so kind to explain me this issue?

BR

Oleg Pahl

Sorry for my English.

Reply via email to