Advertisement
Guest User

Untitled

a guest
Nov 16th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. #include "include.h"
  2.  
  3.  
  4. void saber_pid();{
  5. printf ("PID = %d\n", getpid() );
  6.  
  7. }
  8.  
  9. void recebe_sinal(int sinal){
  10. int d = lyftadmin.pid;
  11. int f = condutores.txt;
  12. FILE*d=dopen("lyftadmin.pid","w");
  13. FILE*f=fopen("condutores.txt","w");
  14. if ( f == NULL ) {
  15. if( d == NULL) {
  16. printf("SIGUSR1");
  17. printf("O Ficheiro estΓ‘ alterado %d\n");
  18.  
  19. }
  20.  
  21. }
  22.  
  23. int main() {
  24. void saber_pid();
  25. signal ( SIGUSR1, recebe_sinal );
  26. void recebe_sinal(int sinal);
  27. //printf("PID=%d\n", getpid("lyftadmin.pid") );
  28. exit(0);
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement