summaryrefslogtreecommitdiff
path: root/nuttx/arch/sim
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-11-17 23:22:27 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-11-17 23:22:27 +0000
commit09f70284f5e1d190519661166422909e69b2331b (patch)
treeb968095164f6f6417386d02feda27ea7e7d434ca /nuttx/arch/sim
parent5c3162da749c8c8c1609c1ab1c85ab1961dbabde (diff)
downloadpx4-nuttx-09f70284f5e1d190519661166422909e69b2331b.tar.gz
px4-nuttx-09f70284f5e1d190519661166422909e69b2331b.tar.bz2
px4-nuttx-09f70284f5e1d190519661166422909e69b2331b.zip
Add poll method to serial drivers
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1268 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/sim')
-rw-r--r--nuttx/arch/sim/src/up_devconsole.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/nuttx/arch/sim/src/up_devconsole.c b/nuttx/arch/sim/src/up_devconsole.c
index 6bf733f71..58fa21e3b 100644
--- a/nuttx/arch/sim/src/up_devconsole.c
+++ b/nuttx/arch/sim/src/up_devconsole.c
@@ -53,6 +53,9 @@
static ssize_t devconsole_read(struct file *, char *, size_t);
static ssize_t devconsole_write(struct file *, const char *, size_t);
+#ifndef CONFIG_DISABLE_POLL
+static int devconsole_poll(FAR struct file *filep, FAR struct pollfd *fds);
+#endif
/****************************************************************************
* Private Data
@@ -62,14 +65,16 @@ static struct file_operations devconsole_fops =
{
.read = devconsole_read,
.write = devconsole_write,
+#ifndef CONFIG_DISABLE_POLL
+ .poll = devconsole_poll,
+#endif
};
/****************************************************************************
* Private Functions
****************************************************************************/
-
- static ssize_t devconsole_read(struct file *filp, char *buffer, size_t len)
+static ssize_t devconsole_read(struct file *filp, char *buffer, size_t len)
{
return up_hostread(buffer, len);
}
@@ -79,6 +84,11 @@ static ssize_t devconsole_write(struct file *filp, const char *buffer, size_t le
return up_hostwrite(buffer, len);
}
+static int devconsole_poll(FAR struct file *filep, FAR struct pollfd *fds)
+{
+ return OK;
+}
+
/****************************************************************************
* Public Functions
****************************************************************************/