我在ubuntu服务器上通过CIFS安装了Windows共享.我需要知道何时将新文件添加到Windows共享中.我试过这个inotify程序:
http://www.thegeekstuff.com/2010/04/inotify-c-program-example/
哪个适用于标准目录,但无法捕获任何CIFS更改.我不一定需要使用inotify,虽然我想,但任何有关如何完成获取文件创建通知的建议都会很棒.
编辑(制作进展):
我试图ptrace一个vsftpd守护进程.我有以下代码附加到守护程序.然后它成功显示第一个衍生进程的PID.但是,对于这个衍生进程的子进程,它返回PID为2,3,..程序确实捕获了生成进程的退出,这让我觉得我很接近.
有任何想法吗?
void * trace_process(void * pid){
pid_t child = atoi((char *) pid);
long orig_eax, eax;
int status;
int callmade = FALSE;
long opt = PTRACE_O_TRACEFORK;
long newpid;
long trace = ptrace(PTRACE_ATTACH,child,NULL,NULL);
ptrace(PTRACE_SETOPTIONS,child,NULL,opt);
if(trace == FALSE)
printf("Attached to %d\n",child);
while(TRUE) {
child = waitpid(-1, &status, __WALL);
if (status >> 16 == PTRACE_EVENT_FORK) {
ptrace(PTRACE_GETEVENTMSG, child, NULL, (long) &newpid);
ptrace(PTRACE_SYSCALL, newpid, NULL, NULL);
printf("Attached to offspring %ld\n", newpid);
}
else{
if(WIFEXITED(status))
printf("Child %d exited\n", child);
}
ptrace(PTRACE_SYSCALL,child, NULL, NULL);
} …Run Code Online (Sandbox Code Playgroud) 当一个系统调用返回时,我得到了%eax中的系统调用的返回值,但是在进入我得到-38,这是0xFFFFFFDA十六进制.这适用于写/读.这个号码是多少?它可以用来安全地区分出口和出口吗?
我想做这样的事情:在3d空间中的http://matplotlib.sourceforge.net/_images/86cbd17f31.png.基本上我想要突出表面图的一部分.有什么建议?