* this function is a POSIX compliant version, which shall perform a variety of * control functions on devices. * * @param fildes the file description * @param cmd the specified command * @param ... represents the additional information that is needed by this * specific device to perform the requested function. * * @return 0 on successful completion. Otherwise, -1 shall be returned and errn
| 526 | * set to indicate the error. |
| 527 | */ |
| 528 | int ioctl(int fildes, int cmd, ...) |
| 529 | { |
| 530 | void *arg; |
| 531 | va_list ap; |
| 532 | |
| 533 | va_start(ap, cmd); |
| 534 | arg = va_arg(ap, void *); |
| 535 | va_end(ap); |
| 536 | |
| 537 | /* we use fcntl for this API. */ |
| 538 | return fcntl(fildes, cmd, arg); |
| 539 | } |
| 540 | RTM_EXPORT(ioctl); |
| 541 | |
| 542 | /** |