mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 19:28:12 +00:00
Net: Store an acceptor PID alongside the origin PID in a socket
* The origin PID is the PID of the process that created this socket, either explicitly by calling socket(), or implicitly by accepting a TCP connection. Note that accepting a local socket connection does not create a new socket, it reuses the one connect() was called on, so for accepted local sockets the origin PID points to the connecting process. * The acceptor PID is the PID of the process that accept()ed this socket. For accepted TCP sockets, this is the same as origin PID.
This commit is contained in:
parent
66e5d0bdf3
commit
1d03391488
2 changed files with 3 additions and 0 deletions
|
@ -80,6 +80,7 @@ public:
|
|||
KResult getsockopt(int level, int option, void*, socklen_t*);
|
||||
|
||||
pid_t origin_pid() const { return m_origin_pid; }
|
||||
pid_t acceptor_pid() const { return m_acceptor_pid; }
|
||||
|
||||
timeval receive_deadline() const { return m_receive_deadline; }
|
||||
timeval send_deadline() const { return m_send_deadline; }
|
||||
|
@ -111,6 +112,7 @@ private:
|
|||
|
||||
Lock m_lock { "Socket" };
|
||||
pid_t m_origin_pid { 0 };
|
||||
pid_t m_acceptor_pid { 0 };
|
||||
int m_domain { 0 };
|
||||
int m_type { 0 };
|
||||
int m_protocol { 0 };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue