+ switch (cmd) {
+
+ case FIONBIO: {
+ int nbio;
+ if (copyin(cmdp, (caddr_t)&nbio, sizeof (nbio))) {
+ u.u_error = EFAULT;
+ return;
+ }
+ if (nbio)
+ so->so_options |= SO_NONBLOCKING;
+ else
+ so->so_options &= ~SO_NONBLOCKING;
+ return;
+ }
+
+ case FIOASYNC: {
+ int async;
+ if (copyin(cmdp, (caddr_t)&async, sizeof (async))) {
+ u.u_error = EFAULT;
+ return;
+ }
+ if (async)
+ ;
+ else
+ ;
+ return;
+ }
+
+ case SIOCSKEEP: {
+ int keep;
+ if (copyin(cmdp, (caddr_t)&keep, sizeof (keep))) {
+ u.u_error = EFAULT;
+ return;
+ }
+ if (keep)
+ so->so_options &= ~SO_NOKEEPALIVE;
+ else
+ so->so_options |= SO_NOKEEPALIVE;
+ return;
+ }
+
+ case SIOCGKEEP: {
+ int keep = (so->so_options & SO_NOKEEPALIVE) == 0;
+ if (copyout((caddr_t)&keep, cmdp, sizeof (keep)))
+ u.u_error = EFAULT;
+ return;
+ }
+
+ case SIOCSLINGER: {
+ int linger;
+ if (copyin(cmdp, (caddr_t)&linger, sizeof (linger))) {
+ u.u_error = EFAULT;
+ return;
+ }
+ so->so_linger = linger;
+ if (so->so_linger)
+ so->so_options &= ~SO_DONTLINGER;
+ else
+ so->so_options |= SO_DONTLINGER;
+ return;
+ }
+
+ case SIOCGLINGER: {
+ int linger = so->so_linger;
+ if (copyout((caddr_t)&linger, cmdp, sizeof (linger))) {
+ u.u_error = EFAULT;
+ return;
+ }
+ }
+ case SIOCSPGRP: {
+ int pgrp;
+ if (copyin(cmdp, (caddr_t)&pgrp, sizeof (pgrp))) {
+ u.u_error = EFAULT;
+ return;
+ }
+ so->so_pgrp = pgrp;
+ return;
+ }
+
+ case SIOCGPGRP: {
+ int pgrp = so->so_pgrp;
+ if (copyout((caddr_t)&pgrp, cmdp, sizeof (pgrp))) {
+ u.u_error = EFAULT;
+ return;
+ }
+ }