.\" -*- 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 "28. Oktober 2013" GNU Linux\-Programmierhandbuch .SH BEZEICHNUNG daemon \- im Hintergrund ausführen .SH ÜBERSICHT \fB#include \fP .sp \fBint daemon(int \fP\fInochdir\fP\fB, int \fP\fInoclose\fP\fB);\fP .sp .in -4n Mit Glibc erforderliche Makros (siehe \fBfeature_test_macros\fP(7)): .in .sp \fBdaemon\fP(): _BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500) .SH BESCHREIBUNG Die Funktion \fBdaemon\fP() gibt einem Programm die Möglichkeit, sich selbst vom Terminal in den Hintergrund zu setzen und dort weiter als System\-Daemon zu laufen. .PP Wenn \fInochdir\fP gleich Null ist, macht \fBdaemon\fP() das Wurzelverzeichnis (»/«, root directory) zum Arbeitsverzeichnis des aufrufenden Prozesses; anderenfalls bleibt das Arbeitsverzeichnis unverändert. .PP Wenn \fInoclose\fP gleich Null ist, leitet \fBdaemon\fP() die Standardausgabe, die Standardeingabe und die Fehlerausgabe nach \fI/dev/null\fP um; anderenfalls werden keine Änderungen an den Dateideskriptoren vorgenommen. .SH RÜCKGABEWERT .\" not .IR in order not to underline _ (Diese Funktion ruft \fBfork\fP(2) auf. Wenn der Aufruf erfolgreich ist, ruft der Elternprozess \fB_exit\fP(2) auf, so dass nur der Kindprozess über weitere Fehler informiert wird.) Bei Erfolg gibt \fBdaemon\fP() Null zurück. Wenn ein Fehler auftritt, gibt \fBdaemon\fP() \-1 zurück und setzt \fIerrno\fP auf einen für \fBfork\fP(2) und \fBsetsid\fP(2) beschriebenen Wert. .SH ATTRIBUTE .SS "Multithreading (siehe pthreads(7))" Die Funktion \fBdaemon\fP() ist multithread\-fähig. .SH "KONFORM ZU" Nicht in POSIX.1\-2001. Eine ähnliche Funktion kommt in den BSDs vor. Die \fBdaemon\fP()\-Funktion erschien erstmals in 4.4BSD. .SH ANMERKUNGEN Die Glibc\-Implementierung kann auch \-1 zurückgeben, wenn \fI/dev/null\fP existiert, aber kein zeichenorientiertes Gerät ist und die Haupt\- und Nebennummern (major/minor numbers) abweichen. .SH "SIEHE AUCH" \fBfork\fP(2), \fBsetsid\fP(2) .SH KOLOPHON Diese Seite ist Teil der Veröffentlichung 3.74 des Projekts Linux\-\fIman\-pages\fP. Eine Beschreibung des Projekts, Informationen, wie Fehler gemeldet werden können sowie die aktuelle Version dieser Seite finden sich unter \%http://www.kernel.org/doc/man\-pages/. .SH ÜBERSETZUNG Die deutsche Übersetzung dieser Handbuchseite wurde von Dennis Stampfer und Martin Eberhard Schauer erstellt. Diese Übersetzung ist Freie Dokumentation; lesen Sie die GNU General Public License Version 3 oder neuer bezüglich der Copyright-Bedingungen. Es wird KEINE HAFTUNG übernommen. Wenn Sie Fehler in der Übersetzung dieser Handbuchseite finden, schicken Sie bitte eine E-Mail an .