libports: add _accept, _bind and _listen...

...and socketpair() dummy to libc.

Socketpair() is needed by OpenSSH. The actual implementation
should be done in libc_noux.

Fixes #297.
This commit is contained in:
Josef Söntgen 2012-07-12 13:32:09 +02:00 committed by Norman Feske
parent 84717b7bd4
commit d99edf57d8
2 changed files with 20 additions and 0 deletions

View File

@ -125,6 +125,7 @@ DUMMY(-1, _sigprocmask)
DUMMY(-1, sigprocmask)
DUMMY(-1, _sigsuspend)
DUMMY(-1, sigsuspend)
DUMMY(-1, socketpair)
DUMMY(-1, stat)
DUMMY(-1, statfs)
DUMMY(-1, symlink)

View File

@ -91,6 +91,12 @@ inline File_descriptor *libc_fd_to_fd(int libc_fd, const char *func_name)
** Libc functions **
********************/
extern "C" int _accept(int libc_fd, struct sockaddr *addr, socklen_t *addrlen)
{
return accept(libc_fd, addr, addrlen);
}
extern "C" int accept(int libc_fd, struct sockaddr *addr, socklen_t *addrlen)
{
File_descriptor *fd = libc_fd_to_fd(libc_fd, "accept");
@ -99,6 +105,13 @@ extern "C" int accept(int libc_fd, struct sockaddr *addr, socklen_t *addrlen)
}
extern "C" int _bind(int libc_fd, const struct sockaddr *addr,
socklen_t addrlen)
{
return bind(libc_fd, addr, addrlen);
}
extern "C" int bind(int libc_fd, const struct sockaddr *addr,
socklen_t addrlen) {
FD_FUNC_WRAPPER(bind, libc_fd, addr, addrlen); }
@ -256,6 +269,12 @@ extern "C" int _ioctl(int libc_fd, int request, char *argp) {
FD_FUNC_WRAPPER(ioctl, libc_fd, request, argp); }
extern "C" int _listen(int libc_fd, int backlog)
{
return listen(libc_fd, backlog);
}
extern "C" int listen(int libc_fd, int backlog) {
FD_FUNC_WRAPPER(listen, libc_fd, backlog); }