Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "include.h"
- void saber_pid();{
- printf ("PID = %d\n", getpid() );
- }
- void recebe_sinal(int sinal){
- int d = lyftadmin.pid;
- int f = condutores.txt;
- FILE*d=dopen("lyftadmin.pid","w");
- FILE*f=fopen("condutores.txt","w");
- if ( f == NULL ) {
- if( d == NULL) {
- printf("SIGUSR1");
- printf("O Ficheiro estΓ‘ alterado %d\n");
- }
- }
- int main() {
- void saber_pid();
- signal ( SIGUSR1, recebe_sinal );
- void recebe_sinal(int sinal);
- //printf("PID=%d\n", getpid("lyftadmin.pid") );
- exit(0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement