Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

233
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda