summaryrefslogtreecommitdiff
path: root/nuttx/include
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-11-16 18:48:29 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-11-16 18:48:29 +0000
commiteeb84bc3e196548c3c09bd049a648a19e2836f1d (patch)
treef4042ce95d07de6719bf84b76ae29be66bb53b55 /nuttx/include
parent74e863032ed58ce23f1a0a334f5314d5b1a445bf (diff)
downloadpx4-nuttx-eeb84bc3e196548c3c09bd049a648a19e2836f1d.tar.gz
px4-nuttx-eeb84bc3e196548c3c09bd049a648a19e2836f1d.tar.bz2
px4-nuttx-eeb84bc3e196548c3c09bd049a648a19e2836f1d.zip
Add infrastructure to support poll()
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1258 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/include')
-rw-r--r--nuttx/include/nuttx/fs.h3
-rw-r--r--nuttx/include/nuttx/net.h8
2 files changed, 11 insertions, 0 deletions
diff --git a/nuttx/include/nuttx/fs.h b/nuttx/include/nuttx/fs.h
index 946c60589..65e033208 100644
--- a/nuttx/include/nuttx/fs.h
+++ b/nuttx/include/nuttx/fs.h
@@ -57,6 +57,8 @@
*/
struct file;
+struct pollfd;
+
struct file_operations
{
/* The device driver open method differs from the mountpoint open method */
@@ -73,6 +75,7 @@ struct file_operations
ssize_t (*write)(FAR struct file *filp, FAR const char *buffer, size_t buflen);
off_t (*seek)(FAR struct file *filp, off_t offset, int whence);
int (*ioctl)(FAR struct file *filp, int cmd, unsigned long arg);
+ int (*poll)(FAR struct file *filp, struct pollfd *poll);
/* The two structures need not be common after this point */
};
diff --git a/nuttx/include/nuttx/net.h b/nuttx/include/nuttx/net.h
index d4d7ec754..5126e7b65 100644
--- a/nuttx/include/nuttx/net.h
+++ b/nuttx/include/nuttx/net.h
@@ -153,6 +153,14 @@ EXTERN int net_close(int sockfd);
struct ifreq; /* Forward reference -- see net/ioctls.h */
EXTERN int netdev_ioctl(int sockfd, int cmd, struct ifreq *req);
+/* net-poll.c ****************************************************************/
+/* The standard poll() operation redirects operations on socket descriptors
+ * to this function.
+ */
+
+struct pollfd; /* Forward reference -- see poll.h */
+EXTERN int net_poll(int sockfd, struct pollfd *fds);
+
/* netdev-register.c *********************************************************/
/* This function is called by network interface device drivers to inform the
* socket layer of their existence. This registration is necesary to support