h6. [[Internet]] h6(. » [[Internet SWI Calls|SWI Calls]] h6((. » Socket_Getsockopt h2. Socket_Getsockopt h5. (SWI &4120D) |_<^{width:4em}. Entry | | |<^. R0 |<^. Socket descriptor | |<^. R1 |<^. Option level | |<^. R2 |<^. Option number to read | |<^. R3 |<^. Pointer to buffer to receive value into | |<^. R4 |<^. Pointer to an integer containing the size of buffer provided | |_<^{width:4em}. Exit | | |<^. R0 |<^. Corrupted | h4. Use The purpose of this call is to read one of the options for an open socket. h4. Berkeley sockets equivalence This SWI directly corresponds to the function "getsockopt":https://pubs.opengroup.org/onlinepubs/9699919799/functions/getsockopt.html and would ordinarily be called from C using the <code>getsockopt()</code> function in <code>socklib.h</code>. h4. Notes If the integer pointed to by R4 describes a buffer which is too small to receive the value, the value will be truncated to fit the buffer. If the buffer is sufficiently large, the integer pointed to by R4 will be updated with the actual number of bytes copied. h4. See also * [[Internet]] * [[Socket_Setsockopt]] * [[Socket_Creat]]