Linux process API using C# in Mono -


i know possible code c# .net apps in linux using mono. however, wondering process interfaces of linux. use services getpid(), getppid() , fork() using c# , mono , running on linux environment?

for getpid() , getppid() use syscall in way:

using system; using mono.unix.native;  namespace stackoverflow {     class mainclass     {         public static void main(string[] args)         {             int pid = syscall.getpid();             int ppid = syscall.getppid();              console.writeline ("pid: {0}", pid);             console.writeline ("ppid: {0}", ppid);         }     } } 

you need mono.posix.dll

for fork() can use process. see example here: creating child process c#

documentation process class c#.


Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -

php - $params->set Array between square bracket -