The current `ioctl` implementation for pipes does not handle
the `FIONBIO` command, which leads to a negative error value being
returned. This commit introduces a simple case which sets the FNONBLOCK
flag when such a command is passed.
Signed-off-by: Eduard Vintilă <eduard.vintila47@gmail.com>
Reviewed-by: Tu Dinh Ngoc <dinhngoc.tu@irit.fr>
Reviewed-by: Eduard-Florin Mihailescu <mihailescu.eduard@gmail.com>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #874
*((int *) data) = pipe_buf_get_available(pipe_buf);
uk_mutex_unlock(&pipe_buf->rdlock);
return 0;
+ case FIONBIO:
+ /* sys_ioctl() already sets f_flags, no need to do anything */
+ return 0;
default:
return -EINVAL;
}