forked from Imagelibrary/rtems
2008-07-02 Joel Sherrill <joel.sherrill@oarcorp.com>
* libnetworking/Makefile.am, libnetworking/libc/gethostnamadr.c, libnetworking/libc/getservbyname.c, libnetworking/libc/getservbyport.c: Add initial versions of getservbyport_r(), gethostbyaddr_r(), and getservbyport_r(). At this point they are just simple weappers for the version without the _r in the name.
This commit is contained in:
@@ -1,3 +1,12 @@
|
||||
2008-07-02 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||
|
||||
* libnetworking/Makefile.am, libnetworking/libc/gethostnamadr.c,
|
||||
libnetworking/libc/getservbyname.c,
|
||||
libnetworking/libc/getservbyport.c: Add initial versions of
|
||||
getservbyport_r(), gethostbyaddr_r(), and getservbyport_r(). At this
|
||||
point they are just simple weappers for the version without the _r in
|
||||
the name.
|
||||
|
||||
2008-07-01 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||
|
||||
* libmisc/monitor/mon-prmisc.c, rtems/include/rtems/rtems/attr.h:
|
||||
|
||||
@@ -149,7 +149,7 @@ include_dev_mii_HEADERS = dev/mii/mii.h
|
||||
|
||||
## libc
|
||||
|
||||
libc_CPPFLAGS = -DNOPOLL -DNOSELECT -D__BSD_VISIBLE
|
||||
libc_CPPFLAGS = -DNOPOLL -DNOSELECT -D__BSD_VISIBLE -D_THREAD_SAFE
|
||||
|
||||
noinst_LIBRARIES += libc.a
|
||||
libc_a_CPPFLAGS = $(AM_CPPFLAGS) $(libc_CPPFLAGS)
|
||||
|
||||
@@ -158,6 +158,18 @@ gethostbyname2(const char *name, int type)
|
||||
return hp;
|
||||
}
|
||||
|
||||
int gethostbyaddr_r(const void *addr, socklen_t len, int type,
|
||||
struct hostent *ret, char *buf, size_t buflen,
|
||||
struct hostent **result, int *h_errnop)
|
||||
{
|
||||
#warning "implement a proper gethostbyaddr_r"
|
||||
|
||||
*result = gethostbyaddr( addr, len, type );
|
||||
if ( *result )
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
|
||||
struct hostent *
|
||||
gethostbyaddr(const void *addr, socklen_t len, int type)
|
||||
{
|
||||
|
||||
@@ -42,6 +42,25 @@
|
||||
|
||||
extern int _serv_stayopen;
|
||||
|
||||
int getservbyname_r(
|
||||
const char *name,
|
||||
const char *proto,
|
||||
struct servent *result_buf,
|
||||
char *buf,
|
||||
size_t buflen,
|
||||
struct servent **result
|
||||
)
|
||||
{
|
||||
#warning "implement a proper getservbyport_r"
|
||||
|
||||
*result = getservbyname(name, proto);
|
||||
if ( *result )
|
||||
return 0;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
struct servent *
|
||||
getservbyname(name, proto)
|
||||
const char *name, *proto;
|
||||
|
||||
@@ -42,6 +42,24 @@
|
||||
|
||||
extern int _serv_stayopen;
|
||||
|
||||
int getservbyport_r(
|
||||
int port,
|
||||
const char *proto,
|
||||
struct servent *result_buf,
|
||||
char *buf,
|
||||
size_t buflen,
|
||||
struct servent **result
|
||||
)
|
||||
{
|
||||
#warning "implement a proper getservbyport_r"
|
||||
|
||||
*result = getservbyport(port, proto);
|
||||
if ( *result )
|
||||
return 0;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
struct servent *
|
||||
getservbyport(port, proto)
|
||||
int port;
|
||||
|
||||
Reference in New Issue
Block a user