⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 0771-0771.html

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 HTML
字号:
<HTML>

<HEAD>

<TITLE>Linux Complete Command Reference:System Calls:EarthWeb Inc.-</TITLE>

</HEAD>

<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
        var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>

 -->




<!-- ISBN=0672311046 //-->

<!-- TITLE=Linux Complete Command Reference//-->

<!-- AUTHOR=Red Hat//-->

<!-- PUBLISHER=Macmillan Computer Publishing//-->

<!-- IMPRINT=Sams//-->

<!-- CHAPTER=02 //-->

<!-- PAGES=0737-0890 //-->

<!-- UNASSIGNED1 //-->

<!-- UNASSIGNED2 //-->



<P><CENTER>

<a href="0767-0770.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0772-0775.html">Next</A></CENTER></P>







<A NAME="PAGENUM-771"><P>Page 771</P></A>





<P>l_onoff indicates whether to linger. If it is set to

1, l_linger contains the time in hundredths of seconds how long the

process should linger to complete the close. If

l_onoff is set to 0, the process returns immediately.

</P>



<P>The option SO_BROADCAST requests permission to send broadcast datagrams on the socket. Broadcast was a

privileged operation in earlier versions of the system. With protocols that support out-of-band data, the

SO_OOBINLINE option requests that out-of-band data be placed in the normal data input queue as received; it will then be accessible with

recv or read calls without the MSG_OOB flag. Some protocols always behave as if this option is set.

</P>



<P>SO_SNDBUF and SO_RCVBUF are options to 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 system places an absolute limit on these values.

</P>



<P>SO_SNDLOWAT is an option to set the minimum count for output operations. Most output operations process all of the

data supplied by the call, delivering data to the protocol for transmission and blocking as necessary for flow control.

Nonblocking output operations will process as much data as permitted subject to flow control without blocking, but will process no data

if flow control does not allow the smaller of the low water mark value or the entire request to be processed. A

select(2) operation testing the ability to write to a socket will return true only if the low water mark amount could be processed.

The default value for SO_SNDLOWAT is set to a convenient size for network efficiency, often

1024.

</P>



<P>SO_RCVLOWAT is an option to set the minimum count for input operations. In general, receive calls will block until

any (nonzero) amount of data is received, then return with the smaller of the amount available or the amount requested.

The default value for SO_RCVLOWAT is 1. If

SO_RCVLOWAT is set to a larger value, blocking receive calls normally wait until they

have received the smaller of the low water mark value or the requested amount. Receive calls may still return less than the

low water mark if an error occurs, a signal is caught, or the type of data next in the receive queue is different than that returned.

</P>



<P>SO_SNDTIMEO is an option to set a time-out value for output operations. It accepts a

struct timeval parameter with the number of seconds and microseconds used to limit waits for output operations to complete. If a send operation has

blocked for this much time, it returns with a partial count or with the error

EWOULDBLOCK if no data were sent. In the current implementation, this timer is restarted each time additional data are delivered to the protocol, implying that the limit

applies to output portions ranging in size from the low water mark to the high water mark for output.

</P>





<P>SO_RCVTIMEO is an option to set a time-out value for input operations. It accepts a

struct timeval parameter with the number of seconds and microseconds used to limit waits for input operations to complete. In the current implementation, this

timer is restarted each time additional data are received by the protocol, and thus the limit is in effect an inactivity timer. If

a receive operation has been blocked for this much time without receiving additional data, it returns with a short count or

with the error EWOULDBLOCK if no data were received.

</P>



<P>Finally, SO_TYPE and SO_ERROR are options used only with

setsockopt.

</P>



<P>SO_TYPE returns the type of the socket, such as

SOCK_STREAM; it is useful for servers that inherit sockets on startup.

</P>



<P>SO_ERROR returns any pending error on the socket and clears the error status. It may be used to check for asynchronous

errors on connected datagram sockets or for other asynchronous errors.

</P>



<P><B>

RETURN VALUE

</B></P>



<P>On success, 0 is returned. On error, _1 is returned and

errno is set appropriately.

</P>



<P><B>

ERRORS

</B></P>



<TABLE>



<TR><TD>

EBADF

</TD><TD>

The argument s is not a valid descriptor.

</TD></TR><TR><TD>

ENOTSOCK

</TD><TD>

The argument s is a file, not a socket.

</TD></TR><TR><TD>

ENOPROTOOPT

</TD><TD>

The option is unknown at the level indicated.

</TD></TR><TR><TD>

EFAULT

</TD><TD>

The address pointed to by optval is not in a valid part of the process address space.

For getsockopt, this error may also be returned if

optlen is not in a valid part of the process address space.

</TD></TR></TABLE>









<P><CENTER>

<a href="0767-0770.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0772-0775.html">Next</A></CENTER></P>







</td>
</tr>
</table>

<!-- begin footer information -->







</body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -