Changeset 1ebc1a62 in mainline for uspace/app/sbi/src/os/helenos.c


Ignore:
Timestamp:
2010-03-29T20:30:29Z (14 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a95310e
Parents:
5da468e
Message:

Update SBI to rev. 157.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/sbi/src/os/helenos.c

    r5da468e r1ebc1a62  
    3434#include <str.h>
    3535#include <task.h>
     36#include <tinput.h>
    3637
    3738#include "os.h"
     
    4041 * Using HelenOS-specific string API.
    4142 */
     43
     44static tinput_t *tinput = NULL;
    4245
    4346/** Concatenate two strings. */
     
    98101}
    99102
     103/** Read one line of input from the user. */
     104int os_input_line(char **ptr)
     105{
     106        char *line;
     107
     108        if (tinput == NULL) {
     109                tinput = tinput_new();
     110                if (tinput == NULL)
     111                        return EIO;
     112        }
     113
     114        line = tinput_read(tinput);
     115        if (line == NULL)
     116                return EIO;
     117
     118        /* XXX Input module needs trailing newline to keep going. */
     119        *ptr = os_str_acat(line, "\n");
     120        free(line);
     121
     122        return EOK;
     123}
     124
    100125/** Simple command execution. */
    101126int os_exec(char *const cmd[])
Note: See TracChangeset for help on using the changeset viewer.