~louis/ubuntu/trusty/clamav/lp799623_fix_logrotate

« back to all changes in this revision

Viewing changes to docs/html/node50.html

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2010-03-12 11:30:04 UTC
  • mfrom: (0.41.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20100312113004-b0fop4bkycszdd0z
Tags: 0.96~rc1+dfsg-0ubuntu1
* New upstream RC - FFE (LP: #537636):
  - Add OfficialDatabaseOnly option to clamav-base.postinst.in
  - Add LocalSocketGroup option to clamav-base.postinst.in
  - Add LocalSocketMode option to clamav-base.postinst.in
  - Add CrossFilesystems option to clamav-base.postinst.in
  - Add ClamukoScannerCount option to clamav-base.postinst.in
  - Add BytecodeSecurity opiton to clamav-base.postinst.in
  - Add DetectionStatsHostID option to clamav-freshclam.postinst.in
  - Add Bytecode option to clamav-freshclam.postinst.in
  - Add MilterSocketGroup option to clamav-milter.postinst.in
  - Add MilterSocketMode option to clamav-milter.postinst.in
  - Add ReportHostname option to clamav-milter.postinst.in
  - Bump libclamav SO version to 6.1.0 in libclamav6.install
  - Drop clamdmon from clamav.examples (no longer shipped by upstream)
  - Drop libclamav.a from libclamav-dev.install (not built by upstream)
  - Update SO version for lintian override for libclamav6
  - Add new Bytecode Testing Tool, usr/bin/clambc, to clamav.install
  - Add build-depends on python and python-setuptools for new test suite
  - Update debian/copyright for the embedded copy of llvm (using the system
    llvm is not currently feasible)

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
  Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
8
8
<HTML>
9
9
<HEAD>
10
 
<TITLE>Memory</TITLE>
11
 
<META NAME="description" CONTENT="Memory">
 
10
<TITLE>Database checks</TITLE>
 
11
<META NAME="description" CONTENT="Database checks">
12
12
<META NAME="keywords" CONTENT="clamdoc">
13
13
<META NAME="resource-type" CONTENT="document">
14
14
<META NAME="distribution" CONTENT="global">
20
20
 
21
21
<LINK REL="next" HREF="node51.html">
22
22
<LINK REL="previous" HREF="node49.html">
23
 
<LINK REL="up" HREF="node48.html">
 
23
<LINK REL="up" HREF="node43.html">
24
24
<LINK REL="next" HREF="node51.html">
25
25
</HEAD>
26
26
 
27
27
<BODY >
28
28
 
29
29
<DIV CLASS="navigation"><!--Navigation Panel-->
30
 
<A NAME="tex2html858"
 
30
<A NAME="tex2html869"
31
31
  HREF="node51.html">
32
32
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> 
33
 
<A NAME="tex2html854"
34
 
  HREF="node48.html">
 
33
<A NAME="tex2html865"
 
34
  HREF="node43.html">
35
35
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> 
36
 
<A NAME="tex2html848"
 
36
<A NAME="tex2html859"
37
37
  HREF="node49.html">
38
38
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> 
39
 
<A NAME="tex2html856"
 
39
<A NAME="tex2html867"
40
40
  HREF="node1.html">
41
41
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A>  
42
42
<BR>
43
 
<B> Next:</B> <A NAME="tex2html859"
44
 
  HREF="node51.html">Forking daemons</A>
45
 
<B> Up:</B> <A NAME="tex2html855"
46
 
  HREF="node48.html">Database reloading</A>
47
 
<B> Previous:</B> <A NAME="tex2html849"
48
 
  HREF="node49.html">Data scan functions</A>
49
 
 &nbsp; <B>  <A NAME="tex2html857"
 
43
<B> Next:</B> <A NAME="tex2html870"
 
44
  HREF="node51.html">Data scan functions</A>
 
45
<B> Up:</B> <A NAME="tex2html866"
 
46
  HREF="node43.html">API</A>
 
47
<B> Previous:</B> <A NAME="tex2html860"
 
48
  HREF="node49.html">Limits</A>
 
49
 &nbsp; <B>  <A NAME="tex2html868"
50
50
  HREF="node1.html">Contents</A></B> 
51
51
<BR>
52
52
<BR></DIV>
53
53
<!--End of Navigation Panel-->
54
54
 
55
 
<H3><A NAME="SECTION00076200000000000000">
56
 
Memory</A>
 
55
<H3><A NAME="SECTION00073700000000000000">
 
56
Database checks</A>
57
57
</H3>
58
 
    Because the engine structure occupies a few megabytes of system memory, you
59
 
    should release it with <code>cl_engine_free()</code> if you no longer need to
60
 
    scan files.
 
58
    It's very important  to keep the internal instance of the database up to
 
59
    date. You can watch database changes with the <code>cl_stat..()</code> family
 
60
    of functions.
 
61
    <PRE>
 
62
        int cl_statinidir(const char *dirname, struct cl_stat *dbstat);
 
63
        int cl_statchkdir(const struct cl_stat *dbstat);
 
64
        int cl_statfree(struct cl_stat *dbstat);
 
65
</PRE>
 
66
    Initialization:
 
67
    <PRE>
 
68
            ...
 
69
            struct cl_stat dbstat;
 
70
 
 
71
        memset(&amp;dbstat, 0, sizeof(struct cl_stat));
 
72
        cl_statinidir(dbdir, &amp;dbstat);
 
73
</PRE>
 
74
    To check for a change you just need to call <code>cl_statchkdir</code> and check
 
75
    its return value (0 - no change, 1 - some change occured). Remember to reset
 
76
    the <code>cl_stat</code> structure after reloading the database.
 
77
    <PRE>
 
78
        if(cl_statchkdir(&amp;dbstat) == 1) {
 
79
            reload_database...;
 
80
            cl_statfree(&amp;dbstat);
 
81
            cl_statinidir(cl_retdbdir(), &amp;dbstat);
 
82
        }
 
83
</PRE>
 
84
    Libclamav <SPAN CLASS="MATH"><IMG
 
85
 WIDTH="58" HEIGHT="35" ALIGN="MIDDLE" BORDER="0"
 
86
 SRC="img5.png"
 
87
 ALT="$\ge0.96$"></SPAN> includes and additional call to check the number of
 
88
    signatures that can be loaded from a given directory:
 
89
    <PRE>
 
90
        int cl_countsigs(const char *path, unsigned int countoptions,
 
91
            unsigned int *sigs);
 
92
</PRE>
 
93
    The first argument points to the database directory, the second one
 
94
    specifies what signatures should be counted:
 
95
    <code>CL_COUNTSIGS_OFFICIAL</code> (official signatures),
 
96
<BR>    <code>CL_COUNTSIGS_UNOFFICIAL</code> (third party signatures),
 
97
    <code>CL_COUNTSIGS_ALL</code> (all signatures). The last argument points
 
98
    to the counter to which the number of detected signatures will
 
99
    be added (therefore the counter should be initially set to 0).
 
100
    The call returns <code>CL_SUCCESS</code> or an error code.
61
101
 
62
102
<P>
63
103
<BR><HR>
64
104
<ADDRESS>
65
105
Tomasz Kojm
66
 
2009-10-28
 
106
2010-03-10
67
107
</ADDRESS>
68
108
</BODY>
69
109
</HTML>