summaryrefslogtreecommitdiffstats
path: root/cpukit/libnetworking
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2013-12-16 13:44:13 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2013-12-20 10:31:53 +0100
commit2f68778f08471fb7f13a8634ebb48c6db13c0f69 (patch)
treeeae0deea88cc0d81052f8497a668dfaeecd6de40 /cpukit/libnetworking
parentlibcsupport: Add and use rtems_libio_iovec_eval() (diff)
downloadrtems-2f68778f08471fb7f13a8634ebb48c6db13c0f69.tar.bz2
Filesystem: Add readv/writev handlers
The readv() and writev() support was implemented in terms of multiple calls to the read and write handlers. This imposes a problem on device files which use an IO vector as single request entity. For example a low-level network device (e.g. BPF(4)) may use an IO vector to create one frame from multiple protocol layers each with its own IO vector entry.
Diffstat (limited to 'cpukit/libnetworking')
-rw-r--r--cpukit/libnetworking/lib/ftpfs.c8
-rw-r--r--cpukit/libnetworking/lib/tftpDriver.c4
-rw-r--r--cpukit/libnetworking/rtems/rtems_syscall.c24
3 files changed, 22 insertions, 14 deletions
diff --git a/cpukit/libnetworking/lib/ftpfs.c b/cpukit/libnetworking/lib/ftpfs.c
index 784ff48601..d622ff66f7 100644
--- a/cpukit/libnetworking/lib/ftpfs.c
+++ b/cpukit/libnetworking/lib/ftpfs.c
@@ -1412,7 +1412,9 @@ static const rtems_filesystem_file_handlers_r rtems_ftpfs_handlers = {
.ftruncate_h = rtems_ftpfs_ftruncate,
.fsync_h = rtems_filesystem_default_fsync_or_fdatasync,
.fdatasync_h = rtems_filesystem_default_fsync_or_fdatasync,
- .fcntl_h = rtems_filesystem_default_fcntl
+ .fcntl_h = rtems_filesystem_default_fcntl,
+ .readv_h = rtems_filesystem_default_readv,
+ .writev_h = rtems_filesystem_default_writev
};
static const rtems_filesystem_file_handlers_r rtems_ftpfs_root_handlers = {
@@ -1426,5 +1428,7 @@ static const rtems_filesystem_file_handlers_r rtems_ftpfs_root_handlers = {
.ftruncate_h = rtems_filesystem_default_ftruncate,
.fsync_h = rtems_filesystem_default_fsync_or_fdatasync,
.fdatasync_h = rtems_filesystem_default_fsync_or_fdatasync,
- .fcntl_h = rtems_filesystem_default_fcntl
+ .fcntl_h = rtems_filesystem_default_fcntl,
+ .readv_h = rtems_filesystem_default_readv,
+ .writev_h = rtems_filesystem_default_writev
};
diff --git a/cpukit/libnetworking/lib/tftpDriver.c b/cpukit/libnetworking/lib/tftpDriver.c
index d549436c46..c6461e0349 100644
--- a/cpukit/libnetworking/lib/tftpDriver.c
+++ b/cpukit/libnetworking/lib/tftpDriver.c
@@ -1051,5 +1051,7 @@ static const rtems_filesystem_file_handlers_r rtems_tftp_handlers = {
.ftruncate_h = rtems_tftp_ftruncate,
.fsync_h = rtems_filesystem_default_fsync_or_fdatasync,
.fdatasync_h = rtems_filesystem_default_fsync_or_fdatasync,
- .fcntl_h = rtems_filesystem_default_fcntl
+ .fcntl_h = rtems_filesystem_default_fcntl,
+ .readv_h = rtems_filesystem_default_readv,
+ .writev_h = rtems_filesystem_default_writev
};
diff --git a/cpukit/libnetworking/rtems/rtems_syscall.c b/cpukit/libnetworking/rtems/rtems_syscall.c
index 727eac6ad2..4aa7ad8f89 100644
--- a/cpukit/libnetworking/rtems/rtems_syscall.c
+++ b/cpukit/libnetworking/rtems/rtems_syscall.c
@@ -812,15 +812,17 @@ rtems_bsdnet_fstat (const rtems_filesystem_location_info_t *loc, struct stat *sp
}
static const rtems_filesystem_file_handlers_r socket_handlers = {
- rtems_filesystem_default_open, /* open */
- rtems_bsdnet_close, /* close */
- rtems_bsdnet_read, /* read */
- rtems_bsdnet_write, /* write */
- rtems_bsdnet_ioctl, /* ioctl */
- rtems_filesystem_default_lseek, /* lseek */
- rtems_bsdnet_fstat, /* fstat */
- rtems_filesystem_default_ftruncate, /* ftruncate */
- rtems_filesystem_default_fsync_or_fdatasync, /* fsync */
- rtems_filesystem_default_fsync_or_fdatasync, /* fdatasync */
- rtems_bsdnet_fcntl /* fcntl */
+ .open_h = rtems_filesystem_default_open,
+ .close_h = rtems_bsdnet_close,
+ .read_h = rtems_bsdnet_read,
+ .write_h = rtems_bsdnet_write,
+ .ioctl_h = rtems_bsdnet_ioctl,
+ .lseek_h = rtems_filesystem_default_lseek,
+ .fstat_h = rtems_bsdnet_fstat,
+ .ftruncate_h = rtems_filesystem_default_ftruncate,
+ .fstat_h = rtems_filesystem_default_fsync_or_fdatasync,
+ .fdatasync_h = rtems_filesystem_default_fsync_or_fdatasync,
+ .fcntl_h = rtems_bsdnet_fcntl,
+ .readv_h = rtems_filesystem_default_readv,
+ .writev_h = rtems_filesystem_default_writev
};