Ignore:
File:
1 edited

Legend:

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

    rd96d9bc rcde999a  
    5252 * @param name Symbolic name to set on the newly created task.
    5353 *
    54  * @return Pointer to the loader connection structure (should be
    55  *         deallocated using free() after use).
    56  *
     54 * @return Error code.
    5755 */
    5856int loader_spawn(const char *name)
    5957{
    60         return __SYSCALL2(SYS_PROGRAM_SPAWN_LOADER,
     58        return (int) __SYSCALL2(SYS_PROGRAM_SPAWN_LOADER,
    6159            (sysarg_t) name, str_size(name));
    6260}
     
    8684 * @param task_id Points to a variable where the ID should be stored.
    8785 *
    88  * @return Zero on success or negative error code.
     86 * @return Zero on success or an error code.
    8987 *
    9088 */
     
    9694        ipc_call_t answer;
    9795        aid_t req = async_send_0(exch, LOADER_GET_TASKID, &answer);
    98         sysarg_t rc = async_data_read_start(exch, task_id, sizeof(task_id_t));
     96        int rc = async_data_read_start(exch, task_id, sizeof(task_id_t));
    9997       
    10098        async_exchange_end(exch);
     
    115113 * @param ldr  Loader connection structure.
    116114 *
    117  * @return Zero on success or negative error code.
     115 * @return Zero on success or an error code.
    118116 *
    119117 */
     
    133131        ipc_call_t answer;
    134132        aid_t req = async_send_0(exch, LOADER_SET_CWD, &answer);
    135         sysarg_t rc = async_data_write_start(exch, cwd, len);
     133        int rc = async_data_write_start(exch, cwd, len);
    136134       
    137135        async_exchange_end(exch);
     
    153151 * @param file Program file.
    154152 *
    155  * @return Zero on success or negative error code.
     153 * @return Zero on success or an error code.
    156154 *
    157155 */
     
    163161        aid_t req = async_send_0(exch, LOADER_SET_PROGRAM, &answer);
    164162
    165         sysarg_t rc = async_data_write_start(exch, name, str_size(name) + 1);
     163        int rc = async_data_write_start(exch, name, str_size(name) + 1);
    166164        if (rc == EOK) {
    167165                async_exch_t *vfs_exch = vfs_exchange_begin();
     
    186184 * @param path Program path.
    187185 *
    188  * @return Zero on success or negative error code.
     186 * @return Zero on success or an error code.
    189187 *
    190188 */
     
    198196        }
    199197       
    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);
     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);
    206205        vfs_put(fd);
    207206        return rc;
     
    218217 * @param argv NULL-terminated array of pointers to arguments.
    219218 *
    220  * @return Zero on success or negative error code.
     219 * @return Zero on success or an error code.
    221220 *
    222221 */
     
    253252        ipc_call_t answer;
    254253        aid_t req = async_send_0(exch, LOADER_SET_ARGS, &answer);
    255         sysarg_t rc = async_data_write_start(exch, (void *) arg_buf,
     254        int rc = async_data_write_start(exch, (void *) arg_buf,
    256255            buffer_size);
    257256       
     
    274273 * @param file       The file's descriptor.
    275274 *
    276  * @return Zero on success or negative error code.
     275 * @return Zero on success or an error code.
    277276 *
    278277 */
     
    284283        aid_t req = async_send_0(exch, LOADER_ADD_INBOX, NULL);
    285284       
    286         sysarg_t rc = async_data_write_start(exch, name, str_size(name) + 1);
     285        int rc = async_data_write_start(exch, name, str_size(name) + 1);
    287286        if (rc == EOK) {
    288287                rc = vfs_pass_handle(vfs_exch, file, exch);
     
    308307 * @param ldr Loader connection structure.
    309308 *
    310  * @return Zero on success or negative error code.
     309 * @return Zero on success or an error code.
    311310 *
    312311 */
     
    331330 * @param ldr Loader connection structure.
    332331 *
    333  * @return Zero on success or negative error code.
     332 * @return Zero on success or an error code.
    334333 *
    335334 */
     
    357356 * @param ldr Loader connection structure.
    358357 *
    359  * @return Zero on success or negative error code.
     358 * @return Zero on success or an error code.
    360359 *
    361360 */
Note: See TracChangeset for help on using the changeset viewer.