File: daemon.3

package info (click to toggle)
manpages-pl 1%3A0.7-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 22,276 kB
  • ctags: 7
  • sloc: sh: 112; makefile: 59; perl: 32
file content (135 lines) | stat: -rw-r--r-- 6,449 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
.\" 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.
.\"
.\"*******************************************************************
.\" This file is distributed under the same license as original manpage
.\" Copyright of the original manpage:
.\" Copyright © 1993 The Regents of the University of California (BSD-4-clause)
.\" Copyright © of Polish translation:
.\" Andrzej Krzysztofowicz (PTM) <ankry@mif.pg.gda.pl>, 2001.
.\" Robert Luberda <robert@debian.org>, 2013.
.\" Michał Kułach <michal.kulach@gmail.com>, 2014, 2016.
.TH DAEMON 3 2016\-03\-15 GNU "Podręcznik programisty Linuksa"
.SH NAZWA
daemon \- uruchamianie w tle
.SH SKŁADNIA
\fB#include <unistd.h>\fP
.sp
\fBint daemon(int \fP\fInochdir\fP\fB, int \fP\fInoclose\fP\fB);\fP
.sp
.in -4n
Wymagane ustawienia makr biblioteki glibc (patrz \fBfeature_test_macros\fP(7)):
.in
.sp
\fBdaemon\fP():
.nf
.\"             commit 266865c0e7b79d4196e2cc393693463f03c90bd8
    Od glibc 2.21:
        _DEFAULT_SOURCE
    W glibc 2.19 i 2.20:
        _DEFAULT_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500)
    Do glibc 2.19 włącznie:
        _BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500)
.fi
.SH OPIS
Funkcja \fBdaemon\fP()  jest przeznaczona dla programów, które chcą odłączyć
się od sterującego nimi terminala i działać w tle jako demony systemowe.
.PP
Jeśli argument \fInochdir\fP będzie zerem, to \fBdaemon\fP() zmieni bieżący
katalog roboczy na katalog główny ("/"). W przeciwnym wypadku bieżący
katalog roboczy nie jest zmieniany.
.PP
Jeśli argument \fInoclose\fP będzie zerem, to \fBdaemon\fP() przekieruje
standardowe wejście, standardowe wyjście i standardową diagnostykę do
\fI/dev/null\fP. W przeciwnym wypadku podane deskryptory plików nie są
zmieniane.
.SH "WARTOŚĆ ZWRACANA"
.\" not .IR in order not to underline _
(Ta funkcja rozwidla się i jeśli \fBfork\fP(2) się powiedzie, rodzic wykonuje
\fB_exit\fP(2), tak, że dalsze błędy są widziane tylko przez potomka). W
przypadku pomyślnego zakończenia, zwracane jest zero  Jeśli wystąpi błąd,
\fBdaemon\fP()  zwróci \-1 i ustawi \fIerrno\fP na jeden z błędów określonych dla
\fBfork\fP(2) i \fBsetsid\fP(2).
.SH ATRYBUTY
Informacje o pojęciach używanych w tym rozdziale można znaleźć w podręczniku
\fBattributes\fP(7).
.TS
allbox;
lb lb lb
l l l.
Interfejs	Atrybut	Wartość
T{
\fBdaemon\fP()
T}	Bezpieczeństwo wątkowe	MT\-Safe
.TE
.SH "ZGODNE Z"
Funkcja nie występuje w POSIX.1. Podobna funkcja pojawia się w systemach
BSD. Funkcja \fBdaemon\fP() po raz pierwszy pojawiła się w 4.4BSD.
.SH UWAGI
Implementacja w glibc może również zwrócić \-1 gdy \fI/dev/null\fP istnieje, ale
nie jest urządzeniem znakowym o oczekiwanych numerach głównym i pobocznym. W
tym przypadku nie ma potrzeby ustawiania \fIerrno\fP.
.SH BŁĘDY
.\" 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.
Implementacja biblioteki C GNU dla tej funkcji została zapożyczona z BSD i
nie korzysta z techniki podwójnego rozwidlania (tzn. \fBfork\fP(2),
\fBsetsid\fP(2), \fBfork\fP(2)) koniecznej dla zapewnienia, że wynikowy proces
demona nie jest liderem sesji. Zamiast tego, wynikowy demon \fIjest\fP liderem
sesji. W systemach korzystających z semantyki Systemu V (np. Linux), oznacza
to, że gdy demon otwiera terminal który nie jest jeszcze kontrolującym
terminalem dla innej sesji, to ten terminal po cichu zostanie kontrolującym
terminalem dla demona.
.SH "ZOBACZ TAKŻE"
\fBfork\fP(2), \fBsetsid\fP(2)
.SH "O STRONIE"
Angielska wersja tej strony pochodzi z wydania 4.07 projektu Linux
\fIman\-pages\fP. Opis projektu, informacje dotyczące zgłaszania błędów oraz
najnowszą wersję oryginału można znaleźć pod adresem
\%https://www.kernel.org/doc/man\-pages/.
.SH TŁUMACZENIE
Autorami polskiego tłumaczenia niniejszej strony podręcznika man są:
Andrzej Krzysztofowicz (PTM) <ankry@mif.pg.gda.pl>,
Robert Luberda <robert@debian.org>
i
Michał Kułach <michal.kulach@gmail.com>.
.PP
Polskie tłumaczenie jest częścią projektu manpages-pl; uwagi, pomoc, zgłaszanie błędów na stronie http://sourceforge.net/projects/manpages-pl/. Jest zgodne z wersją \fB 4.07 \fPoryginału.