Given the wrapper function for system call write :
ssize_t my_write(int fd, const void *buf, size_t count)
{
    long __res;
    __asm__ volatile
        ("int $0x80"
                : "=a" (__res)
                : "0" (4),"D" ((long)(fd)),"S" ((long)(buf)), "d" ((long)(count))
                : "ebx","memory");
      if (-125 <= __res && __res < 0)
      {
        errno = -__res;
        __res   = -1;
      }
      return __res;
}
I've tried it with the code (from int main()) :
int main() {
     my_write(2,"an read error occured\n",26);
     return 0;
 }
However it doesn't work . Any idea why ?
Thanks
 
    