#define _POSIX_C_SOURCE 1 #include #include #include #include #define AFFICHER(n, m) afficher(#n, n, m) static void afficher(char *nom, int code, char *description); int main(void) { printf("POSIX %ld / options disponibles :\n", sysconf(_SC_VERSION)); AFFICHER(_SC_ASYNCHRONOUS_IO, "E/S asynchrones"); AFFICHER(_SC_FSYNC, "Synchronisation des fichiers"); AFFICHER(_SC_JOB_CONTROL, "Contrôle de tâches"); AFFICHER(_SC_MAPPED_FILES, "Correspondance mémoire/fichier"); AFFICHER(_SC_MEMLOCK, "Verrouillage mémoire"); AFFICHER(_SC_MEMLOCK_RANGE, "Verrouillage de portions de mémoire"); AFFICHER(_SC_MEMORY_PROTECTION, "Protection mémoire"); AFFICHER(_SC_MESSAGE_PASSING, "File de messages"); AFFICHER(_SC_PRIORITIZED_IO, "E/S à priorité définissable"); AFFICHER(_SC_PRIORITY_SCHEDULING, "Ordonnancement"); AFFICHER(_SC_REALTIME_SIGNALS, "Signaux temps réel"); AFFICHER(_SC_SAVED_IDS, "Sauvegarde uid/gid"); AFFICHER(_SC_SEMAPHORES, "Sémaphores"); AFFICHER(_SC_SHARED_MEMORY_OBJECTS, "Mémoire partagée"); AFFICHER(_SC_SYNCHRONIZED_IO, "E/S synchronisées"); AFFICHER(_SC_TIMERS, "Timer"); return EXIT_SUCCESS; } static void afficher(char *nom, int code, char *description) { if (sysconf(code) != -1) printf("- %s (%s)\n", description, nom); }