XSocket API  2.0
XIA Socket Library
Functions
Xfcntl.c File Reference

Xfcntl() - manipulate a socket. More...

#include "Xsocket.h"

Functions

int Xfcntl (int sockfd, int cmd,...)
 manipulate an Xsocket More...
 

Function Documentation

int Xfcntl ( int  sockfd,
int  cmd,
  ... 
)

Xfcntl() performs a subset of the fcntl() system call supporting the operations described below on the open Xsocket sockfd. The operation is determined by cmd.

Xfcntl() can take an optional third argument. Whether or not this argument is required is determined by cmd. The required argument type is an int or void if the argument is not required.

Note
See the man page for the standard fcntl() call for more details.
Parameters
sockfda file descriptor create by Xsocket()
cmdthe command to execute
F_GETFL: Get the socket's status flags
F_SETFL: Set the socket's flags. Currently only O_NONBLOCK is supported. Other flags are ignored but do not cause an error.
argthe flag to set if cmd == F_GETFL, otherwise omitted
Returns
socket flags if cmd == F_GETFL
0 on success if cmd == F_SETFL
-1 on error with errno set to an error compatible with those returned by the standard fcntl call.