.\" -*- coding: UTF-8 -*- '\" t .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) .\" .\" SPDX-License-Identifier: Linux-man-pages-copyleft .\" .\" 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 "20 juillet 2023" "Pages du manuel de Linux 6.05.01" .SH NOM putenv \- Ajouter ou modifier une variable d'environnement .SH BIBLIOTHÈQUE Bibliothèque C standard (\fIlibc\fP, \fI\-lc\fP) .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()\ : .nf _XOPEN_SOURCE || /* glibc >= 2.19 : */ _DEFAULT_SOURCE || /* glibc <= 2.19 : */ _SVID_SOURCE .fi .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; lbx lb lb l l l. Interface Attribut Valeur T{ .na .nh \fBputenv\fP() T} Sécurité des threads MT\-Unsafe const:env .TE .sp 1 .SH STANDARDS POSIX.1\-2008. .SH HISTORIQUE POSIX.1\-2001, SVr2, 4.3BSD\-Reno. .PP .\" .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 Since glibc 2.1.2, the glibc implementation conforms to SUSv2: the pointer \fIstring\fP given to \fBputenv\fP() is used. In particular, this string becomes part of the environment; changing it later will change the environment. (Thus, it is an error to call \fBputenv\fP() with an automatic variable as the argument, then return from the calling function while \fIstring\fP is still part of the environment.) However, from glibc 2.0 to glibc 2.1.1, it differs: a copy of the string is used. On the one hand this causes a memory leak, and on the other hand it violates SUSv2. .PP The 4.3BSD\-Reno version, like glibc 2.0, uses a copy; this is fixed in all modern BSDs. .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) .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 Grégoire Scano . .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 .