mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-10-15 14:15:21 +08:00
Use shutdown() from FreeBSD
This commit is contained in:
@@ -55,6 +55,8 @@ int pselect(int, fd_set *__restrict, fd_set *__restrict, fd_set *__restrict,
|
||||
|
||||
int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
|
||||
|
||||
int shutdown(int, int);
|
||||
|
||||
int socket(int, int, int);
|
||||
|
||||
__END_DECLS
|
||||
|
@@ -538,31 +538,6 @@ accept (int s, struct sockaddr *name, int *namelen)
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Shutdown routine
|
||||
*/
|
||||
|
||||
int
|
||||
shutdown (int s, int how)
|
||||
{
|
||||
struct socket *so;
|
||||
int error = 0;
|
||||
|
||||
if ((so = rtems_bsdnet_fdToSocket (s)) == NULL) {
|
||||
error = EBADF;
|
||||
}
|
||||
if( error == 0 )
|
||||
{
|
||||
error = soshutdown(so, how);
|
||||
}
|
||||
if( error == 0 )
|
||||
{
|
||||
return error;
|
||||
}
|
||||
errno = error;
|
||||
return -1;
|
||||
}
|
||||
|
||||
int
|
||||
kern_sendit(td, s, mp, flags, control, segflg)
|
||||
struct thread *td;
|
||||
|
Reference in New Issue
Block a user