~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to storage/ndb/include/portlib/NdbDaemon.h

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (C) 2003 MySQL AB
 
2
 
 
3
   This program is free software; you can redistribute it and/or modify
 
4
   it under the terms of the GNU General Public License as published by
 
5
   the Free Software Foundation; version 2 of the License.
 
6
 
 
7
   This program is distributed in the hope that it will be useful,
 
8
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
9
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
10
   GNU General Public License for more details.
 
11
 
 
12
   You should have received a copy of the GNU General Public License
 
13
   along with this program; if not, write to the Free Software
 
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
15
 
 
16
#ifndef NDB_DAEMON_H
 
17
#define NDB_DAEMON_H
 
18
 
 
19
#ifdef  __cplusplus
 
20
extern "C" {
 
21
#endif
 
22
 
 
23
/*
 
24
 * Become a daemon.
 
25
 * lockfile     the "pid file" or other resource to lock exclusively
 
26
 * logfile      daemon output is directed here (input is set to /dev/null)
 
27
 *              if NULL, output redirection is not done
 
28
 * flags        none currently
 
29
 * returns      0 on success, on error -1
 
30
 */
 
31
extern int
 
32
NdbDaemon_Make(const char* lockfile, const char* logfile, unsigned flags);
 
33
 
 
34
/*
 
35
 * Test if the daemon is running (file is locked).
 
36
 * lockfile     the "pid file"
 
37
 * flags        none currently
 
38
 * return       0 no, 1 yes, -1 
 
39
 */
 
40
extern int
 
41
NdbDaemon_Test(const char* lockfile, unsigned flags);
 
42
 
 
43
/*
 
44
 * Kill the daemon.
 
45
 * lockfile     the "pid file"
 
46
 * flags        none currently
 
47
 * return       0 killed, 1 not running, -1 other error
 
48
 */
 
49
extern int
 
50
NdbDaemon_Kill(const char* lockfile, unsigned flags);
 
51
 
 
52
/*
 
53
 * Pid from last call, either forked off or found in lock file.
 
54
 */
 
55
extern long NdbDaemon_DaemonPid;
 
56
 
 
57
/*
 
58
 * Error code from last failed call.
 
59
 */
 
60
extern int NdbDaemon_ErrorCode;
 
61
 
 
62
/*
 
63
 * Error text from last failed call.
 
64
 */
 
65
extern char NdbDaemon_ErrorText[];
 
66
 
 
67
#ifdef  __cplusplus
 
68
}
 
69
#endif
 
70
 
 
71
#endif