Lines Matching refs:error

105 	int error;  in sctp_syscalls_init()  local
107 error = syscall_helper_register(sctp_syscalls, SY_THR_STATIC_KLD); in sctp_syscalls_init()
108 if (error != 0) in sctp_syscalls_init()
109 return (error); in sctp_syscalls_init()
111 error = syscall32_helper_register(sctp32_syscalls, SY_THR_STATIC_KLD); in sctp_syscalls_init()
112 if (error != 0) in sctp_syscalls_init()
113 return (error); in sctp_syscalls_init()
125 int error; in sctp_syscalls_uninit() local
128 error = syscall32_helper_unregister(sctp32_syscalls); in sctp_syscalls_uninit()
129 if (error != 0) in sctp_syscalls_uninit()
130 return (error); in sctp_syscalls_uninit()
132 error = syscall_helper_unregister(sctp_syscalls); in sctp_syscalls_uninit()
133 if (error != 0) in sctp_syscalls_uninit()
134 return (error); in sctp_syscalls_uninit()
153 int error, fd; local
156 error = getsock_cap(td, uap->sd, cap_rights_init_one(&rights, CAP_PEELOFF),
158 if (error != 0)
162 error = EOPNOTSUPP;
165 error = sctp_can_peel_off(head, (sctp_assoc_t)uap->name);
166 if (error != 0)
174 error = falloc(td, &nfp, &fd, 0);
175 if (error != 0)
182 error = ENOMEM;
186 error = sctp_do_peeloff(head, so, (sctp_assoc_t)uap->name);
187 if (error != 0)
197 if (error != 0)
209 return (error);
235 int error = 0, len; local
238 error = copyin(uap->sinfo, &sinfo, sizeof (sinfo));
239 if (error != 0)
240 return (error);
246 error = getsockaddr(&to, uap->to, uap->tolen);
247 if (error != 0) {
255 error = getsock_cap(td, uap->sd, &rights, &fp, NULL, NULL);
256 if (error != 0)
268 error = EOPNOTSUPP;
272 error = mac_socket_check_send(td->td_ucred, so);
273 if (error != 0)
290 error = sctp_lower_sosend(so, to, &auio, (struct mbuf *)NULL,
293 if (error != 0) {
294 if (auio.uio_resid != len && (error == ERESTART ||
295 error == EINTR || error == EWOULDBLOCK))
296 error = 0;
298 if (error == EPIPE && !(so->so_options & SO_NOSIGPIPE) &&
305 if (error == 0)
310 ktrgenio(uap->sd, UIO_WRITE, ktruio, error);
318 return (error);
345 int error, i; local
348 error = copyin(uap->sinfo, &sinfo, sizeof (sinfo));
349 if (error != 0)
350 return (error);
355 error = getsockaddr(&to, uap->to, uap->tolen);
356 if (error != 0) {
364 error = getsock_cap(td, uap->sd, &rights, &fp, NULL, NULL);
365 if (error != 0)
370 error = freebsd32_copyiniov((struct iovec32 *)uap->iov,
374 error = copyiniov(uap->iov, uap->iovlen, &iov, EMSGSIZE);
375 if (error != 0)
384 error = EOPNOTSUPP;
388 error = mac_socket_check_send(td->td_ucred, so);
389 if (error != 0)
403 error = EINVAL;
413 error = sctp_lower_sosend(so, to, &auio,
417 if (error != 0) {
418 if (auio.uio_resid != len && (error == ERESTART ||
419 error == EINTR || error == EWOULDBLOCK))
420 error = 0;
422 if (error == EPIPE && !(so->so_options & SO_NOSIGPIPE) &&
429 if (error == 0)
434 ktrgenio(uap->sd, UIO_WRITE, ktruio, error);
444 return (error);
472 int error, fromlen, i, msg_flags; local
475 error = getsock_cap(td, uap->sd, cap_rights_init_one(&rights, CAP_RECV),
477 if (error != 0)
478 return (error);
481 error = freebsd32_copyiniov((struct iovec32 *)uap->iov,
485 error = copyiniov(uap->iov, uap->iovlen, &iov, EMSGSIZE);
486 if (error != 0)
491 error = EOPNOTSUPP;
495 error = mac_socket_check_receive(td->td_ucred, so);
496 if (error != 0)
501 error = copyin(uap->fromlenaddr, &fromlen, sizeof (fromlen));
502 if (error != 0)
508 error = copyin(uap->msg_flags, &msg_flags, sizeof (int));
509 if (error != 0)
524 error = EINVAL;
537 error = sctp_sorecvmsg(so, &auio, (struct mbuf **)NULL,
541 if (error != 0) {
542 if (auio.uio_resid != len && (error == ERESTART ||
543 error == EINTR || error == EWOULDBLOCK))
544 error = 0;
547 error = copyout(&sinfo, uap->sinfo, sizeof (sinfo));
552 ktrgenio(uap->sd, UIO_READ, ktruio, error);
555 if (error != 0)
565 error = copyout(fromsa, uap->from, (size_t)len);
566 if (error != 0)
569 error = copyout(&len, uap->fromlenaddr, sizeof (socklen_t));
570 if (error != 0)
578 error = copyout(&msg_flags, uap->msg_flags, sizeof (int));
579 if (error != 0)
588 return (error);