.\" -*- coding: UTF-8 -*- .\" Copyright (c) 1993 .\" The Regents of the University of California. All rights reserved. .\" .\" %%%LICENSE_START(BSD_4_CLAUSE_UCB) .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. All advertising materials mentioning features or use of this software .\" must display the following acknowledgement: .\" This product includes software developed by the University of .\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" %%%LICENSE_END .\" .\" @(#)daemon.3 8.1 (Berkeley) 6/9/93 .\" Added mentioning of glibc weirdness wrt unistd.h. 5/11/98, Al Viro .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH DAEMON 3 "26 novembre 2017" GNU "Manuale del programmatore di Linux" .SH NOME daemon \- esegue sullo sfondo .SH SINTASSI \fB#include \fP .PP \fBint daemon(int \fP\fInochdir\fP\fB, int \fP\fInoclose\fP\fB);\fP .PP .RS -4 Macro per test di funzionalità per glibc (vedere \fBfeature_test_macros\fP(7)): .RE .PP \fBdaemon\fP(): .nf .\" commit 266865c0e7b79d4196e2cc393693463f03c90bd8 A partire de glibc 2.21: _DEFAULT_SOURCE In glibc 2.19 e 2.20: _DEFAULT_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500) Fino a glibc 2.19 incluso: _BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500) .fi .SH DESCRIZIONE La funzione \fBdaemon\fP() è utilizzata dai programmi che vogliono staccarsi dal terminale di controllo e stare in esecuzione sullo sfondo come demoni di sistema. .PP Se \fInochdir\fP è zero, \fBdaemon\fP() cambia la directory di lavoro corrente del processo alla directory radice ("/"); altrimenti, la directory di lavoro corrente rimane invariata. .PP Se \fInoclose\fP è zero, \fBdaemon\fP() redireziona lo standard input, lo standard output e lo standard error a \fI/dev/null\fP; altrimenti, non vengono apportata variazioni a questi descrittori di file. .SH "VALORE RESTITUITO" .\" not .IR in order not to underline _ (Questa funzione esegue un fork, e se il \fBfork\fP(2) ha successo, il genitore chiama \fB_exit\fP(2), in modo che errori successivi vengano visti solo dal figlio.) In caso di successo \fBdaemon\fP) restituisce zero. Se si verifica un errore, \fBdaemon\fP() restituisce \-1 e imposta \fIerrno\fP ad uno qualunque degli errori specificati per \fBfork\fP(2) e \fBsetsid\fP(2). .SH ATTRIBUTI Per la spiegazione dei termini usati in questa sezione, vedere \fBattributes\fP(7). .TS allbox; lb lb lb l l l. Interfaccia Attributo Valore T{ \fBdaemon\fP() T} Thread safety MT\-Safe .TE .SH "CONFORME A" Non presente in POSIX.1. Una funzione simile è presente sui sistemi BSD. La funzione \fBdaemon\fP() apparve per la prima volta in 4.4BSD. .SH NOTE L'implementazione di glibc può anche restituire \-1 quando \fI/dev/null\fP esiste ma non è un dispositivo a caratteri con i numeri maggiore e minore che ci si aspetterebbe. In questo caso \fIerrno\fP non ha bisogno di essere impostato. .SH BUG .\" FIXME . https://sourceware.org/bugzilla/show_bug.cgi?id=19144 .\" Tested using a program that uses daemon() and then opens an .\" otherwise unused console device (/dev/ttyN) that does not .\" have an associated getty process. L'implementazione GNU C Library di questa funzione è stata presa da BSD, e non impiega la tecnica del doppio fork (cioè, \fBfork\fP(2), \fBsetsid\fP(2), \fBfork\fP(2)) che è necessaria per essere sicuri che il processo demone risultante non sia un leader di sessione. Invece, il demone risultante \fIè\fP un leader di sessione. Sui sistemi che seguono la semantica di System V (p.es. Linux), questo vuol dire che se il demone apre un terminale che non è già un terminale di controllo per un'altra sessione, il terminale diventa involontariamente il terminale di controllo per il demone. .SH "VEDERE ANCHE" \fBfork\fP(2), \fBsetsid\fP(2), \fBdaemon\fP(7), \fBlogrotate\fP(8) .SH COLOPHON Questa pagina fa parte del rilascio 5.10 del progetto Linux \fIman\-pages\fP. Una descrizione del progetto, le istruzioni per la segnalazione degli errori, e l'ultima versione di questa pagina si trovano su \%https://www.kernel.org/doc/man\-pages/. .SH TRADUZIONE La traduzione italiana di questa pagina di manuale è stata creata da Giordano Neri e Marco Curreli . Questa traduzione è documentazione libera; leggere la .UR https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Versione 3 .UE o successiva per le condizioni di copyright. Non ci assumiamo alcuna responsabilità. Per segnalare errori nella traduzione di questa pagina di manuale inviare un messaggio a .MT pluto-ildp@lists.pluto.it .ME .