pipe: Add DEV_PIPE_VFS_PATH to specify the pipe location

and put into /var/pipe by default like other pseudo device

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2022-02-06 01:10:30 +08:00 committed by Petro Karashchenko
parent 91c331f3fd
commit 01a234bfb1
2 changed files with 7 additions and 1 deletions

View File

@ -34,4 +34,10 @@ config DEV_FIFO_SIZE
Sets the default size of the FIFO ringbuffer in bytes. A value of
zero disables FIFO support.
config DEV_PIPE_VFS_PATH
string "Path to the pipe device"
default "/var/pipe"
---help---
The path to where pipe device will exist in the VFS namespace.
endif # PIPES

View File

@ -174,7 +174,7 @@ static int pipe_register(size_t bufsize, int flags,
/* Create a pathname to the pipe device */
snprintf(devname, namesize, "/dev/pipe%d", pipeno);
snprintf(devname, namesize, CONFIG_DEV_PIPE_VFS_PATH"/%d", pipeno);
/* Check if the pipe device has already been created */