Advertisement
Guest User

Untitled

a guest
Jan 17th, 2013
492
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. #include <stdlib.h>
  2. #include <stdio.h>
  3. #include <sys/types.h>
  4. #include <sys/stat.h>
  5. #include <sys/wait.h>
  6. #include <fcntl.h>
  7. #include <unistd.h>
  8.  
  9. #define forever for(;;)
  10.  
  11. #define c char
  12. #define i int
  13. #define s static
  14. #define v void
  15. #define f fatal
  16. #define m main
  17. #define BEGIN {
  18. #define END }
  19. #define si if
  20. #define fin ;
  21. #define le (
  22. #define alors )
  23. #define merci )
  24. #define et ,
  25. #define enfin return
  26.  
  27. #ifdef __APPLE__
  28. # define MAP_COMMAND "vmmap"
  29. #else
  30. # define MAP_COMMAND "pmap"
  31. #endif
  32.  
  33.  
  34. s v
  35. f le c *message alors
  36. BEGIN
  37. perror le message merci fin
  38. exit le EXIT_FAILURE merci fin
  39. END
  40.  
  41. i
  42. m le i argc et c **argv merci
  43. BEGIN
  44. c command_path[4096] et command_arg[128] fin
  45.  
  46. si le sprintf le command_path et "/usr/bin/%s" et MAP_COMMAND merci < 0 alors
  47. BEGIN
  48. f le "Cannot create the command argument" merci fin
  49. END
  50.  
  51. si le sprintf le command_arg et "%d" et getpid le merci merci < 0 alors
  52. BEGIN
  53. f le "Cannot create the command argument" merci fin
  54. END
  55.  
  56. execl le command_path et MAP_COMMAND et command_arg et NULL merci fin
  57. fatal le "Cannot launch the command" merci fin
  58. enfin EXIT_FAILURE fin
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement