mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-11-09 08:37:58 +08:00
Filesystem: Add kernel event filter handler
This handler is necessary to implement the KQUEUE(2) system calls. Add <sys/event.h> from FreeBSD 8.4.
This commit is contained in:
1 parent
1682946057
commit
8cb28826ff
6 files changed
+354
No files matched your search
@@ -50,6 +50,7 @@ include_HEADERS += libmd/md4.h
|
||||
include_HEADERS += libmd/md5.h
|
||||
|
||||
include_sys_HEADERS += libcsupport/include/sys/ioccom.h
|
||||
include_sys_HEADERS += libcsupport/include/sys/event.h
|
||||
include_sys_HEADERS += libcsupport/include/sys/filio.h
|
||||
include_sys_HEADERS += libcsupport/include/sys/ioctl.h
|
||||
include_sys_HEADERS += libcsupport/include/sys/poll.h
|
||||
|
||||
@@ -41,6 +41,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct knote;
|
||||
|
||||
/**
|
||||
* @defgroup LibIOFSOps File System Operations
|
||||
*
|
||||
@@ -957,6 +959,22 @@ typedef int (*rtems_filesystem_poll_t)(
|
||||
int events
|
||||
);
|
||||
|
||||
/**
|
||||
* @brief Kernel event filter support.
|
||||
*
|
||||
* @param[in, out] iop The IO pointer.
|
||||
* @param[in] kn The kernel event note.
|
||||
*
|
||||
* @retval 0 Successful operation.
|
||||
* @retval error An error occurred. This is usually EINVAL.
|
||||
*
|
||||
* @see rtems_filesystem_default_kqfilter().
|
||||
*/
|
||||
typedef int (*rtems_filesystem_kqfilter_t)(
|
||||
rtems_libio_t *iop,
|
||||
struct knote *kn
|
||||
);
|
||||
|
||||
/**
|
||||
* @brief File system node operations table.
|
||||
*/
|
||||
@@ -973,6 +991,7 @@ struct _rtems_filesystem_file_handlers_r {
|
||||
rtems_filesystem_fdatasync_t fdatasync_h;
|
||||
rtems_filesystem_fcntl_t fcntl_h;
|
||||
rtems_filesystem_poll_t poll_h;
|
||||
rtems_filesystem_kqfilter_t kqfilter_h;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -1158,6 +1177,18 @@ int rtems_filesystem_default_poll(
|
||||
int events
|
||||
);
|
||||
|
||||
/**
|
||||
* @brief Default kernel event filter handler.
|
||||
*
|
||||
* @retval EINVAL Always.
|
||||
*
|
||||
* @see rtems_filesystem_kqfilter_t.
|
||||
*/
|
||||
int rtems_filesystem_default_kqfilter(
|
||||
rtems_libio_t *iop,
|
||||
struct knote *kn
|
||||
);
|
||||
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -33,6 +33,7 @@ libdefaultfs_a_SOURCES = \
|
||||
src/defaults/default_node_type.c \
|
||||
src/defaults/default_ftruncate_directory.c \
|
||||
src/defaults/default_handlers.c src/defaults/default_ops.c
|
||||
libdefaultfs_a_SOURCES += src/defaults/default_kqfilter.c
|
||||
libdefaultfs_a_SOURCES += src/defaults/default_poll.c
|
||||
|
||||
noinst_LIBRARIES += libimfs.a
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @brief Default Kernel Event Filter Handler
|
||||
*
|
||||
* @ingroup LibIOFSHandler
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2013 embedded brains GmbH. All rights reserved.
|
||||
*
|
||||
* embedded brains GmbH
|
||||
* Dornierstr. 4
|
||||
* 82178 Puchheim
|
||||
* Germany
|
||||
* <rtems@embedded-brains.de>
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*/
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <rtems/libio_.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/event.h>
|
||||
|
||||
int rtems_filesystem_default_kqfilter(
|
||||
rtems_libio_t *iop,
|
||||
struct knote *kn
|
||||
)
|
||||
{
|
||||
return EINVAL;
|
||||
}
|
||||
@@ -68,6 +68,10 @@ $(PROJECT_INCLUDE)/sys/ioccom.h: libcsupport/include/sys/ioccom.h $(PROJECT_INCL
|
||||
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/sys/ioccom.h
|
||||
PREINSTALL_FILES += $(PROJECT_INCLUDE)/sys/ioccom.h
|
||||
|
||||
$(PROJECT_INCLUDE)/sys/event.h: libcsupport/include/sys/event.h $(PROJECT_INCLUDE)/sys/$(dirstamp)
|
||||
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/sys/event.h
|
||||
PREINSTALL_FILES += $(PROJECT_INCLUDE)/sys/event.h
|
||||
|
||||
$(PROJECT_INCLUDE)/sys/filio.h: libcsupport/include/sys/filio.h $(PROJECT_INCLUDE)/sys/$(dirstamp)
|
||||
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/sys/filio.h
|
||||
PREINSTALL_FILES += $(PROJECT_INCLUDE)/sys/filio.h
|
||||
|
||||
Reference in new issue
Block a user