nfs_nfsiod.c (36541) | nfs_nfsiod.c (38482) |
---|---|
1/* 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Rick Macklem at The University of Guelph. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 20 unchanged lines hidden (view full) --- 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 * 36 * @(#)nfs_syscalls.c 8.5 (Berkeley) 3/30/95 | 1/* 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Rick Macklem at The University of Guelph. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 20 unchanged lines hidden (view full) --- 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 * 36 * @(#)nfs_syscalls.c 8.5 (Berkeley) 3/30/95 |
37 * $Id: nfs_syscalls.c,v 1.40 1998/05/31 18:46:06 peter Exp $ | 37 * $Id: nfs_syscalls.c,v 1.41 1998/05/31 20:08:55 peter Exp $ |
38 */ 39 40#include <sys/param.h> 41#include <sys/systm.h> 42#include <sys/sysproto.h> 43#include <sys/kernel.h> 44#include <sys/sysctl.h> 45#include <sys/file.h> --- 349 unchanged lines hidden (view full) --- 395 } 396 397 /* 398 * Set protocol specific options { for now TCP only } and 399 * reserve some space. For datagram sockets, this can get called 400 * repeatedly for the same socket, but that isn't harmful. 401 */ 402 if (so->so_type == SOCK_STREAM) { | 38 */ 39 40#include <sys/param.h> 41#include <sys/systm.h> 42#include <sys/sysproto.h> 43#include <sys/kernel.h> 44#include <sys/sysctl.h> 45#include <sys/file.h> --- 349 unchanged lines hidden (view full) --- 395 } 396 397 /* 398 * Set protocol specific options { for now TCP only } and 399 * reserve some space. For datagram sockets, this can get called 400 * repeatedly for the same socket, but that isn't harmful. 401 */ 402 if (so->so_type == SOCK_STREAM) { |
403 MGET(m, M_WAIT, MT_SOOPTS); 404 *mtod(m, int32_t *) = 1; 405 m->m_len = sizeof(int32_t); 406 sosetopt(so, SOL_SOCKET, SO_KEEPALIVE, m, p); | 403 struct sockopt sopt; 404 int val; 405 406 bzero(&sopt, sizeof sopt); 407 sopt.sopt_level = SOL_SOCKET; 408 sopt.sopt_name = SO_KEEPALIVE; 409 sopt.sopt_val = &val; 410 sopt.sopt_valsize = sizeof val; 411 val = 1; 412 sosetopt(so, &sopt); |
407 } 408 if (so->so_proto->pr_domain->dom_family == AF_INET && 409 so->so_proto->pr_protocol == IPPROTO_TCP) { | 413 } 414 if (so->so_proto->pr_domain->dom_family == AF_INET && 415 so->so_proto->pr_protocol == IPPROTO_TCP) { |
410 MGET(m, M_WAIT, MT_SOOPTS); 411 *mtod(m, int32_t *) = 1; 412 m->m_len = sizeof(int32_t); 413 sosetopt(so, IPPROTO_TCP, TCP_NODELAY, m, p); | 416 struct sockopt sopt; 417 int val; 418 419 bzero(&sopt, sizeof sopt); 420 sopt.sopt_level = IPPROTO_TCP; 421 sopt.sopt_name = TCP_NODELAY; 422 sopt.sopt_val = &val; 423 sopt.sopt_valsize = sizeof val; 424 val = 1; 425 sosetopt(so, &sopt); |
414 } 415 so->so_rcv.sb_flags &= ~SB_NOINTR; 416 so->so_rcv.sb_timeo = 0; 417 so->so_snd.sb_flags &= ~SB_NOINTR; 418 so->so_snd.sb_timeo = 0; 419 if (tslp) 420 slp = tslp; 421 else { --- 772 unchanged lines hidden --- | 426 } 427 so->so_rcv.sb_flags &= ~SB_NOINTR; 428 so->so_rcv.sb_timeo = 0; 429 so->so_snd.sb_flags &= ~SB_NOINTR; 430 so->so_snd.sb_timeo = 0; 431 if (tslp) 432 slp = tslp; 433 else { --- 772 unchanged lines hidden --- |