Changeset aa85487 in mainline for uspace/lib/libc/generic


Ignore:
Timestamp:
2010-03-07T15:11:56Z (15 years ago)
Author:
Lukas Mejdrech <lukasmejdrech@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
aadf01e
Parents:
2e99277 (diff), 137691a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes, revision 308

Location:
uspace/lib/libc/generic
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/libc/generic/async.c

    r2e99277 raa85487  
    11011101}
    11021102
     1103/** Wrapper for making IPC_M_CONNECT_ME_TO calls using the async framework.
     1104 *
     1105 * Ask through phone for a new connection to some service.
     1106 *
     1107 * @param phoneid       Phone handle used for contacting the other side.
     1108 * @param arg1          User defined argument.
     1109 * @param arg2          User defined argument.
     1110 * @param arg3          User defined argument.
     1111 *
     1112 * @return              New phone handle on success or a negative error code.
     1113 */
     1114int
     1115async_connect_me_to(int phoneid, ipcarg_t arg1, ipcarg_t arg2, ipcarg_t arg3)
     1116{
     1117        int rc;
     1118        ipcarg_t newphid;
     1119
     1120        rc = async_req_3_5(phoneid, IPC_M_CONNECT_ME_TO, arg1, arg2, arg3, NULL,
     1121            NULL, NULL, NULL, &newphid);
     1122       
     1123        if (rc != EOK) 
     1124                return rc;
     1125
     1126        return newphid;
     1127}
     1128
     1129/** Wrapper for making IPC_M_CONNECT_ME_TO calls using the async framework.
     1130 *
     1131 * Ask through phone for a new connection to some service and block until
     1132 * success.
     1133 *
     1134 * @param phoneid       Phone handle used for contacting the other side.
     1135 * @param arg1          User defined argument.
     1136 * @param arg2          User defined argument.
     1137 * @param arg3          User defined argument.
     1138 *
     1139 * @return              New phone handle on success or a negative error code.
     1140 */
     1141int
     1142async_connect_me_to_blocking(int phoneid, ipcarg_t arg1, ipcarg_t arg2,
     1143    ipcarg_t arg3)
     1144{
     1145        int rc;
     1146        ipcarg_t newphid;
     1147
     1148        rc = async_req_4_5(phoneid, IPC_M_CONNECT_ME_TO, arg1, arg2, arg3,
     1149            IPC_FLAG_BLOCKING, NULL, NULL, NULL, NULL, &newphid);
     1150       
     1151        if (rc != EOK) 
     1152                return rc;
     1153
     1154        return newphid;
     1155}
     1156
    11031157/** Wrapper for making IPC_M_SHARE_IN calls using the async framework.
    11041158 *
  • uspace/lib/libc/generic/futex.c

    r2e99277 raa85487  
    6868int futex_down(futex_t *futex)
    6969{
    70         if (atomic_predec(futex) < 0)
     70        if ((atomic_signed_t) atomic_predec(futex) < 0)
    7171                return __SYSCALL1(SYS_FUTEX_SLEEP, (sysarg_t) &futex->count);
    7272
     
    8282int futex_up(futex_t *futex)
    8383{
    84         if (atomic_postinc(futex) < 0)
     84        if ((atomic_signed_t) atomic_postinc(futex) < 0)
    8585                return __SYSCALL1(SYS_FUTEX_WAKEUP, (sysarg_t) &futex->count);
    8686               
  • uspace/lib/libc/generic/io/io.c

    r2e99277 raa85487  
    536536}
    537537
     538char *fgets(char *str, int size, FILE *stream)
     539{
     540        int c;
     541        int idx;
     542
     543        idx = 0;
     544        while (idx < size - 1) {
     545                c = fgetc(stream);
     546                if (c == EOF)
     547                        break;
     548
     549                str[idx++] = c;
     550
     551                if (c == '\n')
     552                        break;
     553        }
     554
     555        if (ferror(stream))
     556                return NULL;
     557
     558        if (idx == 0)
     559                return NULL;
     560
     561        str[idx] = '\0';
     562        return str;
     563}
     564
    538565int getchar(void)
    539566{
  • uspace/lib/libc/generic/loader.c

    r2e99277 raa85487  
    183183 *
    184184 */
    185 int loader_set_args(loader_t *ldr, char *const argv[])
     185int loader_set_args(loader_t *ldr, const char *const argv[])
    186186{
    187187        /*
     
    189189         * compute size of the buffer needed.
    190190         */
    191         char *const *ap = argv;
     191        const char *const *ap = argv;
    192192        size_t buffer_size = 0;
    193193        while (*ap != NULL) {
  • uspace/lib/libc/generic/sysinfo.c

    r2e99277 raa85487  
    3737#include <string.h>
    3838
    39 sysarg_t sysinfo_value(char *name)
     39sysarg_t sysinfo_value(const char *name)
    4040{
    41         return __SYSCALL2(SYS_SYSINFO_VALUE, (sysarg_t ) name,
     41        return __SYSCALL2(SYS_SYSINFO_VALUE, (sysarg_t) name,
    4242            (sysarg_t) str_size(name));
    4343}
  • uspace/lib/libc/generic/task.c

    r2e99277 raa85487  
    7676 *
    7777 */
    78 task_id_t task_spawn(const char *path, char *const args[])
     78task_id_t task_spawn(const char *path, const char *const args[])
    7979{
    8080        /* Connect to a program loader. */
  • uspace/lib/libc/generic/thread.c

    r2e99277 raa85487  
    8686 * @return Zero on success or a code from @ref errno.h on failure.
    8787 */
    88 int thread_create(void (* function)(void *), void *arg, char *name,
     88int thread_create(void (* function)(void *), void *arg, const char *name,
    8989    thread_id_t *tid)
    9090{
Note: See TracChangeset for help on using the changeset viewer.