I would like to override strcpy and to supply my own implementation, in my strcpy I want to do something and call to the original strcpy. How can I do that?
I'm working on linux, compiling with gcc, so I read about built in functions provided by gcc, I'm not sure if that's the way to do what I need, but I tried to use the flag -fno-builtin-strcpy, and in my strcpy call to __builtin_strcpy, but somehow it doesn't work as expected and cause some problemes:
char *strcpy(char *dest, const char *src)
{
if(......)
{
----do something---
}
return __builtin_strcpy(dest,src);
}