Lines Matching full:error

127 	int error;  in linux_ptrace_status()  local
130 error = kern_ptrace(td, PT_LWPINFO, pid, &lwpinfo, sizeof(lwpinfo)); in linux_ptrace_status()
132 if (error != 0) { in linux_ptrace_status()
133 linux_msg(td, "PT_LWPINFO failed with error %d", error); in linux_ptrace_status()
162 int error; in linux_ptrace_peek() local
164 error = kern_ptrace(td, PT_READ_I, pid, addr, 0); in linux_ptrace_peek()
165 if (error == 0) in linux_ptrace_peek()
166 error = copyout(td->td_retval, data, sizeof(l_int)); in linux_ptrace_peek()
167 else if (error == ENOMEM) in linux_ptrace_peek()
168 error = EIO; in linux_ptrace_peek()
169 td->td_retval[0] = error; in linux_ptrace_peek()
171 return (error); in linux_ptrace_peek()
241 int error, sig; in linux_ptrace_getsiginfo() local
243 error = kern_ptrace(td, PT_LWPINFO, pid, &lwpinfo, sizeof(lwpinfo)); in linux_ptrace_getsiginfo()
244 if (error != 0) { in linux_ptrace_getsiginfo()
245 linux_msg(td, "PT_LWPINFO failed with error %d", error); in linux_ptrace_getsiginfo()
246 return (error); in linux_ptrace_getsiginfo()
250 error = EINVAL; in linux_ptrace_getsiginfo()
251 linux_msg(td, "no PL_FLAG_SI, returning %d", error); in linux_ptrace_getsiginfo()
252 return (error); in linux_ptrace_getsiginfo()
258 error = copyout(&l_siginfo, (void *)data, sizeof(l_siginfo)); in linux_ptrace_getsiginfo()
259 return (error); in linux_ptrace_getsiginfo()
267 int error; in linux_ptrace_getregs() local
269 error = kern_ptrace(td, PT_GETREGS, pid, &b_reg, 0); in linux_ptrace_getregs()
270 if (error != 0) in linux_ptrace_getregs()
271 return (error); in linux_ptrace_getregs()
274 error = linux_ptrace_getregs_machdep(td, pid, &l_regset); in linux_ptrace_getregs()
275 if (error != 0) in linux_ptrace_getregs()
276 return (error); in linux_ptrace_getregs()
278 error = copyout(&l_regset, (void *)data, sizeof(l_regset)); in linux_ptrace_getregs()
279 return (error); in linux_ptrace_getregs()
287 int error; in linux_ptrace_setregs() local
289 error = copyin(data, &l_regset, sizeof(l_regset)); in linux_ptrace_setregs()
290 if (error != 0) in linux_ptrace_setregs()
291 return (error); in linux_ptrace_setregs()
293 error = kern_ptrace(td, PT_SETREGS, pid, &b_reg, 0); in linux_ptrace_setregs()
294 return (error); in linux_ptrace_setregs()
304 int error; in linux_ptrace_getregset_prstatus() local
306 error = copyin((const void *)data, &iov, sizeof(iov)); in linux_ptrace_getregset_prstatus()
307 if (error != 0) { in linux_ptrace_getregset_prstatus()
308 linux_msg(td, "copyin error %d", error); in linux_ptrace_getregset_prstatus()
309 return (error); in linux_ptrace_getregset_prstatus()
312 error = kern_ptrace(td, PT_GETREGS, pid, &b_reg, 0); in linux_ptrace_getregset_prstatus()
313 if (error != 0) in linux_ptrace_getregset_prstatus()
314 return (error); in linux_ptrace_getregset_prstatus()
317 error = linux_ptrace_getregs_machdep(td, pid, &l_regset); in linux_ptrace_getregset_prstatus()
318 if (error != 0) in linux_ptrace_getregset_prstatus()
319 return (error); in linux_ptrace_getregset_prstatus()
322 error = copyout(&l_regset, (void *)iov.iov_base, len); in linux_ptrace_getregset_prstatus()
323 if (error != 0) { in linux_ptrace_getregset_prstatus()
324 linux_msg(td, "copyout error %d", error); in linux_ptrace_getregset_prstatus()
325 return (error); in linux_ptrace_getregset_prstatus()
329 error = copyout(&iov, (void *)data, sizeof(iov)); in linux_ptrace_getregset_prstatus()
330 if (error != 0) { in linux_ptrace_getregset_prstatus()
331 linux_msg(td, "iov copyout error %d", error); in linux_ptrace_getregset_prstatus()
332 return (error); in linux_ptrace_getregset_prstatus()
335 return (error); in linux_ptrace_getregset_prstatus()
376 int error; in linux_ptrace_get_syscall_info() local
378 error = kern_ptrace(td, PT_LWPINFO, pid, &lwpinfo, sizeof(lwpinfo)); in linux_ptrace_get_syscall_info()
379 if (error != 0) { in linux_ptrace_get_syscall_info()
380 linux_msg(td, "PT_LWPINFO failed with error %d", error); in linux_ptrace_get_syscall_info()
381 return (error); in linux_ptrace_get_syscall_info()
399 error = kern_ptrace(td, PT_GET_SC_ARGS, pid, in linux_ptrace_get_syscall_info()
401 if (error != 0) { in linux_ptrace_get_syscall_info()
402 linux_msg(td, "PT_GET_SC_ARGS failed with error %d", in linux_ptrace_get_syscall_info()
403 error); in linux_ptrace_get_syscall_info()
404 return (error); in linux_ptrace_get_syscall_info()
408 error = kern_ptrace(td, PT_GET_SC_RET, pid, &sr, sizeof(sr)); in linux_ptrace_get_syscall_info()
410 if (error != 0) { in linux_ptrace_get_syscall_info()
411 linux_msg(td, "PT_GET_SC_RET failed with error %d", in linux_ptrace_get_syscall_info()
412 error); in linux_ptrace_get_syscall_info()
413 return (error); in linux_ptrace_get_syscall_info()
424 * it's an error or not just bail out and let in linux_ptrace_get_syscall_info()
439 error = kern_ptrace(td, PT_GETREGS, pid, &b_reg, 0); in linux_ptrace_get_syscall_info()
440 if (error != 0) in linux_ptrace_get_syscall_info()
441 return (error); in linux_ptrace_get_syscall_info()
446 error = copyout(&si, (void *)data, len); in linux_ptrace_get_syscall_info()
447 if (error == 0) in linux_ptrace_get_syscall_info()
450 return (error); in linux_ptrace_get_syscall_info()
458 int error, sig; in linux_ptrace() local
468 error = kern_ptrace(td, PT_TRACE_ME, 0, 0, 0); in linux_ptrace()
472 error = linux_ptrace_peek(td, pid, addr, (void *)uap->data); in linux_ptrace()
473 if (error != 0) in linux_ptrace()
478 error = linux_ptrace_peek(td, pid, in linux_ptrace()
482 error = linux_ptrace_peekuser(td, pid, addr, (void *)uap->data); in linux_ptrace()
486 error = kern_ptrace(td, PT_WRITE_D, pid, addr, uap->data); in linux_ptrace()
487 if (error != 0) in linux_ptrace()
492 error = kern_ptrace(td, PT_WRITE_D, pid, in linux_ptrace()
496 error = linux_ptrace_pokeuser(td, pid, addr, (void *)uap->data); in linux_ptrace()
499 error = map_signum(uap->data, &sig); in linux_ptrace()
500 if (error != 0) in linux_ptrace()
502 error = kern_ptrace(td, PT_CONTINUE, pid, (void *)1, sig); in linux_ptrace()
505 error = kern_ptrace(td, PT_KILL, pid, addr, uap->data); in linux_ptrace()
508 error = map_signum(uap->data, &sig); in linux_ptrace()
509 if (error != 0) in linux_ptrace()
511 error = kern_ptrace(td, PT_STEP, pid, (void *)1, sig); in linux_ptrace()
514 error = linux_ptrace_getregs(td, pid, (void *)uap->data); in linux_ptrace()
517 error = linux_ptrace_setregs(td, pid, (void *)uap->data); in linux_ptrace()
520 error = kern_ptrace(td, PT_ATTACH, pid, addr, uap->data); in linux_ptrace()
523 error = map_signum(uap->data, &sig); in linux_ptrace()
524 if (error != 0) in linux_ptrace()
526 error = kern_ptrace(td, PT_DETACH, pid, (void *)1, sig); in linux_ptrace()
529 error = map_signum(uap->data, &sig); in linux_ptrace()
530 if (error != 0) in linux_ptrace()
532 error = kern_ptrace(td, PT_SYSCALL, pid, (void *)1, sig); in linux_ptrace()
535 error = linux_ptrace_setoptions(td, pid, uap->data); in linux_ptrace()
538 error = linux_ptrace_geteventmsg(td, pid, uap->data); in linux_ptrace()
541 error = linux_ptrace_getsiginfo(td, pid, uap->data); in linux_ptrace()
544 error = linux_ptrace_getregset(td, pid, uap->addr, uap->data); in linux_ptrace()
547 error = linux_ptrace_seize(td, pid, uap->addr, uap->data); in linux_ptrace()
550 error = linux_ptrace_get_syscall_info(td, pid, uap->addr, uap->data); in linux_ptrace()
555 error = EINVAL; in linux_ptrace()
560 if (error == EBUSY) in linux_ptrace()
561 error = ESRCH; in linux_ptrace()
563 return (error); in linux_ptrace()