From: Andrei Tatar Date: Wed, 25 Sep 2024 15:35:41 +0000 (+0200) Subject: lib/posix-pipe: Give name to opened pipes X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=32b021ee2c727ad22aaee00b004cea48ac1ba4ac;p=unikraft%2Funikraft.git lib/posix-pipe: Give name to opened pipes This change names newly opened pipes "pipe:read" or "pipe:write", depending on which end it is. Signed-off-by: Andrei Tatar Approved-by: Sergiu Moga Reviewed-by: Sergiu Moga GitHub-Closes: #1592 --- diff --git a/lib/posix-pipe/pipe.c b/lib/posix-pipe/pipe.c index dc8006600..3ee53cf2a 100644 --- a/lib/posix-pipe/pipe.c +++ b/lib/posix-pipe/pipe.c @@ -38,6 +38,12 @@ static const char PIPE_VOLID[] = "pipe_vol"; +#define PIPE_R_FNAME "pipe:read" +#define PIPE_R_FNAME_LEN (sizeof(PIPE_R_FNAME) - 1) + +#define PIPE_W_FNAME "pipe:write" +#define PIPE_W_FNAME_LEN (sizeof(PIPE_W_FNAME) - 1) + typedef __u32 pipeidx; struct pipe_msg { @@ -428,13 +434,15 @@ int uk_sys_pipe(int pipefd[2], int flags) return r; oflags = (flags & _OPEN_FLAGS) | UKFD_O_NOSEEK; - r = uk_fdtab_open(pipes[0], O_RDONLY|oflags); + r = uk_fdtab_open_named(pipes[0], O_RDONLY | oflags, + PIPE_R_FNAME, PIPE_R_FNAME_LEN); if (unlikely(r < 0)) goto err_free; rpipe = r; - r = uk_fdtab_open(pipes[1], O_WRONLY|oflags); + r = uk_fdtab_open_named(pipes[1], O_WRONLY | oflags, + PIPE_W_FNAME, PIPE_W_FNAME_LEN); if (unlikely(r < 0)) goto err_close;