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

Don't rely on path_max

Abierto
#2,091 2 comentarios 1 reacción 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
45/100
Tipo de issue
Refactorización
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
c, linux

Línea de trabajo

Comienza localizando cada uso de PATH_MAX relacionado con realpath(3) y readlink(2); después, inspecciona los alias static inline de realpath para Windows y FF_EXE_PATH_LEN de terminalshell_linux. Compara el comportamiento de asignación en Hurd y Linux, y considera si unos helpers compartidos pueden reemplazar las condicionales dispersas; se considera terminado cuando el hack de PATH_MAX de Hurd ya no sea necesario sin romper estas rutas específicas de cada plataforma.

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

Descripción

Hi,

Following up to my comment in https://github.com/fastfetch-cli/fastfetch/issues/1895#issuecomment-3206602801 on PATH_MAX.

I would like to get rid of the -DPATH_MAX=4096 hack for hurd.

I had a look where PATH_MAX is used and it is used only for realpath(3) and readlink(2) to allocate a buffer that will be "big enough".

For realpath glibc will allocate a buffer for us with the result when the output is NULL. (this case is not specified by posix). I don't think this is something that other libcs implement though.

The man page for readlink also suggests to not rely on PATH_MAX and suggests to use stat.st_size from lstat and malloc a buffer manually.

The problem with this approach is that while lstat on /proc returns sensible values on hurd e.g. on linux the size is 0 so the PATH_MAX approach is still needed.

Also there are currently at least 2 static inline realpath aliases for windows.

terminalshell_linux has a FF_EXE_PATH_LEN instead.

Before I start to make this work would it make sense to consolidate this into new helpers to not litter #ifdef PATH_MAX everywhere?

Lenguaje dominante
C
Estrellas
24.9k
Forks
911
Merge medio
17 h 28 min
PR fusionados (30 d)
20

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 fastfetch-cli/fastfetch

Todos los issues de fastfetch-cli/fastfetch

Issues similares

Más issues de C

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.