immediately for all journal changes. Returns 0 if there might be a
latency involved.</para>
- <para><function>sd_journal_process()</function> and
- <function>sd_journal_wait()</function> return one of
- <constant>SD_JOURNAL_NOP</constant>,
- <constant>SD_JOURNAL_APPEND</constant> or
- <constant>SD_JOURNAL_INVALIDATE</constant> on success or a
- negative errno-style error code. If
- <constant>SD_JOURNAL_NOP</constant> is returned, the journal did
- not change since the last invocation. If
- <constant>SD_JOURNAL_APPEND</constant> is returned, new entries
- have been appended to the end of the journal. If
- <constant>SD_JOURNAL_INVALIDATE</constant>, journal files were
- added or removed (possibly due to rotation). In the latter event,
- live-view UIs should probably refresh their entire display, while
- in the case of <constant>SD_JOURNAL_APPEND</constant>, it is
- sufficient to simply continue reading at the previous end of the
- journal.</para>
+ <para><function>sd_journal_process()</function> and <function>sd_journal_wait()</function> return a negative
+ errno-style error code, or one of <constant>SD_JOURNAL_NOP</constant>, <constant>SD_JOURNAL_APPEND</constant> or
+ <constant>SD_JOURNAL_INVALIDATE</constant> on success:</para>
+
+ <itemizedlist>
+ <listitem><para>If <constant>SD_JOURNAL_NOP</constant> is returned, the journal did not change since the last
+ invocation.</para></listitem>
+
+ <listitem><para>If <constant>SD_JOURNAL_APPEND</constant> is returned, new entries have been appended to the end
+ of the journal. In this case it is sufficient to simply continue reading at the previous end location of the
+ journal, to read the newly added entries.</para></listitem>
+
+ <listitem><para>If <constant>SD_JOURNAL_INVALIDATE</constant>, journal files were added to or removed from the
+ set of of journal files watched (e.g. due to rotation or vacuuming), and thus entries might have appeared or
+ disappeared at arbitrary places in the log stream, possibly before or after the previous end of the log
+ stream. If <constant>SD_JOURNAL_INVALIDATE</constant> is returned, live-view UIs that want to reflect on screen
+ the precise state of the log data on disk should probably refresh their entire display (relative to the cursor of
+ the log entry on the top of the screen). Programs only interested in a strictly sequencial stream of log data may
+ treat <constant>SD_JOURNAL_INVALIDATE</constant> the same way as <constant>SD_JOURNAL_APPEND</constant>, thus
+ ignoring any changes to the log view earlier than the old end of the log stream.</para></listitem>
+ </itemizedlist>
</refsect1>
<refsect1>
<para>Most of <command>systemd-portabled</command>'s functionality is accessible through the
<citerefentry><refentrytitle>portablectl</refentrytitle><manvolnum>1</manvolnum></citerefentry> command.</para>
-
<para>See the <ulink url="https://github.com/systemd/systemd/blob/master/doc/PORTABLE_SERVICES.md">Portable
Services Documentation</ulink> for details about the concepts this service implements.</para>
</refsect1>
if (r < 0)
return r;
- fd = open(from, O_RDWR|O_NDELAY|O_CLOEXEC);
+ fd = open(from, O_RDWR|O_NONBLOCK|O_CLOEXEC);
if (fd < 0)
return log_error_errno(errno, "Failed to open fifo: %m");
isatty(STDIN_FILENO) > 0 &&
isatty(STDOUT_FILENO) > 0;
- master = posix_openpt(O_RDWR|O_NOCTTY|O_CLOEXEC|O_NDELAY);
+ master = posix_openpt(O_RDWR|O_NOCTTY|O_CLOEXEC|O_NONBLOCK);
if (master < 0) {
r = log_error_errno(errno, "Failed to acquire pseudo tty: %m");
goto finish;
if (!filename_is_valid(name))
return -EINVAL;
- *ret = name;
- name = NULL;
+ *ret = TAKE_PTR(name);
return 0;
}
if (!arg_quiet)
log_info("(Matching all unit files.)");
} else {
- _cleanup_free_ char *joined = NULL;
k = strv_copy(l);
if (!k)
return log_oom();
- joined = strv_join(k, "', '");
- if (!joined)
- return log_oom();
+ if (!arg_quiet) {
+ _cleanup_free_ char *joined = NULL;
+
+ joined = strv_join(k, "', '");
+ if (!joined)
+ return log_oom();
- if (!arg_quiet)
log_info("(Matching unit files with prefixes '%s'.)", joined);
+ }
}
*ret = TAKE_PTR(k);
break;
case 'p':
+ if (streq(optarg, "help"))
+ return dump_profiles();
+
if (!filename_is_valid(optarg)) {
log_error("Unit profile name not valid: %s", optarg);
return -EINVAL;
}
- if (streq(optarg, "help"))
- return dump_profiles();
-
arg_profile = optarg;
break;
arg_copy_mode = NULL;
else if (STR_IN_SET(optarg, "copy", "symlink"))
arg_copy_mode = optarg;
- else {
+ else if (streq(optarg, "help")) {
+ puts("auto\n"
+ "copy\n"
+ "symlink");
+ return 0;
+ } else {
log_error("Failed to parse --copy= argument: %s", optarg);
return -EINVAL;
}
for (i = 0; i < hashmap_size(unit_files); i++) {
-
r = sd_bus_message_open_container(reply, 'e', "say");
if (r < 0)
return r;
if (arg_stdio == ARG_STDIO_PTY) {
if (arg_transport == BUS_TRANSPORT_LOCAL) {
- master = posix_openpt(O_RDWR|O_NOCTTY|O_CLOEXEC|O_NDELAY);
+ master = posix_openpt(O_RDWR|O_NOCTTY|O_CLOEXEC|O_NONBLOCK);
if (master < 0)
return log_error_errno(errno, "Failed to acquire pseudo tty: %m");
if (fd < 0)
return log_error_errno(errno, "failed to open %s: %m", path);
r = read_fiemap(fd, &fiemap);
- if (r == -ENOTSUP) {
+ if (r == -EOPNOTSUPP) {
log_info("Skipping test, not supported");
exit(EXIT_TEST_SKIP);
}
RUN_WITH_UMASK(0000) {
mac_selinux_create_file_prepare(path, S_IFREG);
- fd = open(path, flags|O_NDELAY|O_CLOEXEC|O_WRONLY|O_NOCTTY, i->mode);
+ fd = open(path, flags|O_NONBLOCK|O_CLOEXEC|O_WRONLY|O_NOCTTY, i->mode);
mac_selinux_create_file_clear();
}
# Fair Queue CoDel packet scheduler to fight bufferbloat
net.core.default_qdisc = fq_codel
+# Request Explicit Congestion Notification (ECN) on both in and outgoing connections
+net.ipv4.tcp_ecn = 1
+
# Enable hard and soft link protection
fs.protected_hardlinks = 1
fs.protected_symlinks = 1