File: daemon.3

package info (click to toggle)
manpages-pl 1%3A0.6-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 20,896 kB
  • ctags: 7
  • sloc: sh: 112; makefile: 59; perl: 32
file content (104 lines) | stat: -rw-r--r-- 5,280 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
.\" 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.
.TH DAEMON 3 2013\-10\-28 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(): _BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500)
.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
.SS "Wielowątkowość (patrz pthreads(7))"
Funkcja \fBdaemon\fP() jest wątkowo bezpieczna.
.SH "ZGODNE Z"
Funkcja nie występuje w POSIX.1\-2001. 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 "ZOBACZ TAKŻE"
\fBfork\fP(2), \fBsetsid\fP(2)
.SH "O STRONIE"
Angielska wersja tej strony pochodzi z wydania 3.71 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
\%http://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 3.71 \fPoryginału.