Add poll method to serial drivers

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1268 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo 2008-11-17 23:22:27 +00:00
parent c39069a07d
commit 0e00d2ad49

View File

@ -53,6 +53,9 @@
static ssize_t devconsole_read(struct file *, char *, size_t); static ssize_t devconsole_read(struct file *, char *, size_t);
static ssize_t devconsole_write(struct file *, const 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 * Private Data
@ -62,14 +65,16 @@ static struct file_operations devconsole_fops =
{ {
.read = devconsole_read, .read = devconsole_read,
.write = devconsole_write, .write = devconsole_write,
#ifndef CONFIG_DISABLE_POLL
.poll = devconsole_poll,
#endif
}; };
/**************************************************************************** /****************************************************************************
* Private Functions * 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); 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); return up_hostwrite(buffer, len);
} }
static int devconsole_poll(FAR struct file *filep, FAR struct pollfd *fds)
{
return OK;
}
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/