mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-10-18 11:07:05 +08:00
Use listen() from FreeBSD
This commit is contained in:
@@ -59,6 +59,8 @@ int bind(int, const struct sockaddr *, socklen_t);
|
||||
|
||||
int connect(int, const struct sockaddr *, socklen_t);
|
||||
|
||||
int listen(int, int);
|
||||
|
||||
int shutdown(int, int);
|
||||
|
||||
int socket(int, int, int);
|
||||
|
@@ -165,38 +165,6 @@ sockargs(mp, buf, buflen, type)
|
||||
*********************************************************************
|
||||
*/
|
||||
|
||||
int
|
||||
listen (int s, int backlog)
|
||||
{
|
||||
struct thread *td;
|
||||
struct socket *so;
|
||||
int error = 0;
|
||||
|
||||
if ((so = rtems_bsdnet_fdToSocket (s)) == NULL) {
|
||||
error = EBADF;
|
||||
}
|
||||
if( error == 0 )
|
||||
{
|
||||
td = curthread;
|
||||
#ifdef MAC
|
||||
error = mac_socket_check_listen(td->td_ucred, so);
|
||||
if (error == 0) {
|
||||
#endif
|
||||
CURVNET_SET(so->so_vnet);
|
||||
error = solisten(so, backlog, td);
|
||||
CURVNET_RESTORE();
|
||||
#ifdef MAC
|
||||
}
|
||||
#endif
|
||||
}
|
||||
if( error == 0 )
|
||||
{
|
||||
return error;
|
||||
}
|
||||
errno = error;
|
||||
return -1;
|
||||
}
|
||||
|
||||
int
|
||||
kern_accept(struct thread *td, int s, struct sockaddr **name, socklen_t *namelen)
|
||||
{
|
||||
|
Reference in New Issue
Block a user