+ if (*sot->loaded)
+ memmove(sot->buf, sot->buf + ret, *sot->loaded);
+}
+
+/**
+ * Initialize a stdout task structure with default values.
+ *
+ * \param sot The stdout task structure.
+ *
+ * This fills in the pre/post select function poinzters of the task structure
+ * given by \a sot.
+ */
+void stdout_set_defaults(struct stdout_task *sot)
+{
+ int ret;
+
+ sot->task.pre_select = stdout_pre_select;
+ sot->task.post_select = stdout_post_select;
+ sprintf(sot->task.status, "stdout writer");
+ ret = mark_fd_nonblocking(STDOUT_FILENO);
+ if (ret >= 0)
+ return;
+ PARA_EMERG_LOG("%s\n", para_strerror(-ret));
+ exit(EXIT_FAILURE);