SHARE
TWEET

Untitled

a guest Oct 20th, 2019 87 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #define getProcName _getProcName
  2. #include <lib.h>
  3. #include <unistd.h>
  4. #include <errno.h>
  5.  
  6. PUBLIC int getProcName (index, namestr)
  7.     int index;
  8.     char *namestr;
  9. {      
  10.     message m;
  11.     if(index > NR_PROCS || index < 0){
  12.         errno = EINVAL;
  13.         return (-1);
  14.     }  
  15.     m.m1_i1 = index;
  16.     if(_syscall(PM_PROC_NR,GETPROCNAME, &m) < 0) return (-1);
  17.     strcpy(namestr,m.m3_ca1);
  18.     return 0;
  19. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top