Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

`readlink` of `/proc/self/fd/N` is `ENOENT` for a pipe, a socket or an eventfd

Abierto
#431 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
50/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
c, macos

Línea de trabajo

Start at intercept_readlink_dispatch in src/runtime/procemu.c, which answers /proc/self/fd/N from fcntl(F_GETPATH), and check why that call fails for pipes, sockets and eventfds. Build the reproducer from the issue and compare its output with the Linux 6.12 column. Done when all three descriptors return a kind name in the pipe:[N], socket:[N] or anon_inode:[eventfd] form instead of ENOENT.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug

intercept_readlink_dispatch (src/runtime/procemu.c) answers /proc/self/fd/N with the host path of the host fd, from fcntl(F_GETPATH). A descriptor with no path fails that call (EBADF on macOS 27.0.1 for a pipe), and the guest gets ENOENT. Linux names such a descriptor by its kind.

Reproducer:

#include <errno.h>
#include <stdio.h>
#include <sys/eventfd.h>
#include <sys/socket.h>
#include <unistd.h>

static void show(const char *what, int fd)
{
    char link[64], target[64];
    snprintf(link, sizeof(link), "/proc/self/fd/%d", fd);
    errno = 0;
    long n = readlink(link, target, sizeof(target) - 1);
    target[n < 0 ? 0 : n] = '\0';
    printf("%-8s %ld errno=%d %s\n", what, n, errno, target);
}

int main(void)
{
    int p[2], sv[2];
    pipe(p);
    socketpair(AF_UNIX, SOCK_STREAM, 0, sv);
    show("pipe", p[0]);
    show("socket", sv[0]);
    show("eventfd", eventfd(0, 0));
    return 0;
}
pipe socket eventfd
elfuse b57f367 -1, ENOENT -1, ENOENT -1, ENOENT
Linux 6.12 under qemu pipe:[181] socket:[182] anon_inode:[eventfd]
Lenguaje dominante
C
Estrellas
273
Forks
29
Merge medio
2 d 17 h
PR fusionados (30 d)
17

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de sysprog21/elfuse

Todos los issues de sysprog21/elfuse

Issues similares

Más issues de C

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.