GCC how to block system calls within a program?

后端 未结 6 1148
别那么骄傲
别那么骄傲 2021-02-10 06:24

Does anyone tell me how to block some specific system calls within a program, please? I am building a system which takes a piece of C source code, compiles it with gcc and runs

6条回答
  •  轮回少年
    2021-02-10 07:20

    Just to illustrate that this is not possible, the following program:

    int main() {
        return 0;
    }
    

    makes over 20 system calls as reported using strace. The calls include open (twice) which is one of the calls you seem to want to block.

提交回复
热议问题