z/OS Communications Server: IP Sockets Application Programming Interface Guide and Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


getibmsockopt()

z/OS Communications Server: IP Sockets Application Programming Interface Guide and Reference
SC27-3660-00

Like getsockopt() call, the getibmsockopt() call gets the options associated with a socket in the AF_INET domain. This call is for options specific to the IBM® implementation of sockets. Currently, only the SOL_SOCKET level is supported.

This call can be used only in the AF_INET domain.

#include <manifest.h>
#include <socket.h>
int getibmsockopt(int s, int level, int optname, char *optval, int *optlen)
Parameter
Description
s
The socket descriptor
level
The level for which the option is set
optname
The name of a specified socket option
optval
Points to option data
optlen
Points to the length of the option data

Return values

The value 0 indicates success; the value -1 indicates an error. Errno identifies the specific error.
Errno
Description
EBADF
The s parameter is not a valid socket descriptor.
EFAULT
Using optval and optlen parameters would result in an attempt to access storage outside the caller address space.
EINVAL
This is returned when optlen points to a length of 0.

Example

#include <manifest.h>
#include <socket.h>
#include <tcperror.h>
 { struct ibm_bulkmode_struct bulkstr;
   int optlen, rc;
   optlen = sizeof(bulkstr);
   rc = getibmsockopt(s, SOL_SOCKET, (char *), &bulkstr, &optlen);
   if (rc < 0)
     { tcperror("on getibmsockopt()");
       exit(1);
     }
   fprintf(stream,"%d byte buffer available for outbound queue.\n",
           bulkstr.b_max_send_queue_size_avail);
 }

Related calls

ibmsflush(), setibmsockopt(), getsockopt()

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014