VFS FIFO: Enlarge FIFO buffer sizes
* Increase FIFO buffer capacity from 32 to 64 KiB and the FIFO atomic
write size ({BUF_SIZE}) from 512 bytes to 4 KiB (both like Linux).
* Fix *pathconf(..., _PC_PIPE_BUF). It was returning 4 KiB although the
implemented atomic write size was 512 bytes only. Now both *pathconf()
and the FIFO implementation refer to the same constant.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
/*
|
||||
* Copyright 2002-2008, Axel Dörfler, [email protected]. All rights reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
* Copyright 2002-2008, Axel Dörfler, [email protected].
|
||||
* Copyright 2013, Ingo Weinhold, [email protected]e.
|
||||
* All rights reserved. Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
|
||||
* Distributed under the terms of the NewOS License.
|
||||
@@ -8,6 +9,8 @@
|
||||
#ifndef _SYSTEM_VFS_DEFS_H
|
||||
#define _SYSTEM_VFS_DEFS_H
|
||||
|
||||
|
||||
#include <limits.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <SupportDefs.h>
|
||||
@@ -20,4 +23,18 @@ struct fd_info {
|
||||
ino_t node;
|
||||
};
|
||||
|
||||
|
||||
/* maximum write size to a pipe/FIFO that is guaranteed not to be interleaved
|
||||
with other writes (aka {PIPE_BUF}; must be >= _POSIX_PIPE_BUF) */
|
||||
#define VFS_FIFO_ATOMIC_WRITE_SIZE (4 * 1024)
|
||||
|
||||
/* pipe/FIFO buffer capacity */
|
||||
#define VFS_FIFO_BUFFER_CAPACITY (64 * 1024)
|
||||
|
||||
// make sure the constant values are sane
|
||||
#if VFS_FIFO_ATOMIC_WRITE_SIZE < _POSIX_PIPE_BUF
|
||||
# error VFS_FIFO_ATOMIC_WRITE_SIZE < _POSIX_PIPE_BUF!
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* _SYSTEM_VFS_DEFS_H */
|
||||
|
||||
Reference in New Issue
Block a user