/*************************************************************************************************************************************/
/* */
/* V E R I F I C A T I O N D E L ' E T A T D E C E R T A I N E S R E S S O U R C E S D U S Y S T E M E : */
/* */
/* */
/* Author of '$xcg/ressource.04$I' : */
/* */
/* Jean-Francois Colonna (LACTAMME, 1995??????????). */
/* */
/*************************************************************************************************************************************/
/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/* */
/* V E R I F I C A T I O N " N E U T R E " : */
/* */
/*************************************************************************************************************************************/
#define ACCES_NEUTRE \
Bblock \
BLOC(VIDE;); \
Eblock \
/* Fonction "neutre". */
TEST_COMMANDE(COMMANDE_NEUTRE
,BLOC(ACCES_NEUTRE;
)
);
/* Commande "neutre". */
/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/* */
/* V E R I F I C A T I O N D E L ' E T A T D U " S W A P " D U S Y S T E M E : */
/* */
/*************************************************************************************************************************************/
#define ACCES_AU_SWAP(seuil1,seuil2) \
Bblock \
PRINT_ERREUR("la commande de 'swap' n'est pas implementee sur ce SYSTEME"); \
Eblock \
/* Fonction non implementee a priori... */
#if ( ((defined(SYSTEME_SGIND308_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGIND324_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGIND3GA_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGIND408_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGIND424_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGIND4GA_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGIND508_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGIND524_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGIND5GA_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGIND808_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGIND824_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGIND8GA_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGINDA08_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGINDA24_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGINDAGA_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGO200A1_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGO200A2_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGO200A4_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGO25224_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGO252VA_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGO252VN_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGPCM801_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGPCMA01_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
)
/* ATTENTION, il est impossible de mettre ici : */
/* */
/* @ include <sys/stat.h> */
/* @ include <sys/swap.h> */
/* */
/* car, en effet, cela introduit des 'typedef' dans du code executable, ce qui est */
/* interdit... */
# define CONVERSION_EN_MEGA_OCTETS(valeur) \
DIVI(FRA2(FLOT(valeur)),FLOT(DEUXp10)) \
/* Conversion d'un nombre de blocs de 512 octets en un nombre entier par defaut de */ \
/* mega-octets. */
# undef ACCES_AU_SWAP
# define ACCES_AU_SWAP(seuil1,seuil2) \
Bblock \
DEFV(Int,INIT(GETFREESWAP,UNDEF)); \
/* 'amount of free swap'. */ \
DEFV(Int,INIT(GETSWAPMAX,UNDEF)); \
/* 'maximum amount of physical swap'. */ \
DEFV(Int,INIT(GETSWAPVIRT,UNDEF)); \
/* 'amount of virtual swap'. */ \
DEFV(Int,INIT(GETRESVSWAP,UNDEF)); \
/* 'amount of reserved logical swap'. */ \
DEFV(Int,INIT(GETSWAPTOT,UNDEF)); \
/* 'current amount of physical swap'. */ \
DEFV(Int,INIT(GETLSWAPTOT,UNDEF)); \
/* 'amount of logical swap'. */ \
\
DEFV(Float,INIT(freeswap,FLOT__UNDEF)); \
DEFV(Float,INIT(vswap,FLOT__UNDEF)); \
DEFV(Float,INIT(reserve,FLOT__UNDEF)); \
/* Et les valeurs flottantes a tester. On notera qu'une valeur negative de 'reserve' */ \
/* peut entrainer des "deadlocks"... */ \
\
CALS(swapctl(SC_GETFREESWAP,&GETFREESWAP)); \
CALS(swapctl(SC_GETSWAPMAX,&GETSWAPMAX)); \
CALS(swapctl(SC_GETSWAPVIRT,&GETSWAPVIRT)); \
CALS(swapctl(SC_GETRESVSWAP,&GETRESVSWAP)); \
CALS(swapctl(SC_GETSWAPTOT,&GETSWAPTOT)); \
CALS(swapctl(SC_GETLSWAPTOT,&GETLSWAPTOT)); \
/* Acces a la valeur courante des compteurs systeme (meme si tous ne sont pas utiles...). */ \
\
EGAL(freeswap,CONVERSION_EN_MEGA_OCTETS(GETFREESWAP)); \
EGAL(vswap,CONVERSION_EN_MEGA_OCTETS(SOUS(GETLSWAPTOT,GETRESVSWAP))); \
EGAL(reserve,CONVERSION_EN_MEGA_OCTETS(SOUS(SOUS(GETLSWAPTOT,GETSWAPMAX),GETRESVSWAP))); \
/* Conversion flottante... */ \
\
Test(IL_FAUT(editer_les_valeurs)) \
Bblock \
CAL3(Prme1("freeswap=%.1f\n",freeswap)); \
CAL3(Prme1("vswap=%.1f\n",vswap)); \
CAL3(Prme1("reserve=%.1f\n",reserve)); \
Eblock \
ATes \
Bblock \
Eblock \
ETes \
\
Test(IFOU(IFLE(reserve,seuil1),IFLE(vswap,seuil2))) \
Bblock \
EGAL(tout_va_bien,FAUX); \
Eblock \
ATes \
Bblock \
Eblock \
ETes \
Eblock \
/* Fonction d'acces au swap. */
#Aif ( ((defined(SYSTEME_SGIND308_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGIND324_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGIND3GA_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGIND408_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGIND424_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGIND4GA_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGIND508_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGIND524_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGIND5GA_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGIND808_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGIND824_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGIND8GA_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGINDA08_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGINDA24_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGINDAGA_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGO200A1_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGO200A2_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGO200A4_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGO25224_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGO252VA_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGO252VN_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGPCM801_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGPCMA01_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
)
#Eif ( ((defined(SYSTEME_SGIND308_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGIND324_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGIND3GA_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGIND408_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGIND424_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGIND4GA_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGIND508_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGIND524_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGIND5GA_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGIND808_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGIND824_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGIND8GA_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGINDA08_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGINDA24_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGINDAGA_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGO200A1_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGO200A2_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGO200A4_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGO25224_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGO252VA_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGO252VN_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGPCM801_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
|| ((defined(SYSTEME_SGPCMA01_IRIX_CC)) && ((nSYSTEM_RELEASE >= 500000000) && (nSYSTEM_RELEASE < 600000000))) \
)
TEST_COMMANDE(COMMANDE_SWAP
,BLOC(ACCES_AU_SWAP(Fdonnees1,Fdonnees2);
)
);
/* Commande d'acces au swap. */
Copyright © Jean-François Colonna, 2019-2021.
Copyright © CMAP (Centre de Mathématiques APpliquées) UMR CNRS 7641 / Ecole Polytechnique, 2019-2021.