.\" -*- coding: UTF-8 -*- .\" Copyright (c) 2015 William Woodruff (william@tuffbizz.com) .\" .\" %%%LICENSE_START(VERBATIM) .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one. .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" %%%LICENSE_END .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH GET_PHYS_PAGES 3 "1 novembre 2020" GNU "Manuel du programmeur Linux" .SH NOM get_phys_pages, get_avphys_pages \- Obtenir le nombre total de pages de mémoire physique et le nombre de pages disponibles .SH SYNOPSIS .nf \fB#include \fP .PP \fBlong get_phys_pages(void);\fP \fBlong get_avphys_pages(void);\fP .fi .SH DESCRIPTION La fonction \fBget_phys_pages\fP() renvoie le nombre total de pages de mémoire physique disponibles sur le système. .PP La fonction \fBget_avphys_pages\fP() renvoie le nombre de pages de mémoire physique actuellement disponibles sur le système. .SH "VALEUR RENVOYÉE" En cas de succès, ces fonctions renvoient une valeur non négative comme indiqué dans DESCRIPTION. En cas d'erreur, elles renvoient \fB\-1\fP et définissent \fIerrno\fP de façon à préciser la nature de l'erreur. .SH ERREURS .TP \fBENOSYS\fP Le système n'a pas pu fournir les informations demandées (peut\-être parce que le système de fichiers \fI/proc\fP n'était pas monté). .SH CONFORMITÉ Ces fonctions sont des extensions GNU. .SH NOTES Ces fonctions obtiennent les informations demandées en consultant les champs \fIMemTotal\fP et \fIMemFree\fP de \fI/proc/meminfo\fP. .PP Les appels à \fBsysconf\fP(3) suivants permettent d'obtenir de manière portable les mêmes informations qu'avec les fonctions décrites dans cette page. .PP .in +4n .EX total_pages = sysconf(_SC_PHYS_PAGES); /* nombre total de pages */ avl_pages = sysconf(_SC_AVPHYS_PAGES); /* nombre de pages disponibles */ .EE .in .SH EXEMPLES L'exemple suivant montre comment utiliser \fBget_phys_pages\fP() et \fBget_avphys_pages\fP(). .PP .EX #include #include #include int main(int argc, char *argv[]) { printf("Ce système possède %ld pages de mémoire physique et " "%ld pages sont disponibles.\en", get_phys_pages(), get_avphys_pages()); exit(EXIT_SUCCESS); } .EE .SH "VOIR AUSSI" \fBsysconf\fP(3) .SH COLOPHON Cette page fait partie de la publication\ 5.10 du projet \fIman\-pages\fP Linux. Une description du projet et des instructions pour signaler des anomalies et la dernière version de cette page peuvent être trouvées à l'adresse \%https://www.kernel.org/doc/man\-pages/. .PP .SH TRADUCTION La traduction française de cette page de manuel a été créée par Christophe Blaess , Stéphan Rafin , Thierry Vignaud , François Micaux, Alain Portal , Jean-Philippe Guérard , Jean-Luc Coulon (f5ibh) , Julien Cristau , Thomas Huriaux , Nicolas François , Florentin Duneau , Simon Paillard , Denis Barbier , David Prévot et Lucien Gentis . .PP Cette traduction est une documentation libre ; veuillez vous reporter à la .UR https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License version 3 .UE concernant les conditions de copie et de distribution. Il n'y a aucune RESPONSABILITÉ LÉGALE. .PP Si vous découvrez un bogue dans la traduction de cette page de manuel, veuillez envoyer un message à .MT debian-l10n-french@lists.debian.org .ME .