stdlib.h alternative in Linux kernel?

前端 未结 2 432
灰色年华
灰色年华 2020-12-17 20:36

When developing a kernel module in Linux, using the C standard library isn\'t allowed.
However, in case I need to use some common functionality like strcat()

2条回答
  •  难免孤独
    2020-12-17 21:09

    Sorry @eq - thinking of another function.

    Why not

    void (char *d, const char *s);
    {
       if (*d)
       { 
           for (; *d; ++d) {} ;
          --d;
       }
       strcpy(d, s);
    }
    

    I could do strcpy if you wish

提交回复
热议问题