iofdinfo()

Updated: April 19, 2023

Retrieve server attributes

Synopsis:

#include <sys/iomgr.h>

int iofdinfo( int filedes,
              unsigned flags, 
              struct _fdinfo * info, 
              char * path, 
              int maxlen );

Arguments:

filedes
A file descriptor for the connection that you want to query.
flags
Specify _FDINFO_FLAG_LOCALPATH to return only the local path info (i.e. exclude the network path info).
info
NULL, or a pointer to an _fdinfo structure that contains the connection information defined in <sys/iomgr.h>. Specify NULL if it's not required.
path
A pointer to a buffer where the function can store the path associated with the file descriptor. The pathname is always null-terminated. You can specify NULL if it's not required.
maxlen
The length of the buffer pointed to by path. If the given length is too small to hold the entire pathname, the pathname is truncated.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Description:

The iofdinfo() function retrieves the server's attribute information for the connection referred to by filedes.

Returns:

The size of the buffer needed to store the path, which is equal to the length of the filedes pathname plus one (for the null-terminator), or -1 if an error occurs (errno is set).

Errors:

EFAULT
A fault occurred in the server's address space when it tried to access the caller's message buffers.
EMSGSIZE
Insufficient space is available in the server's buffer for the _fdinfo data structure.

Classification:

QNX Neutrino

Safety:  
Cancellation point No
Interrupt handler No
Signal handler Yes
Thread Yes