version 1.169, 2016/03/16 12:19:34
|
version 1.170, 2016/03/17 16:31:36
|
Line 2780 envoi_signal_processus(pid_t pid, enum s
|
Line 2780 envoi_signal_processus(pid_t pid, enum s
|
// À ce moment, le segment de mémoire partagée est projeté |
// À ce moment, le segment de mémoire partagée est projeté |
// dans l'espace du processus. |
// dans l'espace du processus. |
|
|
|
|
if ((semaphore = sem_open2(pid, SEM_QUEUE)) == SEM_FAILED) |
if ((semaphore = sem_open2(pid, SEM_QUEUE)) == SEM_FAILED) |
{ |
{ |
|
# ifndef IPCS_SYSV // POSIX |
|
if (msync(queue, sizeof(queue), MS_ASYNC | MS_INVALIDATE) != 0) |
|
{ |
|
munmap(queue, sizeof(struct_queue_signaux)); |
|
return(1); |
|
} |
|
|
|
if (munmap(queue, sizeof(struct_queue_signaux)) != 0) |
|
{ |
|
close(segment); |
|
return(1); |
|
} |
|
# else // IPCS_SYSV |
|
# ifndef OS2 // SysV |
|
if (shmdt(queue) != 0) |
|
{ |
|
return(1); |
|
} |
|
# else // OS/2 |
|
// Pendant de DosGetNamedSHaredMem() |
|
# endif |
|
# endif |
|
|
return(1); |
return(1); |
} |
} |
|
|
if ((signalisation = sem_open2(pid, SEM_SIGNALISATION)) |
if ((signalisation = sem_open2(pid, SEM_SIGNALISATION)) |
== SEM_FAILED) |
== SEM_FAILED) |
{ |
{ |
|
# ifndef IPCS_SYSV // POSIX |
|
if (msync(queue, sizeof(queue), MS_ASYNC | MS_INVALIDATE) != 0) |
|
{ |
|
munmap(queue, sizeof(struct_queue_signaux)); |
|
return(1); |
|
} |
|
|
|
if (munmap(queue, sizeof(struct_queue_signaux)) != 0) |
|
{ |
|
close(segment); |
|
return(1); |
|
} |
|
# else // IPCS_SYSV |
|
# ifndef OS2 // SysV |
|
if (shmdt(queue) != 0) |
|
{ |
|
return(1); |
|
} |
|
# else // OS/2 |
|
// Pendant de DosGetNamedSHaredMem() |
|
# endif |
|
# endif |
|
|
|
sem_close(semaphore); |
return(1); |
return(1); |
} |
} |
|
|
Line 2795 envoi_signal_processus(pid_t pid, enum s
|
Line 2843 envoi_signal_processus(pid_t pid, enum s
|
{ |
{ |
if (errno != EINTR) |
if (errno != EINTR) |
{ |
{ |
|
# ifndef IPCS_SYSV // POSIX |
|
if (msync(queue, sizeof(queue), MS_ASYNC | MS_INVALIDATE) |
|
!= 0) |
|
{ |
|
munmap(queue, sizeof(struct_queue_signaux)); |
|
return(1); |
|
} |
|
|
|
if (munmap(queue, sizeof(struct_queue_signaux)) != 0) |
|
{ |
|
close(segment); |
|
return(1); |
|
} |
|
# else // IPCS_SYSV |
|
# ifndef OS2 // SysV |
|
if (shmdt(queue) != 0) |
|
{ |
|
return(1); |
|
} |
|
# else // OS/2 |
|
// Pendant de DosGetNamedSHaredMem() |
|
# endif |
|
# endif |
|
|
sem_close(semaphore); |
sem_close(semaphore); |
sem_close(signalisation); |
sem_close(signalisation); |
return(1); |
return(1); |
Line 2807 envoi_signal_processus(pid_t pid, enum s
|
Line 2879 envoi_signal_processus(pid_t pid, enum s
|
(*queue).pointeur_ecriture = ((*queue).pointeur_ecriture + 1) |
(*queue).pointeur_ecriture = ((*queue).pointeur_ecriture + 1) |
% LONGUEUR_QUEUE_SIGNAUX; |
% LONGUEUR_QUEUE_SIGNAUX; |
|
|
# ifndef IPCS_SYSV |
|
if (msync(queue, sizeof(queue), MS_ASYNC | MS_INVALIDATE) != 0) |
|
{ |
|
sem_close(semaphore); |
|
sem_close(signalisation); |
|
return(1); |
|
} |
|
# endif |
|
|
|
if (sem_post(semaphore) != 0) |
if (sem_post(semaphore) != 0) |
{ |
{ |
|
# ifndef IPCS_SYSV // POSIX |
|
if (msync(queue, sizeof(queue), MS_ASYNC | MS_INVALIDATE) != 0) |
|
{ |
|
munmap(queue, sizeof(struct_queue_signaux)); |
|
return(1); |
|
} |
|
|
|
if (munmap(queue, sizeof(struct_queue_signaux)) != 0) |
|
{ |
|
close(segment); |
|
return(1); |
|
} |
|
# else // IPCS_SYSV |
|
# ifndef OS2 // SysV |
|
if (shmdt(queue) != 0) |
|
{ |
|
return(1); |
|
} |
|
# else // OS/2 |
|
// Pendant de DosGetNamedSHaredMem() |
|
# endif |
|
# endif |
|
|
sem_close(semaphore); |
sem_close(semaphore); |
sem_close(signalisation); |
sem_close(signalisation); |
return(1); |
return(1); |
Line 2825 envoi_signal_processus(pid_t pid, enum s
|
Line 2911 envoi_signal_processus(pid_t pid, enum s
|
|
|
if (sem_close(semaphore) != 0) |
if (sem_close(semaphore) != 0) |
{ |
{ |
|
# ifndef IPCS_SYSV // POSIX |
|
if (msync(queue, sizeof(queue), MS_ASYNC | MS_INVALIDATE) != 0) |
|
{ |
|
munmap(queue, sizeof(struct_queue_signaux)); |
|
return(1); |
|
} |
|
|
|
if (munmap(queue, sizeof(struct_queue_signaux)) != 0) |
|
{ |
|
close(segment); |
|
return(1); |
|
} |
|
# else // IPCS_SYSV |
|
# ifndef OS2 // SysV |
|
if (shmdt(queue) != 0) |
|
{ |
|
return(1); |
|
} |
|
# else // OS/2 |
|
// Pendant de DosGetNamedSHaredMem() |
|
# endif |
|
# endif |
|
|
|
sem_close(signalisation); |
return(1); |
return(1); |
} |
} |
|
|
if (sem_post(signalisation) != 0) |
if (sem_post(signalisation) != 0) |
{ |
{ |
|
# ifndef IPCS_SYSV // POSIX |
|
if (msync(queue, sizeof(queue), MS_ASYNC | MS_INVALIDATE) != 0) |
|
{ |
|
munmap(queue, sizeof(struct_queue_signaux)); |
|
return(1); |
|
} |
|
|
|
if (munmap(queue, sizeof(struct_queue_signaux)) != 0) |
|
{ |
|
close(segment); |
|
return(1); |
|
} |
|
# else // IPCS_SYSV |
|
# ifndef OS2 // SysV |
|
if (shmdt(queue) != 0) |
|
{ |
|
return(1); |
|
} |
|
# else // OS/2 |
|
// Pendant de DosGetNamedSHaredMem() |
|
# endif |
|
# endif |
|
|
sem_close(signalisation); |
sem_close(signalisation); |
return(1); |
return(1); |
} |
} |
|
|
if (sem_close(signalisation) != 0) |
if (sem_close(signalisation) != 0) |
{ |
{ |
|
# ifndef IPCS_SYSV // POSIX |
|
if (msync(queue, sizeof(queue), MS_ASYNC | MS_INVALIDATE) != 0) |
|
{ |
|
munmap(queue, sizeof(struct_queue_signaux)); |
|
return(1); |
|
} |
|
|
|
if (munmap(queue, sizeof(struct_queue_signaux)) != 0) |
|
{ |
|
close(segment); |
|
return(1); |
|
} |
|
# else // IPCS_SYSV |
|
# ifndef OS2 // SysV |
|
if (shmdt(queue) != 0) |
|
{ |
|
return(1); |
|
} |
|
# else // OS/2 |
|
// Pendant de DosGetNamedSHaredMem() |
|
# endif |
|
# endif |
|
|
return(1); |
return(1); |
} |
} |
|
|
# ifndef IPCS_SYSV // POSIX |
# ifndef IPCS_SYSV // POSIX |
|
if (msync(queue, sizeof(queue), MS_ASYNC | MS_INVALIDATE) != 0) |
|
{ |
|
munmap(queue, sizeof(struct_queue_signaux)); |
|
return(1); |
|
} |
|
|
if (munmap(queue, sizeof(struct_queue_signaux)) != 0) |
if (munmap(queue, sizeof(struct_queue_signaux)) != 0) |
{ |
{ |
close(segment); |
close(segment); |
Line 3316 destruction_queue_signaux(struct_process
|
Line 3478 destruction_queue_signaux(struct_process
|
|
|
sem_post(semaphore_signalisation); |
sem_post(semaphore_signalisation); |
arret_thread_signaux(s_etat_processus); |
arret_thread_signaux(s_etat_processus); |
|
pthread_join((*s_queue_signaux).thread_signaux, NULL); |
|
|
# ifdef IPCS_SYSV // SystemV |
# ifdef IPCS_SYSV // SystemV |
# ifndef OS2 |
# ifndef OS2 |