What is the significance of caddr_t and when is it used?

后端 未结 2 1752
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-01 13:33

Can somebody please tell me:

  1. What is caddr_t ?
  2. When is it used ?
  3. How it is different from void* ?
  4. When to
相关标签:
2条回答
  • 2021-01-01 14:10

    caddr_t was used as a pointer to a core address. I used it in SVR4 when I needed to access kernel structures from user space (having used mmap to access /dev/kmem). Even when "/proc" existed, the ps command still used mmap of the kernel to start walking the process table. As everybody states it was superseded by void *.

    0 讨论(0)
  • 2021-01-01 14:15

    caddr_t is a legacy BSD type associated with some low level calls like mmap, and it should never be used in modern code. It was rejected by the POSIX standard. The standardized mmap uses void *.

    0 讨论(0)
提交回复
热议问题