PostgreSQL Source Code: src/common/wait_error.c Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17#ifndef FRONTEND
19#else
21#endif
22
23#include <signal.h>
25
26
27
28
29
30
31
32char *
34{
35 char str[512];
36
37
38
39
40
41
42 if (exitstatus == -1)
43 {
45 }
47 {
48
49
50
51
53 {
54 case 126:
56 break;
57
58 case 127:
60 break;
61
62 default:
64 _("child process exited with exit code %d"),
66 }
67 }
69 {
70#if defined(WIN32)
72 _("child process was terminated by exception 0x%X"),
74#else
76 _("child process was terminated by signal %d: %s"),
78#endif
79 }
80 else
82 _("child process exited with unrecognized status %d"),
83 exitstatus);
84
86}
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101bool
103{
105 return true;
107 return true;
108 return false;
109}
110
111
112
113
114
115
116
117
118
119
120bool
122{
124 return true;
126 WEXITSTATUS(exit_status) > (include_command_not_found ? 125 : 128))
127 return true;
128 return false;
129}
130
131
132
133
134
135
136
137int
139{
140 if (exit_status == -1)
141 return -1;
145 return 128 + WTERMSIG(exit_status);
146
147 return -1;
148}
char * pstrdup(const char *in)
const char * pg_strsignal(int signum)
char * wait_result_to_str(int exitstatus)
int wait_result_to_exit_code(int exit_status)
bool wait_result_is_signal(int exit_status, int signum)
bool wait_result_is_any_signal(int exit_status, bool include_command_not_found)