summaryrefslogtreecommitdiff
path: root/nuttx/include/nuttx
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-11-29 10:53:22 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-11-29 10:53:22 -0600
commit6fa66b5a77300b73f40dbaae2bb831d92eaa8fe6 (patch)
tree64046c058f5f6e86d9f59dee44f9b6faba15d4cf /nuttx/include/nuttx
parent7773304d911066ca3345eb295a944d949fd220c4 (diff)
downloadnuttx-6fa66b5a77300b73f40dbaae2bb831d92eaa8fe6.tar.gz
nuttx-6fa66b5a77300b73f40dbaae2bb831d92eaa8fe6.tar.bz2
nuttx-6fa66b5a77300b73f40dbaae2bb831d92eaa8fe6.zip
Add support for a variadic ioctl() function. The ioctl() interface is a non-standard, Unix interface. NuttX has always used the older, three-parameter version. Most contemporary systems now, however, use a variadic form of the ioctl() function. Added an option to insert a shim layer to adapt the three-parameter ioctl() to use the variadic interface form. Internally, the ioctl handling is the same three-parameter logic. The only real complexity to the shim is in how the system calls must be handled.
Diffstat (limited to 'nuttx/include/nuttx')
-rw-r--r--nuttx/include/nuttx/fs/fs.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/nuttx/include/nuttx/fs/fs.h b/nuttx/include/nuttx/fs/fs.h
index 68d3a3725..1baa91cee 100644
--- a/nuttx/include/nuttx/fs/fs.h
+++ b/nuttx/include/nuttx/fs/fs.h
@@ -624,6 +624,40 @@ int open_blockdriver(FAR const char *pathname, int mountflags,
int close_blockdriver(FAR struct inode *inode);
#endif
+/* fs/vfs/fs_ioctl.c ********************************************************/
+/****************************************************************************
+ * Name: fs_ioctl
+ *
+ * Description:
+ * Perform device specific operations.
+ *
+ * Parameters:
+ * fd File/socket descriptor of device
+ * req The ioctl command
+ * arg The argument of the ioctl cmd
+ *
+ * Return:
+ * >=0 on success (positive non-zero values are cmd-specific)
+ * -1 on failure withi errno set properly:
+ *
+ * EBADF
+ * 'fd' is not a valid descriptor.
+ * EFAULT
+ * 'arg' references an inaccessible memory area.
+ * EINVAL
+ * 'cmd' or 'arg' is not valid.
+ * ENOTTY
+ * 'fd' is not associated with a character special device.
+ * ENOTTY
+ * The specified request does not apply to the kind of object that the
+ * descriptor 'fd' references.
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_LIBC_IOCTL_VARIADIC
+int fs_ioctl(int fd, int req, unsigned long arg);
+#endif
+
/* fs_fdopen.c **************************************************************/
/****************************************************************************
* Name: fs_fdopen