version 1.290, 2016/03/18 12:43:48
|
version 1.299, 2016/08/26 08:57:56
|
Line 1
|
Line 1
|
#define DEBUG_ERREURS |
|
/* |
/* |
================================================================================ |
================================================================================ |
RPL/2 (R) version 4.1.25 |
RPL/2 (R) version 4.1.25 |
Line 273
|
Line 272
|
# define __STATIC_MUTEX_INITIALIZATION__ |
# define __STATIC_MUTEX_INITIALIZATION__ |
#endif |
#endif |
|
|
|
|
/* |
/* |
================================================================================ |
================================================================================ |
Bugs spécifiques |
Bugs spécifiques |
Line 529 union semun
|
Line 529 union semun
|
__EXTERN__ pthread_mutex_t mutex_sem __STATIC_MUTEX_INITIALIZATION__; |
__EXTERN__ pthread_mutex_t mutex_sem __STATIC_MUTEX_INITIALIZATION__; |
|
|
__EXTERN__ volatile int routine_recursive; |
__EXTERN__ volatile int routine_recursive; |
|
__EXTERN__ volatile int nombre_thread_surveillance_processus; |
|
|
# define SEM_FORK 0 |
# define SEM_FORK 0 |
# define SEM_QUEUE 1 |
# define SEM_QUEUE 1 |
Line 596 union semun
|
Line 597 union semun
|
# define fflush(flux) fflush((flux == stdout) ? stderr : flux) |
# define fflush(flux) fflush((flux == stdout) ? stderr : flux) |
#endif |
#endif |
|
|
// Ajout d'un timeout sur les fonctions pipe() pour éviter une erreur |
|
// système dans le cas où l'on a atteint le nombre maximale de fichiers |
|
// ouverts. |
|
|
|
#define pipe(descripteurs) \ |
|
({ \ |
|
struct timespec temporisation; \ |
|
int erreur, nombre_echecs; \ |
|
nombre_echecs = 0; \ |
|
do \ |
|
{ \ |
|
if ((erreur = pipe(descripteurs)) == 0) break; \ |
|
nombre_echecs++; \ |
|
temporisation.tv_sec = 0; \ |
|
temporisation.tv_nsec = ((long) 1000000000) * rand(); \ |
|
nanosleep(&temporisation, NULL); \ |
|
} while(nombre_echecs < 100); \ |
|
erreur; \ |
|
}) |
|
|
|
// Redéfinition de abs pour un fonctionnement en entier de type long long int |
// Redéfinition de abs pour un fonctionnement en entier de type long long int |
|
|
#ifdef __GNUC__ |
#ifdef __GNUC__ |
Line 816 pid_t debug_fork();
|
Line 797 pid_t debug_fork();
|
# else |
# else |
# define __erreur_(i) i |
# define __erreur_(i) i |
# endif |
# endif |
# define __erreur(i) ({ if (strstr(__FUNCTION__, "recherche_variable") \ |
# define __erreur(i) ({ int ios; ios = errno; \ |
== NULL) ufprintf(stderr, \ |
if (strstr(__FUNCTION__, "recherche_variable") \ |
"ERROR %d AT %s() FROM %s LINE %d\n", \ |
== NULL) { if(ios != 0) \ |
i, __FUNCTION__, __FILE__, __LINE__); BACKTRACE(16); i; }) |
ufprintf(stderr, "LAST ERROR: %s\n", strerror(ios)); \ |
|
ufprintf(stderr, "ERROR %d AT %s() FROM %s LINE %d\n", \ |
|
i, __FUNCTION__, __FILE__, __LINE__); BACKTRACE(16); } i; }) |
# endif |
# endif |
#else |
#else |
# define __erreur(i) i |
# define __erreur(i) i |
# define __erreur_(i) i |
# define __erreur_(i) i |
#endif |
#endif |
|
|
|
#ifdef DEBUG_FICHIERS |
|
# define open(a, ...) \ |
|
({ ufprintf(stderr, "[%d] OPEN %s AT %s() FROM %s LINE %d\n", \ |
|
getpid(), a, \ |
|
__FUNCTION__, __FILE__, __LINE__); open(a, __VA_ARGS__); }) |
|
# define pipe(a) \ |
|
({ ufprintf(stderr, "[%d] PIPE %s AT %s() FROM %s LINE %d\n", \ |
|
getpid(), a, \ |
|
__FUNCTION__, __FILE__, __LINE__); pipe(a); }) |
|
# define shm_open(a, ...) \ |
|
({ ufprintf(stderr, "[%d] SHM_OPEN %s AT %s() FROM %s LINE %d\n", \ |
|
getpid(), a, \ |
|
__FUNCTION__, __FILE__, __LINE__); shm_open(a, __VA_ARGS__); }) |
|
# define shm_unlink(a) \ |
|
({ ufprintf(stderr, "[%d] SHM_UNLINK %s AT %s() FROM %s LINE %d\n", \ |
|
getpid(), a, \ |
|
__FUNCTION__, __FILE__, __LINE__); shm_unlink(a); }) |
|
# define sem_open(a, ...) \ |
|
({ ufprintf(stderr, "[%d] SEM_OPEN %s AT %s() FROM %s LINE %d\n", \ |
|
getpid(), a, \ |
|
__FUNCTION__, __FILE__, __LINE__); sem_open(a, __VA_ARGS__); }) |
|
# define sem_unlink(a) \ |
|
({ ufprintf(stderr, "[%d] SEM_UNLINK %s AT %s() FROM %s LINE %d\n", \ |
|
getpid(), a, \ |
|
__FUNCTION__, __FILE__, __LINE__); sem_unlink(a); }) |
|
# define close(a) \ |
|
({ ufprintf(stderr, "[%d] CLOSE %s AT %s() FROM %s LINE %d\n", \ |
|
getpid(), a, \ |
|
__FUNCTION__, __FILE__, __LINE__); close(a); }) |
|
#endif |
|
|
// -1 : erreur provoquée par une bibliothèque externe |
// -1 : erreur provoquée par une bibliothèque externe |
#ifndef RPLARGS |
#ifndef RPLARGS |