Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

236
Vistas
How can I find the corresponding .h file which includes the "cacheflush" function?

I tried to use the cacheflush function in my Linux X86 computer. However, while the man pages states that the function can be found in the ".h" files <sys/cachectl.h> <asm/cachectl.h> or <asm-generic/cachectl.h>, my GCC compiler cannot found these files.

What can I do? i.e., how can I include the function in my program so that GCC will recognize it?

over 4 years ago · Santiago Trujillo
3 Respuestas
Responde la pregunta

0

I'm not sure, but read man cacheflush, I think you can't.

Note: On some architectures, there is no glibc wrapper for this system call; see NOTES.

Architecture-specific variants Glibc provides a wrapper for this system call, with the prototype shown in SYNOPSIS, for the following architectures: ARC, CSKY, MIPS, and NIOS2.

On some other architectures, Linux provides this system call, with different arguments:

M68K:

  int cacheflush(unsigned long addr, int scope, int cache,
                 unsigned long len);

SH:

  int cacheflush(unsigned long addr, unsigned long len, int op);

NDS32:

  int cacheflush(unsigned int start, unsigned int end, int cache);

On the above architectures, glibc does not provide a wrapper for this system call; call it using syscall(2).

If I understand well, glic does only provide cacheflush for 4 architectures.


If you really want to call this function, gcc specifically provide __builtin___clear_cache() (look for it in man page), but again, that won't be portable to other compilers.

over 4 years ago · Santiago Trujillo Denunciar

0

You can simply search for cacheflush functions in headers file with a grep : grep -rin cacheflush /usr/include

Depending on your compiler, headers files can be located in /opt/path/to/your/compiler, check include path given to your linker.

over 4 years ago · Santiago Trujillo Denunciar

0

While it is not what I asked for- in Intel x86 one can flush invalidated pages using intrinsic intel commands, i.e., _mm_clflushopt and _mm_clflush.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda