sl@0: /** @file ../include/sys/ioccom.h sl@0: @internalComponent sl@0: */ sl@0: sl@0: /** @fn ioctl(int aFid, unsigned long aCmd, ...) sl@0: @param aFid sl@0: @param aCmd sl@0: @param ... sl@0: @return If an error has occurred, a value of -1 is returned and errno is set to indicate the error. sl@0: sl@0: @code sl@0: #include < sys/ioctl.h > sl@0: @endcode sl@0: The ioctl system call manipulates the underlying device parameters of special files. sl@0: In particular, many operating sl@0: characteristics of character special files (e.g. terminals) sl@0: may be controlled with ioctl requests. sl@0: The argument aFid sl@0: must be an open file descriptor. sl@0: sl@0: The third argument to ioctl is traditionally named char *argp . sl@0: Most uses of ioctl in 3.0, sl@0: however require the third argument to be a caddr_t sl@0: or an int. sl@0: sl@0: An ioctl request has encoded in it whether the argument is an "in" sl@0: argument sl@0: or "out" sl@0: argument, and the size of the argument argp in bytes. sl@0: Macros and defines used in specifying an ioctl request are located in the file \#include \ sl@0: sl@0: Examples: sl@0: @code sl@0: /* Detailed description : Sample usage of ioctl system call ,for command SIOCGIFINDEX sl@0: * which gets socket interface index , by passing socket interface home.*/ sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: int main() sl@0: { sl@0: int ret = 0; sl@0: struct ifreq ifr; sl@0: int sockfd; sl@0: sl@0: sockfd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); sl@0: strncpy(ifr.ifr_name, "Ethernet with Daemon Dynamic IP", sizeof(ifr.ifr_name)); sl@0: sl@0: if (ioctl(sockfd, SIOCGIFINDEX, 𝔦) != -1) sl@0: { sl@0: ret = -1; sl@0: } sl@0: sl@0: close(sockfd); sl@0: return ret; } sl@0: sl@0: @endcode sl@0: @see fcntl() sl@0: sl@0: sl@0: sl@0: @capability Deferred @ref Rsocket::Open sl@0: sl@0: @publishedAll sl@0: @externallyDefinedApi sl@0: */ sl@0: sl@0: /** @def _IOR(g,n,t) sl@0: sl@0: IO read. sl@0: sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: sl@0: /** @def _IOW(g,n,t) sl@0: sl@0: IO write. sl@0: sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: sl@0: /** @def _IOWR(g,n,t) sl@0: sl@0: IO read write. sl@0: sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: sl@0: