> Hi, > > I would like to obtain the maximum socket buffer > size. Solaris seems to not support _PC_SOCK_MAXBUF > for function fpathconf(). _PC_SOCK_MAXBUF is defined > by POSIX. > > Regards, > Shao.
>From the getsockopt(3socket) man page: SO_SNDBUF and SO_RCVBUF are options that adjust the normal buffer sizes allocated for output and input buffers, respectively. The buffer size may be increased for high-volume connections or may be decreased to limit the possible backlog of incoming data. The maximum buffer size for UDP is determined by the value of the ndd variable udp_max_buf. The maximum buffer size for TCP is determined the value of the ndd variable tcp_max_buf. Use the ndd(1M) utility to determine the current default values. See the Solaris Tunable Parameters Reference Manual for information on setting the values of udp_max_buf and tcp_max_buf. So, the commands are: (TCP) ndd -get /dev/tcp tcp_max_buf (the value I see on Solaris 10 11/06 is 1048576) (UDP) ndd -get /dev/udp udp_max_buf (the value I see on Solaris 10 11/06 is 2097152) There are also tunables whereby the default low and highwater marks can be set: for TCP: tcp_xmit_hiwat, tcp_xmit_lowat, tcp_recv_hiwat; for UDP: udp_xmit_hiwat, udp_xmit_lowat, udp_recv_hiwat. Although for TCP, there are some others that look related; you probably want to check the Solaris Tunable Parameters Reference Manual for full information. Similar tunables are also present for raw IP (or ICMP) using /dev/rawip or /dev/rawip6 (or /dev/icmp or /dev/icmp6, which are just other names for those), and for UDPv6 and TCPv6 as /dev/udp6 and /dev/tcp6. No idea what the max is for AF_UNIX sockets, or even how to find out short of looking at the code. I would suppose that it wouldn't be all that difficult for some of the major gurus to add support to fpathconf(2) for _PC_SOCK_MAXBUF, although since the sockfs code would have to be able to query all the protocols supported by the sockets interface to properly support that, it might not be easy or obvious to mere mortals (among which for this purpose, I include myself). It would be nice if each protocol provided a standard way for other modules (like sockfs) to find out such things, but if they do, I haven't found it; the alternative would be for sockfs to know details about each protocol it supported, which is ugly. Haven't even though about if it would be possible to query this for STREAMS connections, nor investigated whether that would be legal. So anyway, while it might not be that difficult, if there are enough design issues in doing it nicely, I would guess that it wouldn't happen overnight. This message posted from opensolaris.org _______________________________________________ opensolaris-discuss mailing list [email protected]
