.\" -*- coding: UTF-8 -*- .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) .\" .\" %%%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 .\" .\" References consulted: .\" Linux libc source code .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) .\" 386BSD man pages .\" Single UNIX Specification, Version 2 .\" Modified Thu Apr 8 15:00:12 1993, David Metcalfe .\" Modified Sat Jul 24 18:44:45 1993, Rik Faith (faith@cs.unc.edu) .\" Modified Fri Feb 14 21:47:50 1997 by Andries Brouwer (aeb@cwi.nl) .\" Modified Mon Oct 11 11:11:11 1999 by Andries Brouwer (aeb@cwi.nl) .\" Modified Wed Nov 10 00:02:26 1999 by Andries Brouwer (aeb@cwi.nl) .\" Modified Sun May 20 22:17:20 2001 by Andries Brouwer (aeb@cwi.nl) .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH PUTENV 3 "6 mars 2019" GNU "Manuel du programmeur Linux" .SH NOM putenv \- Ajouter ou modifier une variable d'environnement .SH SYNOPSIS .nf \fB#include \fP .PP .\" Not: const char * \fBint putenv(char *\fP\fIstring\fP\fB);\fP .fi .PP .RS -4 Exigences de macros de test de fonctionnalités pour la glibc (consulter \fBfeature_test_macros\fP(7))\ : .RE .PP \fBputenv\fP()\ : _XOPEN_SOURCE || /* Depuis la glibc\ 2.19\ : */ _DEFAULT_SOURCE || /* Versions de la glibc <= 2.19\ : */ _SVID_SOURCE .SH DESCRIPTION La fonction \fBputenv\fP() ajoute ou modifie la valeur d'une variable d'environnement. L'argument \fIstring\fP est une chaîne de caractères de la forme \fInom\fP=\fIvaleur\fP. Si \fInom\fP n'existe pas dans l'environnement, \fIstring\fP est ajoutée. Si \fInom\fP existe, alors la valeur de de \fInom\fP est remplacée par \fIvaleur\fP. La chaîne pointée par \fIstring\fP devient partie intégrante de l'environnement, ainsi une modification de cette chaîne change l'environnement. .SH "VALEUR RENVOYÉE" La fonction \fBputenv\fP() renvoie \fB0\fP si elle réussit. En cas d'erreur, une valeur non nulle est renvoyée et \fIerrno\fP contient le code d'erreur. .SH ERREURS .TP \fBENOMEM\fP Pas assez de mémoire. .SH ATTRIBUTS Pour une explication des termes utilisés dans cette section, consulter \fBattributes\fP(7). .TS allbox; lb lb lb l l l. Interface Attribut Valeur T{ \fBputenv\fP() T} Sécurité des threads MT\-Unsafe const:env .TE .SH CONFORMITÉ POSIX.1\-2001, POSIX.1\-2008, SVr4, 4.3BSD. .SH NOTES .\" .LP .\" Description for libc4, libc5, glibc: .\" If the argument \fIstring\fP is of the form \fIname\fP, .\" and does not contain an \(aq=\(aq character, then the variable \fIname\fP .\" is removed from the environment. .\" If .\" .BR putenv () .\" has to allocate a new array \fIenviron\fP, .\" and the previous array was also allocated by .\" .BR putenv (), .\" then it will be freed. .\" In no case will the old storage associated .\" to the environment variable itself be freed. La fonction \fBputenv\fP() n'a pas besoin d'être réentrante, celle de la glibc\ 2.0 ne l'est pas, contrairement à celle de la glibc\ 2.1. .PP Depuis la version\ 2.1.2, la glibc se conforme aux spécifications SUSv2\ : le pointeur \fIstring\fP transmis à \fBputenv\fP() est utilisé. En particulier, cette chaîne devient partie intégrante de l'environnement\ ; si elle est modifiée par la suite, l'environnement sera modifié (c'est donc une erreur d'appeler \fBputenv\fP() avec une variable automatique en argument puis renvoyer à partir de la fonction appelante alors que la chaîne est toujours dans l'environnement). Toutefois, les versions\ 2.0\ à\ 2.1.1 de la glibc diffèrent\ : une copie de la chaîne est utilisée. Cela crée d'une part une fuite mémoire et d'autre part viole les spécifications SUSv2. .PP La version 4.4BSD, comme celle de la glibc\ 2.0, effectue aussi une copie. .PP Dans les spécifications SUSv2, le \fIconst\fP a été supprimé du prototype. C'est aussi le cas dans glibc\ 2.1.3. .PP L'implémentation de la bibliothèque C GNU fournit une extension non standard. Si \fIstring\fP ne comporte pas de signe égal\ : .PP .in +4n .EX putenv("NAME"); .EE .in .PP alors la variable nommée est supprimée de l'environnement de l'appelant. .SH "VOIR AUSSI" \fBclearenv\fP(3), \fBgetenv\fP(3), \fBsetenv\fP(3), \fBunsetenv\fP(3), \fBenviron\fP(7) .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/. .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 Grégoire Scano . 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. 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 .