From 0e00d2ad490dad44aa52fb08a19ceb89867046da Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 17 Nov 2008 23:22:27 +0000 Subject: [PATCH] Add poll method to serial drivers git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1268 42af7a65-404d-4744-a932-0658087f49c3 --- arch/sim/src/up_devconsole.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/arch/sim/src/up_devconsole.c b/arch/sim/src/up_devconsole.c index 6bf733f718..58fa21e3b2 100644 --- a/arch/sim/src/up_devconsole.c +++ b/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 ****************************************************************************/