T
T
tu1602020-10-20 09:05:44
C++ / C#
tu160, 2020-10-20 09:05:44

Standard library sources?

Hello.

I understand that the question has been asked a million times, but I do not understand how to use the answers to it.
I'm trying to understand the connection of connect() with SIGALRM (does it exist at all?), for this I want to look at the source code of the function itself.

I go here
https://sourceware.org/git/?p=glibc.git;a=tree

And what I see in the connect.c file

int
__connect (int fd, __CONST_SOCKADDR_ARG addr, socklen_t len)
{
  __set_errno (ENOSYS);
  return -1;
}


What does it mean? Is this the whole function that establishes a connection with the server for us?

Tell me please. Give me the right path.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
J
jcmvbkbc, 2020-10-20
@tu160

What does it mean? Is this the whole function that establishes a connection with the server for us?

This is a stub, in case there is no other implementation of this function.
For linux, there is another implementation, it is in sysdeps/unix/sysv/linux/connect.c, but all it does is a system call wrapped in a pthread-cancellation manipulation.
You can look at the implementation of the system call in the kernel. You can start here , this is the connect system call dispatcher. The connect implementation for TCP/IPv4 is here .

T
Tynkute, 2020-11-13
@Tynkute

Sources of the standard library.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question