`tee` returns `EINVAL` for every pair of pipes
Los mantenedores suelen responder en 3 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 40/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- c, linux, macos
- Área
- operating-systems
Línea de trabajo
Start in sys_tee in src/syscall/io.c, where the early EINVAL return and its comment explain why copying without consuming is refused on macOS. The reproducer in the issue shows the target behaviour: tee should return the byte count, leave the source pipe readable, and copy into the destination. Done means that reproducer prints tee=5 errno=0 with both reads returning 5 bytes. Expect to find a workable approach to peeking a pipe on macOS first, which is the hard part.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
sys_tee (src/syscall/io.c) returns EINVAL without looking at its arguments. Its comment gives the reason: copying without consuming needs a way to look into a pipe, and macOS offers none.
Reproducer:
#define _GNU_SOURCE
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
int main(void)
{
int in[2], out[2];
char buf[8];
pipe(in);
pipe(out);
write(in[1], "hello", 5);
errno = 0;
long n = tee(in[0], out[1], 100, SPLICE_F_NONBLOCK);
printf("tee=%ld errno=%d\n", n, errno);
if (n > 0)
printf("copied=%zd still in the source=%zd\n",
read(out[0], buf, sizeof(buf)), read(in[0], buf, sizeof(buf)));
return 0;
}
| result | |
|---|---|
elfuse b57f367 |
tee=-1 errno=22 |
| Linux 6.12 under qemu | tee=5 errno=0, then copied=5 still in the source=5 |
EINVAL is what tee(2) documents for descriptors that are not both pipes, so that is how a guest reads the refusal.
- Lenguaje dominante
- C
- Estrellas
- 273
- Forks
- 29
- Merge medio
- 2 d 10 h
- PR fusionados (30 d)
- 17
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de sysprog21/elfuse
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 3 días
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 3 días
-
Dificultad 4/5 3-5 días Aptitud para principiantes 30/100
Los mantenedores suelen responder en 3 días
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
Los mantenedores suelen responder en 3 días
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
Los mantenedores suelen responder en 3 días
Todos los issues de sysprog21/elfuse
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
Los mantenedores suelen responder en 8 días
-
native-cpu: -Wreturn-type in skainet_row_threads.c:150 (worker fn has no return)Posiblemente ocupada @Doomguy-BFG9000 la tomó hoy. Abiertogood first issue size:xs skill:native
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
SKaiNET-developers/SKaiNET#1358 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
I/O internal correctness medium priority rt_lib
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
libsdl-org/SDL#16539 ·
Los mantenedores suelen responder en 1 día
-
git-workflow task-4
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100