apue2中的一个函数声明的疑问:关于extern int *_ _errno_location(void)

软件和网站开发以及相关技术探讨
回复
czg0002
帖子: 26
注册时间: 2006-08-02 9:47

apue2中的一个函数声明的疑问:关于extern int *_ _errno_location(void)

#1

帖子 czg0002 » 2008-10-11 13:38

最近开始看stevens的apue2, 看到section 1.7 error handling, 其中有一段
Linux, for example, supports multithreaded access to errno by defining it as

extern int *_ _errno_location(void);
#define errno (*_ _errno_location())

请问这个函数声明extern int *_ _errno_location(void) 中的int *_表示返回什么类型呢?
是不是返回指向整形的指针呢?为什么不是int *呢?

谢谢大虾指点
xyywll
帖子: 338
注册时间: 2008-05-24 1:24

Re: apue2中的一个函数声明的疑问:关于extern int *_ _errno_location(void)

#2

帖子 xyywll » 2008-10-12 11:56

个人觉得 * 和 _ 之间有个空格的话,应该就好理解了,这里是省略空格的写法
回忆下c的标识符规则和指针的写法
回复