{"id":25244917,"url":"https://github.com/getiot/linux-c-functions","last_synced_at":"2025-10-26T21:30:29.542Z","repository":{"id":110791682,"uuid":"376741794","full_name":"getiot/linux-c-functions","owner":"getiot","description":"Linux 常用 C 函数参考手册（中文）","archived":false,"fork":false,"pushed_at":"2025-02-10T17:39:25.000Z","size":3180,"stargazers_count":34,"open_issues_count":0,"forks_count":8,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-10T18:21:38.969Z","etag":null,"topics":["c-language","documentation","tutorial","tutorial-code"],"latest_commit_sha":null,"homepage":"https://getiot.tech/manual/linux-c-functions/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc-by-sa-4.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/getiot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-14T07:37:08.000Z","updated_at":"2025-02-10T17:34:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"221b93d6-0cd1-4398-9e7b-90c83b8b25b4","html_url":"https://github.com/getiot/linux-c-functions","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getiot%2Flinux-c-functions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getiot%2Flinux-c-functions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getiot%2Flinux-c-functions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getiot%2Flinux-c-functions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/getiot","download_url":"https://codeload.github.com/getiot/linux-c-functions/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238399606,"owners_count":19465484,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c-language","documentation","tutorial","tutorial-code"],"created_at":"2025-02-12T01:55:44.806Z","updated_at":"2025-10-26T21:30:29.537Z","avatar_url":"https://github.com/getiot.png","language":"Python","readme":"# linux-c-functions\n\n这是一份开源的《Linux 常用 C 函数参考手册》中文版，文档托管在 [GetIoT.tech](https://getiot.tech) 网站，你可以点击 [这里](https://getiot.tech/manual/linux-c-functions/) 在线阅读。如果你在阅读过程中发现错误或者遗漏，欢迎给本仓库提交 issue 和 PR！示例代码均可在 [linux-c](https://github.com/getiot/linux-c) 仓库找到。\n\n![](images/linux-c-functions-screeshot-v2-01.jpg)\n\n## 目录\n\n- [字符测试篇](source/char.md)\n- [字符串转换篇](source/string-convert.md)\n- [内存控制篇](source/memory.md)\n- [日期时间篇](source/time.md)\n- [内存及字符串操作篇](source/memory-string.md)\n- [常用数学函数篇](source/math.md)\n- [用户组篇](source/user-group.md)\n- [数据结构及算法篇](source/data-structure.md)\n- [文件操作篇](source/file.md)\n- [文件内容操作篇](source/file-content.md)\n- [进程操作篇](source/process.md)\n- [进程间通信篇](source/process.md)\n- [线程管理篇](source/pthreads.md)\n- [文件权限控制篇](source/permission.md)\n- [信号处理篇](source/signal.md)\n- [网络接口篇](source/network.md)\n- [I/O 复用篇](source/io-multiplexing.md)\n- [环境变量篇](source/env.md)\n- [终端控制篇](source/tty.md)\n\n## 函数\n\n新增函数\n\n- malloc_usable_size\n\n\n## 模板\n\n简介\n\n**头文件**\n\n```c\n#include \u003cstdio.h\u003e\n```\n\n**函数原型**\n\n```c\nint printf(const char *format, ...);\n```\n\n- 功能：\n- 返回值：\n- 附加说明：\n- 相关函数：\n\n**示例**\n\n```c\nint main(void)\n{\n    printf(\"Hello, World!\\n\");\n    return 0;\n}\n```\n\n执行\n\n```bash\nHello, World!\n```\n\n## 如何参与\n\nlinux-c-functions 文档系统的目录结构很简单，所有文档均放置在 source 目录中，source 目录的大致结构和简要说明如下。\n\n```bash\nsource\n├── conf.py      # 文档配置文件\n├── index.rst    # 文档首页（包含目录信息）\n├── about.rst    # 关于页面\n├── **.md        # 函数分类页面\n├── _static      # 静态资源目录\n└── _templates   # 模板资源目录\n```\n\nsource 目录下包含多个 .md 文档，每个文档是一个大类的 C 函数。\n\n```bash\nchar.md            file.md             memory.md         process.md         time.md\ndata-structure.md  io-multiplexing.md  memory-string.md  pthreads.md        tty.md\nenv.md             ipcs.md             network.md        signal.md          user-group.md\nfile-content.md    math.md             permission.md     string-convert.md\n```\n\n你可以找到其中的某个函数进行修改，对于不存在的函数，你可以新增。如果找不到想要的分类，可以在提 issue 讨论。\n\n## 如何构建\n\nSphinx 文档系统支持本地构建、部署，这里以 Ubuntu 为例（其他 Linux 发行版、MacOS 或 Windows 也行），介绍如何构建出可在本地访问的 linux-c-functions 在线文档。\n\n首先需要安装 Python3、Git、Make 等基础软件。\n\n```bash\nsudo apt install git\nsudo apt install make\nsudo apt install python3\nsudo apt install python3-pip \n```\n\n然后安装最新版本的 Sphinx 及依赖。\n\n```bash\npip3 install -U Sphinx\n```\n\n为了完成本示例，还需要安装以下软件包。\n\n```bash\npip3 install sphinx-autobuild\npip3 install sphinx_rtd_theme\npip3 install recommonmark\npip3 install sphinx_markdown_tables\n```\n\n安装完成后，系统会增加一些 `sphinx-` 开头的命令。\n\n```bash\nsphinx-apidoc    sphinx-autobuild    sphinx-autogen    sphinx-build    sphinx-quickstart\n```\n\n在工程目录下执行下面命令，生成 HTML 网页并启动本地测试 Web Server，默认端口为 8000。（推荐开发环境使用）\n\n```bash\nsphinx-autobuild source build/html\n```\n\n或者直接执行 `make html` 构建。\n\n现在，在浏览器输入 `127.0.0.1:8000` 即可访问。\n\n发布版本推荐使用如下命令构建：\n\n```bash\nsphinx-build -b html source build/html\n```\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetiot%2Flinux-c-functions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgetiot%2Flinux-c-functions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetiot%2Flinux-c-functions/lists"}