~ubuntu-branches/ubuntu/oneiric/postgresql-9.1/oneiric-security

« back to all changes in this revision

Viewing changes to src/include/storage/procsignal.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2011-05-11 10:41:53 UTC
  • Revision ID: james.westby@ubuntu.com-20110511104153-psbh2o58553fv1m0
Tags: upstream-9.1~beta1
ImportĀ upstreamĀ versionĀ 9.1~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*-------------------------------------------------------------------------
 
2
 *
 
3
 * procsignal.h
 
4
 *        Routines for interprocess signalling
 
5
 *
 
6
 *
 
7
 * Portions Copyright (c) 1996-2011, PostgreSQL Global Development Group
 
8
 * Portions Copyright (c) 1994, Regents of the University of California
 
9
 *
 
10
 * src/include/storage/procsignal.h
 
11
 *
 
12
 *-------------------------------------------------------------------------
 
13
 */
 
14
#ifndef PROCSIGNAL_H
 
15
#define PROCSIGNAL_H
 
16
 
 
17
#include "storage/backendid.h"
 
18
 
 
19
 
 
20
/*
 
21
 * Reasons for signalling a Postgres child process (a backend or an auxiliary
 
22
 * process, like bgwriter).  We can cope with concurrent signals for different
 
23
 * reasons.  However, if the same reason is signaled multiple times in quick
 
24
 * succession, the process is likely to observe only one notification of it.
 
25
 * This is okay for the present uses.
 
26
 *
 
27
 * Also, because of race conditions, it's important that all the signals be
 
28
 * defined so that no harm is done if a process mistakenly receives one.
 
29
 */
 
30
typedef enum
 
31
{
 
32
        PROCSIG_CATCHUP_INTERRUPT,      /* sinval catchup interrupt */
 
33
        PROCSIG_NOTIFY_INTERRUPT,       /* listen/notify interrupt */
 
34
 
 
35
        /* Recovery conflict reasons */
 
36
        PROCSIG_RECOVERY_CONFLICT_DATABASE,
 
37
        PROCSIG_RECOVERY_CONFLICT_TABLESPACE,
 
38
        PROCSIG_RECOVERY_CONFLICT_LOCK,
 
39
        PROCSIG_RECOVERY_CONFLICT_SNAPSHOT,
 
40
        PROCSIG_RECOVERY_CONFLICT_BUFFERPIN,
 
41
        PROCSIG_RECOVERY_CONFLICT_STARTUP_DEADLOCK,
 
42
 
 
43
        NUM_PROCSIGNALS                         /* Must be last! */
 
44
} ProcSignalReason;
 
45
 
 
46
/*
 
47
 * prototypes for functions in procsignal.c
 
48
 */
 
49
extern Size ProcSignalShmemSize(void);
 
50
extern void ProcSignalShmemInit(void);
 
51
 
 
52
extern void ProcSignalInit(int pss_idx);
 
53
extern int SendProcSignal(pid_t pid, ProcSignalReason reason,
 
54
                           BackendId backendId);
 
55
 
 
56
extern void procsignal_sigusr1_handler(SIGNAL_ARGS);
 
57
 
 
58
#endif   /* PROCSIGNAL_H */