Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <errno.h>
  3.  
  4. /* inccluded from signaml.h */
  5. #define SIGKILL 9
  6. #define SIGTERM 15
  7. /* included from kill.h */
  8. #define kill(sig,pid) skill(sig,pid)
  9. #define skill(sig,pid) _kill(k##sig,pid)
  10.  
  11. /* included from errno.h */
  12. #define ENOK 4
  13.  
  14. /* included from stdio.h */
  15. FILE *k9, *k15;
  16. int _kill(int *pid,FILE *k)
  17. {
  18. if(!k) { errno = ENOK; return -1; }
  19. fwrite(pid,sizeof(int),1,k);
  20. fflush(k);
  21. struct kstat stat;
  22. int n = fread(&stat,sizeof(stat),1,k);
  23. errno = stat.errno;
  24. return 1-n;
  25. }
  26. int test(void) {
  27. kill(SIGKILL,123);
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement