mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 14:53:47 +08:00
fs/vfs/fs_poll.c: Add poll use in kernel space.
This commit is contained in:
+20
-6
@@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* include/poll.h
|
||||
*
|
||||
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2008-2009, 2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -88,6 +88,11 @@
|
||||
#define POLLHUP (0x08)
|
||||
#define POLLNVAL (0x10)
|
||||
|
||||
#define POLLFD (0x00)
|
||||
#define POLLFILE (0x40)
|
||||
#define POLLSOCK (0x80)
|
||||
#define POLLMASK (0xC0)
|
||||
|
||||
/****************************************************************************
|
||||
* Public Type Definitions
|
||||
****************************************************************************/
|
||||
@@ -107,11 +112,20 @@ typedef uint8_t pollevent_t;
|
||||
|
||||
struct pollfd
|
||||
{
|
||||
int fd; /* The descriptor being polled */
|
||||
sem_t *sem; /* Pointer to semaphore used to post output event */
|
||||
pollevent_t events; /* The input event flags */
|
||||
pollevent_t revents; /* The output event flags */
|
||||
FAR void *priv; /* For use by drivers */
|
||||
/* REVISIT: Un-named unions are forbidden by the coding standard because
|
||||
* they are not available in C89.
|
||||
*/
|
||||
|
||||
union
|
||||
{
|
||||
int fd; /* The descriptor being polled */
|
||||
FAR void *ptr; /* The psock or file being polled */
|
||||
};
|
||||
|
||||
FAR sem_t *sem; /* Pointer to semaphore used to post output event */
|
||||
pollevent_t events; /* The input event flags */
|
||||
pollevent_t revents; /* The output event flags */
|
||||
FAR void *priv; /* For use by drivers */
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
Reference in New Issue
Block a user