blob: dd0bafff6323088d46d3fa34808ada32bbc733c8 (
plain)
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
|
'\"macro stdmacro
.\"
.\" Copyright (c) 2000-2004 Silicon Graphics, Inc. All Rights Reserved.
.\"
.\" This program is free software; you can redistribute it and/or modify it
.\" under the terms of the GNU General Public License as published by the
.\" Free Software Foundation; either version 2 of the License, or (at your
.\" option) any later version.
.\"
.\" This program is distributed in the hope that it will be useful, but
.\" WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
.\" or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
.\" for more details.
.\"
.\"
.TH PMOPENLOG 3 "PCP" "Performance Co-Pilot"
.SH NAME
\f3__pmOpenLog\f1 \- create a log file for diagnostics and debug output
.SH "C SYNOPSIS"
.ft 3
#include <pcp/pmapi.h>
.br
#include <pcp/impl.h>
.sp
.ad l
.hy 0
.in +8n
.ti -8n
FILE *__pmOpenLog(const char *\fIprogname\fP, const char *\fIlogname\fP, FILE\ *\fIoldstream\fP, int\ *\fIstatus\fP);
.sp
.in
.hy
.ad
cc ... \-lpcp
.ft 1
.SH DESCRIPTION
.B __pmOpenLog
reassigns the standard I/O stream
.I oldstream
to be associated with the file
.IR logname .
If it already exists,
.I logname
will be removed and recreated if possible (to ensure correct ownership
and permissions from the caller to
.BR __pmOpenLog ).
.PP
On return, the function value is the new standard I/O stream. In the
event of an error, this will be
.I oldstream
unchanged and
.I status
will be 0.
.PP
For success,
.I status
is 1, a standard preamble is written to
.I logname
.ti +0.5i
.ft B
Log for \fIprogname\fB on \fIhostname\fB started \fIdate and time\fB
.ft R
.br
and an
.BR atexit (3)
handler is installed to write the postscript message to
.I logname
.ti +0.5i
.ft B
Log finished \fIdate and time\fB
.ft R
.br
when the processes exits.
.PP
.I progname
is only used to annotate messages.
.SH SEE ALSO
.BR atexit (3)
and
.BR freopen (3).
|