.\" -*- 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 "15. März 2016" 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(): .nf .\" commit 266865c0e7b79d4196e2cc393693463f03c90bd8 Seit Glibc 2.21: _DEFAULT_SOURCE In Glibc 2.19 und 2.20: _DEFAULT_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500) Bis einschließlich Glibc 2.19: _BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500) .fi .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 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 Siehe \fBattributes\fP(7) für eine Erläuterung der in diesem Abschnitt verwandten Ausdrücke. .TS allbox; lb lb lb l l l. Schnittstelle Attribut Wert T{ \fBdaemon\fP() T} Multithread\-Fähigkeit MT\-Safe .TE .SH "KONFORM ZU" Nicht in POSIX.1. 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 FEHLER .\" 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. Die GNU\-C\-Bibliotheksimplementierung dieser Funktion entstammt BSD und verwendet nicht die Zweifach\-Fork\-Technik (d.h. \fBfork\fP(2), \fBsetsid\fP(2), \fBfork\fP(2)), die notwendig ist, um sicherzustellen, dass der entstandene Daemon kein Sitzungsleiter ist. Der entstandene Daemon \fIist\fP ein Sitzungsleiter. Auf Systemen, die der System\-V\-Semantik gehorchen (z.B. Linux) bedeutet diese, dass ein Terminal unabsichtlich das steuernde Terminal für den Daemon wird, falls der Daemon dieses Terminal öffnet, welches nicht bereits ein steuerndes Terminal für eine andere Sitzung ist. .SH "SIEHE AUCH" \fBfork\fP(2), \fBsetsid\fP(2) .SH KOLOPHON Diese Seite ist Teil der Veröffentlichung 4.09 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 \%https://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 .