libafdt
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Groups
Functions
Synchronous Client Interface

Functions

int afdt_sync_client (const char *fname, const uint8_t *request, uint32_t request_length, uint8_t *response, uint32_t *response_length, int *received_fd, const struct timeval *timeout, struct afdt_error_t *err)
 Request a file descriptor from a server. More...
 

Detailed Description

The synchronous interface provides a very simple function allowing clients to communicate with servers using the asynchronous interface. The function is blocking, but supports an optional timeout.

Function Documentation

int afdt_sync_client ( const char *  fname,
const uint8_t *  request,
uint32_t  request_length,
uint8_t *  response,
uint32_t *  response_length,
int *  received_fd,
const struct timeval *  timeout,
struct afdt_error_t err 
)

Request a file descriptor from a server.

Parameters
fnameFile to connect PF_LOCAL socket to.
requestRequest buffer to send.
request_lengthLength of request.
responseBuffer for response.
response_lengthPointer to response length, returns with actual length.
received_fdReturns with received fd, or <0 if none.
timeoutTimeout when waiting for response, or NULL.
errStructure to populate with error information.
Returns
>=0 if successful, <0 on failure.