Specifications
Return
The return value is zero on success. If no system clock is available, the return value is -ENOTSUP.
Related Information
• alt_alarm_start() on page 14-10
• alt_alarm_stop() on page 14-11
• alt_nticks() on page 14-46
• alt_sysclk_init() on page 14-65
• alt_tick() on page 14-48
• alt_ticks_per_second() on page 14-49
• settimeofday() on page 14-61
• times() on page 14-67
• usleep() on page 14-70
• newlib Library Documentation
ioctl()
Prototype
int ioctl (int fd, int req, void* arg)
Commonly Called By
C/C++ programs
Device drivers
Thread-safe
See description.
Available from ISR
No.
Include
<sys/ioctl.h>
Description
The ioctl() function allows application code to manipulate the I/O capabilities of a device driver in
driver-specific ways. This function is equivalent to the standard UNIX ioctl() function. The input
argument fd is an open file descriptor for the device to manipulate, req is an enumeration defining the
operation request, and the interpretation of arg is request specific.
For file subsystems, ioctl() is wrapper function that passes control directly to the appropriate device
driver’s ioctl() function (as registered in the driver’s alt_dev structure).
For devices, ioctl() handles TIOCEXCL and TIOCNXCL requests internally, without calling the device
driver. These requests lock and release a device for exclusive access. For requests other than TIOCEXCL and
TIOCNXCL, ioctl() passes control to the device driver’s ioctl() function.
NII5V2
2015.05.14
ioctl()
14-73
HAL API Reference
Altera Corporation
Send Feedback