Lines Matching refs:ret

56     int ret = validate_strlen(cs, tstr, tlen);  in validate_lock_user_string()  local
60 if (ret > 0) { in validate_lock_user_string()
61 str = lock_user(VERIFY_READ, tstr, ret, true); in validate_lock_user_string()
62 ret = str ? 0 : -EFAULT; in validate_lock_user_string()
65 return ret; in validate_lock_user_string()
120 static void gdb_open_cb(CPUState *cs, uint64_t ret, int err) in gdb_open_cb() argument
124 associate_guestfd(guestfd, ret); in gdb_open_cb()
125 ret = guestfd; in gdb_open_cb()
127 gdb_open_complete(cs, ret, err); in gdb_open_cb()
263 int ret, host_flags = O_BINARY; in host_open() local
265 ret = validate_lock_user_string(&p, cs, fname, fname_len); in host_open()
266 if (ret < 0) { in host_open()
267 complete(cs, -1, -ret); in host_open()
288 ret = open(p, host_flags, mode); in host_open()
289 if (ret < 0) { in host_open()
293 associate_guestfd(guestfd, ret); in host_open()
321 ssize_t ret; in host_read() local
327 ret = RETRY_ON_EINTR(read(gf->hostfd, ptr, len)); in host_read()
328 if (ret == -1) { in host_read()
332 unlock_user(ptr, buf, ret); in host_read()
333 complete(cs, ret, 0); in host_read()
342 ssize_t ret; in host_write() local
348 ret = write(gf->hostfd, ptr, len); in host_write()
350 complete(cs, ret, ret == -1 ? errno : 0); in host_write()
361 off_t ret = off; in host_lseek() local
364 if (ret == off) { in host_lseek()
365 ret = lseek(gf->hostfd, ret, whence); in host_lseek()
366 if (ret == -1) { in host_lseek()
370 ret = -1; in host_lseek()
373 complete(cs, ret, err); in host_lseek()
379 int ret = isatty(gf->hostfd); in host_isatty() local
380 complete(cs, ret, ret ? 0 : errno); in host_isatty()
399 int ret; in host_fstat() local
401 ret = fstat(gf->hostfd, &buf); in host_fstat()
402 if (ret) { in host_fstat()
406 ret = copy_stat_to_user(cs, addr, &buf); in host_fstat()
407 complete(cs, ret ? -1 : 0, ret ? -ret : 0); in host_fstat()
417 int ret, err; in host_stat() local
419 ret = validate_lock_user_string(&name, cs, fname, fname_len); in host_stat()
420 if (ret < 0) { in host_stat()
421 complete(cs, -1, -ret); in host_stat()
425 ret = stat(name, &buf); in host_stat()
426 if (ret) { in host_stat()
429 ret = copy_stat_to_user(cs, addr, &buf); in host_stat()
431 if (ret < 0) { in host_stat()
432 err = -ret; in host_stat()
433 ret = -1; in host_stat()
437 complete(cs, ret, err); in host_stat()
445 int ret; in host_remove() local
447 ret = validate_lock_user_string(&p, cs, fname, fname_len); in host_remove()
448 if (ret < 0) { in host_remove()
449 complete(cs, -1, -ret); in host_remove()
453 ret = remove(p); in host_remove()
455 complete(cs, ret, ret ? errno : 0); in host_remove()
464 int ret; in host_rename() local
466 ret = validate_lock_user_string(&ostr, cs, oname, oname_len); in host_rename()
467 if (ret < 0) { in host_rename()
468 complete(cs, -1, -ret); in host_rename()
471 ret = validate_lock_user_string(&nstr, cs, nname, nname_len); in host_rename()
472 if (ret < 0) { in host_rename()
474 complete(cs, -1, -ret); in host_rename()
478 ret = rename(ostr, nstr); in host_rename()
481 complete(cs, ret, ret ? errno : 0); in host_rename()
489 int ret; in host_system() local
491 ret = validate_lock_user_string(&p, cs, cmd, cmd_len); in host_system()
492 if (ret < 0) { in host_system()
493 complete(cs, -1, -ret); in host_system()
497 ret = system(p); in host_system()
499 complete(cs, ret, ret == -1 ? errno : 0); in host_system()
571 int64_t ret; in staticfile_lseek() local
575 ret = off; in staticfile_lseek()
578 ret = gf->staticfile.off + off; in staticfile_lseek()
581 ret = gf->staticfile.len + off; in staticfile_lseek()
584 ret = -1; in staticfile_lseek()
587 if (ret >= 0 && ret <= gf->staticfile.len) { in staticfile_lseek()
588 gf->staticfile.off = ret; in staticfile_lseek()
589 complete(cs, ret, 0); in staticfile_lseek()
610 int ret; in console_read() local
617 ret = qemu_semihosting_console_read(cs, ptr, len); in console_read()
618 unlock_user(ptr, buf, ret); in console_read()
619 complete(cs, ret, 0); in console_read()
627 int ret; in console_write() local
633 ret = qemu_semihosting_console_write(ptr, len); in console_write()
635 complete(cs, ret ? ret : -1, ret ? 0 : EIO); in console_write()
645 int ret; in console_fstat() local
647 ret = copy_stat_to_user(cs, addr, &tty_buf); in console_fstat()
648 complete(cs, ret ? -1 : 0, ret ? -ret : 0); in console_fstat()