Ignore:
Timestamp:
Mar 25, 2018, 7:05:19 PM (7 years ago)
Author:
bird
Message:

kmk/output: working on memory buffering rather than file buffering of job output.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/output.h

    r3140 r3189  
    1515this program.  If not, see <http://www.gnu.org/licenses/>.  */
    1616
     17#ifdef CONFIG_WITH_OUTPUT_IN_MEMORY
     18/*  Output run. */
     19struct output_run
     20{
     21    unsigned int seqno;         /* For interleaving out/err output. */
     22    unsigned int len;           /* The length of the output. */
     23    struct output_run *next;    /* Pointer to the next run. */
     24};
     25
     26/* Output segment. */
     27struct output_segment
     28{
     29    struct output_segment *next;
     30    size_t size;                 /* Segment size, everything included. */
     31    struct output_run runs[1];
     32};
     33
     34/* Output memory buffer. */
     35struct output_membuf
     36{
     37    struct output_run     *head_run;
     38    struct output_run     *tail_run; /* Always in tail_seg. */
     39    struct output_segment *head_seg;
     40    struct output_segment *tail_seg;
     41    size_t left;                /* Number of bytes that can be appended to
     42                                   the tail_run.  */
     43    size_t total;               /* Total segment allocation size.  */
     44};
     45#endif /* CONFIG_WITH_OUTPUT_IN_MEMORY */
     46
    1747struct output
    1848  {
     49#ifdef CONFIG_WITH_OUTPUT_IN_MEMORY
     50    struct output_membuf out;
     51    struct output_membuf err;
     52    unsigned int seqno;         /* The current run sequence number. */
     53#else
    1954    int out;
    2055    int err;
     56#endif
    2157    unsigned int syncout:1;     /* True if we want to synchronize output.  */
    2258 };
Note: See TracChangeset for help on using the changeset viewer.