journal-send.c revision 03e334a1c7dc8c20c38902aa039440763acc9b17
618234a5258768359cb1086b152c5f08aaf89754Lennart Poettering/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
618234a5258768359cb1086b152c5f08aaf89754Lennart Poettering This file is part of systemd.
618234a5258768359cb1086b152c5f08aaf89754Lennart Poettering Copyright 2011 Lennart Poettering
618234a5258768359cb1086b152c5f08aaf89754Lennart Poettering systemd is free software; you can redistribute it and/or modify it
618234a5258768359cb1086b152c5f08aaf89754Lennart Poettering under the terms of the GNU Lesser General Public License as published by
618234a5258768359cb1086b152c5f08aaf89754Lennart Poettering the Free Software Foundation; either version 2.1 of the License, or
618234a5258768359cb1086b152c5f08aaf89754Lennart Poettering (at your option) any later version.
618234a5258768359cb1086b152c5f08aaf89754Lennart Poettering systemd is distributed in the hope that it will be useful, but
618234a5258768359cb1086b152c5f08aaf89754Lennart Poettering WITHOUT ANY WARRANTY; without even the implied warranty of
618234a5258768359cb1086b152c5f08aaf89754Lennart Poettering MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
618234a5258768359cb1086b152c5f08aaf89754Lennart Poettering Lesser General Public License for more details.
618234a5258768359cb1086b152c5f08aaf89754Lennart Poettering You should have received a copy of the GNU Lesser General Public License
618234a5258768359cb1086b152c5f08aaf89754Lennart Poettering along with systemd; If not, see <http://www.gnu.org/licenses/>.
char **_f = &(f); \
static int journal_fd(void) {
int fd;
static int fd_plus_one = 0;
if (fd_plus_one > 0)
if (fd < 0)
return -errno;
goto retry;
return fd;
char_array_0(p);
_printf_(1, 0) static int fill_iovec_sprintf(const char *format, va_list ap, int extra, struct iovec **_iov) {
if (extra > 0) {
if (!iov) {
r = -ENOMEM;
goto fail;
i = extra;
while (format) {
struct iovec *c;
char *buffer;
r = -ENOMEM;
goto fail;
iov = c;
r = -ENOMEM;
goto fail;
fail:
if (_unlikely_(i < 0)) {
goto finish;
struct iovec *w;
uint64_t *l;
ssize_t k;
} control;
bool have_syslog_identifier = false;
char *c, *nl;
return -EINVAL;
return -EINVAL;
if (nl) {
return -EINVAL;
w[j].iov_base = &l[i];
w[j++] = iov[i];
if (!have_syslog_identifier &&
return fd;
return -errno;
if (buffer_fd < 0)
return buffer_fd;
return -errno;
return -errno;
size_t n, k;
char buffer[n];
errno = 0;
if (errno == 0) {
return -errno;
int fd;
char *header;
size_t l;
ssize_t r;
if (fd < 0)
return -errno;
return -errno;
return -errno;
if (!identifier)
if ((size_t) r != l) {
return -errno;
return fd;
_public_ int sd_journal_print_with_location(int priority, const char *file, const char *line, const char *func, const char *format, ...) {
_public_ int sd_journal_printv_with_location(int priority, const char *file, const char *line, const char *func, const char *format, va_list ap) {
char_array_0(p);
_public_ int sd_journal_send_with_location(const char *file, const char *line, const char *func, const char *format, ...) {
if (_unlikely_(i < 0)) {
goto finish;
const char *func,
const char *func,
const char *message) {