syscopy.c

来自「.添加系统调用.采用编译内核的方法」· C语言 代码 · 共 14 行

C
14
字号
#include <errno.h>
#include <stdio.h>
#include </usr/src/linux-2.4.20-8/include/asm-i386/unistd.h>
#define __NR_mycopy   259 
_syscall2(int,mycopy,const char *,s_file,const char *,t_file)  
int main(int argc,char * argv[])
{
    if(argc < 3|| mycopy(argv[1],argv[2]) < 0) { 
      printf("Failed to copy file!\n");
	    exit(-1);
    }
 	exit(0);
}	

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?