Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/loader.c

    rcde999a rd96d9bc  
    5252 * @param name Symbolic name to set on the newly created task.
    5353 *
    54  * @return Error code.
     54 * @return Pointer to the loader connection structure (should be
     55 *         deallocated using free() after use).
     56 *
    5557 */
    5658int loader_spawn(const char *name)
    5759{
    58         return (int) __SYSCALL2(SYS_PROGRAM_SPAWN_LOADER,
     60        return __SYSCALL2(SYS_PROGRAM_SPAWN_LOADER,
    5961            (sysarg_t) name, str_size(name));
    6062}
     
    8486 * @param task_id Points to a variable where the ID should be stored.
    8587 *
    86  * @return Zero on success or an error code.
     88 * @return Zero on success or negative error code.
    8789 *
    8890 */
     
    9496        ipc_call_t answer;
    9597        aid_t req = async_send_0(exch, LOADER_GET_TASKID, &answer);
    96         int rc = async_data_read_start(exch, task_id, sizeof(task_id_t));
     98        sysarg_t rc = async_data_read_start(exch, task_id, sizeof(task_id_t));
    9799       
    98100        async_exchange_end(exch);
     
    113115 * @param ldr  Loader connection structure.
    114116 *
    115  * @return Zero on success or an error code.
     117 * @return Zero on success or negative error code.
    116118 *
    117119 */
     
    131133        ipc_call_t answer;
    132134        aid_t req = async_send_0(exch, LOADER_SET_CWD, &answer);
    133         int rc = async_data_write_start(exch, cwd, len);
     135        sysarg_t rc = async_data_write_start(exch, cwd, len);
    134136       
    135137        async_exchange_end(exch);
     
    151153 * @param file Program file.
    152154 *
    153  * @return Zero on success or an error code.
     155 * @return Zero on success or negative error code.
    154156 *
    155157 */
     
    161163        aid_t req = async_send_0(exch, LOADER_SET_PROGRAM, &answer);
    162164
    163         int rc = async_data_write_start(exch, name, str_size(name) + 1);
     165        sysarg_t rc = async_data_write_start(exch, name, str_size(name) + 1);
    164166        if (rc == EOK) {
    165167                async_exch_t *vfs_exch = vfs_exchange_begin();
     
    184186 * @param path Program path.
    185187 *
    186  * @return Zero on success or an error code.
     188 * @return Zero on success or negative error code.
    187189 *
    188190 */
     
    196198        }
    197199       
    198         int fd;
    199         int rc = vfs_lookup(path, 0, &fd);
    200         if (rc != EOK) {
    201                 return rc;
    202         }
    203        
    204         rc = loader_set_program(ldr, name, fd);
     200        int fd = vfs_lookup(path, 0);
     201        if (fd < 0) {
     202                return fd;
     203        }
     204       
     205        int rc = loader_set_program(ldr, name, fd);
    205206        vfs_put(fd);
    206207        return rc;
     
    217218 * @param argv NULL-terminated array of pointers to arguments.
    218219 *
    219  * @return Zero on success or an error code.
     220 * @return Zero on success or negative error code.
    220221 *
    221222 */
     
    252253        ipc_call_t answer;
    253254        aid_t req = async_send_0(exch, LOADER_SET_ARGS, &answer);
    254         int rc = async_data_write_start(exch, (void *) arg_buf,
     255        sysarg_t rc = async_data_write_start(exch, (void *) arg_buf,
    255256            buffer_size);
    256257       
     
    273274 * @param file       The file's descriptor.
    274275 *
    275  * @return Zero on success or an error code.
     276 * @return Zero on success or negative error code.
    276277 *
    277278 */
     
    283284        aid_t req = async_send_0(exch, LOADER_ADD_INBOX, NULL);
    284285       
    285         int rc = async_data_write_start(exch, name, str_size(name) + 1);
     286        sysarg_t rc = async_data_write_start(exch, name, str_size(name) + 1);
    286287        if (rc == EOK) {
    287288                rc = vfs_pass_handle(vfs_exch, file, exch);
     
    307308 * @param ldr Loader connection structure.
    308309 *
    309  * @return Zero on success or an error code.
     310 * @return Zero on success or negative error code.
    310311 *
    311312 */
     
    330331 * @param ldr Loader connection structure.
    331332 *
    332  * @return Zero on success or an error code.
     333 * @return Zero on success or negative error code.
    333334 *
    334335 */
     
    356357 * @param ldr Loader connection structure.
    357358 *
    358  * @return Zero on success or an error code.
     359 * @return Zero on success or negative error code.
    359360 *
    360361 */
Note: See TracChangeset for help on using the changeset viewer.