QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 2228|回复: 1

Where is the *.c

[复制链接]
发表于 2006-10-9 18:12:30 | 显示全部楼层 |阅读模式
When programming,need lots of .h ,but where is the *.c file associated to the .h.
I find "extern" in many file.
eg.debian:/usr/include# cat stdio.h |grep extern
extern int rename (__const char *__old, __const char *__new) __THROW;

where can i get the implement of rename?
(implement in some .so?)
发表于 2006-10-17 11:52:27 | 显示全部楼层
you should check the glibc library.

the following is from it:

[code:1]
/* Rename the file OLD to NEW.  */
int
rename (old, new)
     const char *old;
     const char *new;
{
  int save = errno;
  if (__link (old, new) < 0)
    {
      if (errno == EEXIST)
        {
          __set_errno (save);
          /* Race condition, required for 1003.1 conformance.  */
          if (__unlink (new) < 0 ||
              __link (old, new) < 0)
            return -1;
        }
      else
        return -1;
    }
  if (__unlink (old) < 0)
    {
      save = errno;
      if (__unlink (new) == 0)
        __set_errno (save);
      return -1;
    }
  return 0;
}[/code:1][/code]
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-4-20 05:19 , Processed in 0.068593 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表