~ubuntu-branches/ubuntu/trusty/syslog-ng/trusty-proposed

« back to all changes in this revision

Viewing changes to modules/afsocket/sd-daemon.h

  • Committer: Package Import Robot
  • Author(s): Laszlo Boszormenyi (GCS)
  • Date: 2013-05-26 09:06:21 UTC
  • mfrom: (1.3.11)
  • Revision ID: package-import@ubuntu.com-20130526090621-8z2s0oi21eoljb9x
Tags: 3.3.9-1
* New upstream release.
* Include missed ivykis header (closes: #708793).

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
 
59
59
  You may find an up-to-date version of these source files online:
60
60
 
61
 
  http://cgit.freedesktop.org/systemd/plain/src/sd-daemon.h
62
 
  http://cgit.freedesktop.org/systemd/plain/src/sd-daemon.c
 
61
  http://cgit.freedesktop.org/systemd/systemd/plain/src/systemd/sd-daemon.h
 
62
  http://cgit.freedesktop.org/systemd/systemd/plain/src/sd-daemon.c
63
63
 
64
64
  This should compile on non-Linux systems, too, but with the
65
65
  exception of the sd_is_xxx() calls all functions will become NOPs.
75
75
#endif
76
76
#endif
77
77
 
78
 
#ifndef _sd_hidden_
79
 
#if (__GNUC__ >= 4) && !defined(SD_EXPORT_SYMBOLS)
80
 
#define _sd_hidden_ __attribute__ ((visibility("hidden")))
81
 
#else
82
 
#define _sd_hidden_
83
 
#endif
84
 
#endif
85
 
 
86
78
/*
87
79
  Log levels for usage on stderr:
88
80
 
117
109
 
118
110
  See sd_listen_fds(3) for more information.
119
111
*/
120
 
int sd_listen_fds(int unset_environment) _sd_hidden_;
 
112
int sd_listen_fds(int unset_environment);
121
113
 
122
114
/*
123
115
  Helper call for identifying a passed file descriptor. Returns 1 if
129
121
 
130
122
  See sd_is_fifo(3) for more information.
131
123
*/
132
 
int sd_is_fifo(int fd, const char *path) _sd_hidden_;
 
124
int sd_is_fifo(int fd, const char *path);
 
125
 
 
126
/*
 
127
  Helper call for identifying a passed file descriptor. Returns 1 if
 
128
  the file descriptor is a special character device on the file
 
129
  system stored under the specified path, 0 otherwise.
 
130
  If path is NULL a path name check will not be done and the call
 
131
  only verifies if the file descriptor refers to a special character.
 
132
  Returns a negative errno style error code on failure.
 
133
 
 
134
  See sd_is_special(3) for more information.
 
135
*/
 
136
int sd_is_special(int fd, const char *path);
133
137
 
134
138
/*
135
139
  Helper call for identifying a passed file descriptor. Returns 1 if
145
149
 
146
150
  See sd_is_socket(3) for more information.
147
151
*/
148
 
int sd_is_socket(int fd, int family, int type, int listening) _sd_hidden_;
 
152
int sd_is_socket(int fd, int family, int type, int listening);
149
153
 
150
154
/*
151
155
  Helper call for identifying a passed file descriptor. Returns 1 if
159
163
 
160
164
  See sd_is_socket_inet(3) for more information.
161
165
*/
162
 
int sd_is_socket_inet(int fd, int family, int type, int listening, uint16_t port) _sd_hidden_;
 
166
int sd_is_socket_inet(int fd, int family, int type, int listening, uint16_t port);
163
167
 
164
168
/*
165
169
  Helper call for identifying a passed file descriptor. Returns 1 if
175
179
 
176
180
  See sd_is_socket_unix(3) for more information.
177
181
*/
178
 
int sd_is_socket_unix(int fd, int type, int listening, const char *path, size_t length) _sd_hidden_;
 
182
int sd_is_socket_unix(int fd, int type, int listening, const char *path, size_t length);
 
183
 
 
184
/*
 
185
  Helper call for identifying a passed file descriptor. Returns 1 if
 
186
  the file descriptor is a POSIX Message Queue of the specified name,
 
187
  0 otherwise. If path is NULL a message queue name check is not
 
188
  done. Returns a negative errno style error code on failure.
 
189
*/
 
190
int sd_is_mq(int fd, const char *path);
179
191
 
180
192
/*
181
193
  Informs systemd about changed daemon state. This takes a number of
185
197
     READY=1      Tells systemd that daemon startup is finished (only
186
198
                  relevant for services of Type=notify). The passed
187
199
                  argument is a boolean "1" or "0". Since there is
188
 
                  little value in signalling non-readiness the only
 
200
                  little value in signaling non-readiness the only
189
201
                  value daemons should send is "READY=1".
190
202
 
191
203
     STATUS=...   Passes a single-line status string back to systemd
205
217
     MAINPID=...  The main pid of a daemon, in case systemd did not
206
218
                  fork off the process itself. Example: "MAINPID=4711"
207
219
 
 
220
     WATCHDOG=1   Tells systemd to update the watchdog timestamp.
 
221
                  Services using this feature should do this in
 
222
                  regular intervals. A watchdog framework can use the
 
223
                  timestamps to detect failed services.
 
224
 
208
225
  Daemons can choose to send additional variables. However, it is
209
 
  recommened to prefix variable names not listed above with X_.
 
226
  recommended to prefix variable names not listed above with X_.
210
227
 
211
228
  Returns a negative errno-style error code on failure. Returns > 0
212
229
  if systemd could be notified, 0 if it couldn't possibly because
221
238
 
222
239
  See sd_notify(3) for more information.
223
240
*/
224
 
int sd_notify(int unset_environment, const char *state) _sd_hidden_;
 
241
int sd_notify(int unset_environment, const char *state);
225
242
 
226
243
/*
227
244
  Similar to sd_notify() but takes a format string.
243
260
 
244
261
  See sd_notifyf(3) for more information.
245
262
*/
246
 
int sd_notifyf(int unset_environment, const char *format, ...) _sd_printf_attr_(2,3) _sd_hidden_;
 
263
int sd_notifyf(int unset_environment, const char *format, ...) _sd_printf_attr_(2,3);
247
264
 
248
265
/*
249
266
  Returns > 0 if the system was booted with systemd. Returns < 0 on
256
273
 
257
274
  See sd_booted(3) for more information.
258
275
*/
259
 
int sd_booted(void) _sd_hidden_;
 
276
int sd_booted(void);
260
277
 
261
278
#ifdef __cplusplus
262
279
}