Linux套接字实现在哪里? [英] Where is the Linux socket implementation?

查看:44
本文介绍了Linux套接字实现在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在C程序中,为了使用套接字,我们需要包括:

In C programs, in order to use sockets, we need to include:

#include<sys/socket.h>

我已经搜索了 socket.c 文件(< sys/socket.h> 的实现),但是没有找到它( find-iname"socket.c *" )

I have searched for the socket.c file (the implementation of <sys/socket.h>) but didn't found it (find -iname "socket.c*")

  1. 在哪里可以找到Linux套接字实现?
  2. 我可以修改此文件并更改此实现吗?

推荐答案

头文件包含与套接字相关的系统调用的声明.要开始深入研究实现,请考虑参考net/socket.c 文件.c"rel =" noreferrer> Linux源代码树.

The header file contains declarations for socket-related system calls. To start diving into the implementation, please consider referring to net/socket.c file in the Linux source tree.

关于更改实施方式-Linux是根据

Regarding changing the implementation - Linux is an open-source software product distributed under the terms of GNU GPL. If you'll spend quite some time to understand how to re-build the kernel from scratch, you'll be able to apply any changes you want to the kernel and deploy it to your local machines (at your own risk of course).

这篇关于Linux套接字实现在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆