Documentation for thread-safe network lookup functions.

Documentation for thread-safe network lookup functions.

Post by John Mui » Thu, 17 May 2001 00:49:55



Does anyone have a documentation link for the thread-safe network
configuration lookup functions? The ones I'm referring to include (from
AIX4.3.3's /usr/include/netdb.h):

extern int getnetbyaddr_r(in_addr_t net, int type, struct netent *netptr,
        struct netent_data *net_data);
extern int getnetbyname_r(const char *name, struct netent *netptr,
        struct netent_data *net_data);
extern int setnetent_r(int f, struct netent_data *net_data);
extern void endnetent_r(struct netent_data *net_data);
extern int getnetent_r(struct netent *net, struct netent_data *net_data);
extern int gethostbyname_r(const char *name, struct hostent *htent,
        struct hostent_data *ht_data);
extern int gethostbyaddr_r(char *addr, size_t len, int type,
        struct hostent *htent, struct hostent_data *ht_data);
extern int gethostent_r(struct hostent *htent, struct hostent_data
*ht_data);
extern void endhostent_r(struct hostent_data *ht_data);
extern void sethostent_r(int flag, struct hostent_data *ht_data);
extern int setservent_r(int f, struct servent_data *serv_data);
extern void endservent_r(struct servent_data *serv_data);
extern int getservent_r(struct servent *serv, struct servent_data
*serv_data);
extern int getservbyname_r(const char *name, const char *proto,
        struct servent *servptr, struct servent_data *serv_data);
extern int getservbyport_r(int port, const char *proto, struct servent
*servptr,        struct servent_data *serv_data);
extern int setprotoent_r(int f, struct protoent_data *proto_data);
extern void endprotoent_r(struct protoent_data *proto_data);
extern int getprotoent_r(struct protoent *proto,
        struct protoent_data *prot_data);
extern int getprotobyname_r(const char *name, struct protoent *protoptr,
        struct protoent_data *proto_data);
extern int getprotobynumber_r(int proto, struct protoent *protoptr,
         struct protoent_data *proto_data);
extern int setrpcent_r(int f, struct rpcent_data *rpc_data);
extern void endrpcent_r(struct rpcent_data *rpc_data);
extern int getrpcent_r(struct rpcent *rpcent, struct rpcent_data *rpc_data);
extern int getrpcbyname_r(const char *name, struct rpcent *rpcent,
                          struct rpcent_data *rpc_data);
extern int getrpcbynumber_r(int number, struct rpcent *rpcent,
                            struct rpcent_data *rpc_data);
extern int setnetgrent_r(char *, void **);
extern void endnetgrent_r(void **ptr);
extern int getnetgrent_r( char **, char **, char **, void **);
extern int innetgr_r(char *, char *, char *, char *, struct innetgr_data *);

--
John Muir
SDM Platform Software Design
NORTEL Networks

 
 
 

Documentation for thread-safe network lookup functions.

Post by John Mui » Thu, 17 May 2001 04:10:53


Interesting, while these are documented on the iSeries pages, they are not
in the AIX/RS6000 pages.

http://as400bks.rochester.ibm.com/pubs/html/as400/v4r5/ic2924/index.h...

I hope the information on getprotobyname_r() as seen in the link above is
accurate for AIX as well... ;-)


> Does anyone have a documentation link for the thread-safe network
> configuration lookup functions? The ones I'm referring to include (from
> AIX4.3.3's /usr/include/netdb.h):

> [...All kinds of _r interfaces...]
> extern void endprotoent_r(struct protoent_data *proto_data);
> extern int getprotoent_r(struct protoent *proto,
>         struct protoent_data *prot_data);
> extern int getprotobyname_r(const char *name, struct protoent *protoptr,
>         struct protoent_data *proto_data);

--
John Muir
SDM Platform Software Design
NORTEL Networks

 
 
 

1. Thread-safe functions

Posix Threads standard describes several (optional) *_r
thread-safe functions. Most of them seem not to exist in
FreeBSD (3.0-980414-SNAP). Is someone working on this
subject?

Two other interesting observations I made last night:

1. _POSIX_THREADS macro is defined in pthread.h but
I think it should be defined in unistd.h. (See Programming
with Posix Threads, page 307).

2. _POSIX_THREAD_SAFE_FUNCTIONS is defined even if
most of the functions are not implemented. This should
be in the unistd.h too, shouldn't it.

--
Dado Colussi                    Xenetic Oy

     suora  (09) 6689 6485           fax      (09) 6689 6489
     gsm    040 500 5501             osoite   Pursimiehenkatu 29-31 B
                                              00150 HELSINKI

2. Viri on unix

3. Are the dl* functions thread-safe?

4. Sun StorEdge Volume Manager

5. Thread-safe gethostby* functions in AIX 4.3.3.

6. Networker and an L1000

7. Using thread-safe C library functions.

8. lpd on solaris 2 ??

9. Solaris 8 threads: If a routine is Async-Signal-Safe is it also thread Safe?

10. mmap, thread-safe, and signal-safe

11. Thread-safe and Signal-safe

12. List of non-thread-safe SunOS library functions?

13. need multi thread safe usleep() function