Have utrace(2) return ENOMEM if malloc() fails. Document this error

return in its manual page.

Reviewed by:	jhb
This commit is contained in:
Joseph Koshy 2003-11-11 04:54:11 +00:00
parent e35e0182c3
commit b10221ffd9
2 changed files with 7 additions and 5 deletions

View File

@ -65,15 +65,17 @@ Otherwise, a value of -1 is returned and
is set to indicate the error.
.Sh ERRORS
.Bl -tag -width Er
.It Bq Er ENOSYS
Currently running kernel was compiled without
.Xr ktrace 2
support (option KTRACE).
.It Bq Er EINVAL
Specified data length
.Fa len
was bigger than
.Dv KTR_USER_MAXLEN .
.It Bq Er ENOMEM
Insufficient memory to honor the request.
.It Bq Er ENOSYS
Currently running kernel was compiled without
.Xr ktrace 2
support (option KTRACE).
.El
.Sh SEE ALSO
.Xr kdump 1 ,

View File

@ -662,7 +662,7 @@ utrace(td, uap)
req = ktr_getrequest(KTR_USER);
if (req == NULL) {
free(cp, M_KTRACE);
return (0);
return (ENOMEM);
}
req->ktr_header.ktr_buffer = cp;
req->ktr_header.ktr_len = uap->len;