Changeset 7461 for trunk/src


Ignore:
Timestamp:
Nov 27, 2001, 12:13:03 PM (24 years ago)
Author:
sandervl
Message:

added more FS wrapper macros

Location:
trunk/src/wsock32
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wsock32/socketwrap.h

    r7368 r7461  
    465465#define Rlisten _Rlisten
    466466
     467inline int _gethostname(char *a, int b)
     468{
     469 int yyrc;
     470 USHORT sel = RestoreOS2FS();
     471
     472    yyrc = gethostname(a, b);
     473    SetFS(sel);
     474
     475    return yyrc;
     476}
     477
     478#undef  gethostname
     479#define gethostname _gethostname
     480
     481inline struct hostent *_gethostbyname(char *a)
     482{
     483 struct hostent * yyrc;
     484 USHORT sel = RestoreOS2FS();
     485
     486    yyrc = gethostbyname(a);
     487    SetFS(sel);
     488
     489    return yyrc;
     490}
     491
     492#undef  gethostbyname
     493#define gethostbyname _gethostbyname
     494
     495inline struct hostent *_gethostbyaddr(char *a, int b, int c)
     496{
     497 struct hostent * yyrc;
     498 USHORT sel = RestoreOS2FS();
     499
     500    yyrc = gethostbyaddr(a, b, c);
     501    SetFS(sel);
     502
     503    return yyrc;
     504}
     505
     506#undef  gethostbyaddr
     507#define gethostbyaddr _gethostbyaddr
     508
     509inline struct netent *_getnetbyname(char *a)
     510{
     511 struct netent * yyrc;
     512 USHORT sel = RestoreOS2FS();
     513
     514    yyrc = getnetbyname(a);
     515    SetFS(sel);
     516
     517    return yyrc;
     518}
     519
     520#undef  getnetbyname
     521#define getnetbyname _getnetbyname
     522
     523inline struct netent *_getnetbyaddr(unsigned a, int b)
     524{
     525 struct netent * yyrc;
     526 USHORT sel = RestoreOS2FS();
     527
     528    yyrc = getnetbyaddr(a, b);
     529    SetFS(sel);
     530
     531    return yyrc;
     532}
     533
     534#undef  getnetbyaddr
     535#define getnetbyaddr _getnetbyaddr
     536
     537inline struct servent *_getservbyname(char *a, char *b)
     538{
     539 struct servent * yyrc;
     540 USHORT sel = RestoreOS2FS();
     541
     542    yyrc = getservbyname(a, b);
     543    SetFS(sel);
     544
     545    return yyrc;
     546}
     547
     548#undef  getservbyname
     549#define getservbyname _getservbyname
     550
     551inline struct servent *_getservbyport(int a, char *b)
     552{
     553 struct servent * yyrc;
     554 USHORT sel = RestoreOS2FS();
     555
     556    yyrc = getservbyport(a, b);
     557    SetFS(sel);
     558
     559    return yyrc;
     560}
     561
     562#undef  getservbyport
     563#define getservbyport _getservbyport
     564
     565inline struct protoent *_getprotobyname(char *a)
     566{
     567 struct protoent * yyrc;
     568 USHORT sel = RestoreOS2FS();
     569
     570    yyrc = getprotobyname(a);
     571    SetFS(sel);
     572
     573    return yyrc;
     574}
     575
     576#undef  getprotobyname
     577#define getprotobyname _getprotobyname
     578
     579inline struct protoent *_getprotobynumber(int a)
     580{
     581 struct protoent * yyrc;
     582 USHORT sel = RestoreOS2FS();
     583
     584    yyrc = getprotobynumber(a);
     585    SetFS(sel);
     586
     587    return yyrc;
     588}
     589
     590#undef  getprotobynumber
     591#define getprotobynumber _getprotobynumber
     592
     593inline void _sethostent(int a)
     594{
     595 USHORT sel = RestoreOS2FS();
     596
     597    sethostent(a);
     598    SetFS(sel);
     599}
     600
     601#undef  sethostent
     602#define sethostent _sethostent
     603
     604inline struct hostent *_gethostent()
     605{
     606 struct hostent * yyrc;
     607 USHORT sel = RestoreOS2FS();
     608
     609    yyrc = gethostent();
     610    SetFS(sel);
     611
     612    return yyrc;
     613}
     614
     615#undef  gethostent
     616#define gethostent _gethostent
     617
     618inline void _endhostent()
     619{
     620 USHORT sel = RestoreOS2FS();
     621
     622    endhostent();
     623    SetFS(sel);
     624}
     625
     626#undef  endhostent
     627#define endhostent _endhostent
     628
     629inline void _setnetent(int a)
     630{
     631 USHORT sel = RestoreOS2FS();
     632
     633    setnetent(a);
     634    SetFS(sel);
     635}
     636
     637#undef  setnetent
     638#define setnetent _setnetent
     639
     640inline struct netent *_getnetent()
     641{
     642 struct netent * yyrc;
     643 USHORT sel = RestoreOS2FS();
     644
     645    yyrc = getnetent();
     646    SetFS(sel);
     647
     648    return yyrc;
     649}
     650
     651#undef  getnetent
     652#define getnetent _getnetent
     653
     654inline void _endnetent()
     655{
     656 USHORT sel = RestoreOS2FS();
     657
     658    endnetent();
     659    SetFS(sel);
     660}
     661
     662#undef  endnetent
     663#define endnetent _endnetent
     664
     665inline void _setprotoent(int a)
     666{
     667 USHORT sel = RestoreOS2FS();
     668
     669    setprotoent(a);
     670    SetFS(sel);
     671}
     672
     673#undef  setprotoent
     674#define setprotoent _setprotoent
     675
     676inline struct protoent *_getprotoent()
     677{
     678 struct protoent * yyrc;
     679 USHORT sel = RestoreOS2FS();
     680
     681    yyrc = getprotoent();
     682    SetFS(sel);
     683
     684    return yyrc;
     685}
     686
     687#undef  getprotoent
     688#define getprotoent _getprotoent
     689
     690inline void _endprotoent()
     691{
     692 USHORT sel = RestoreOS2FS();
     693
     694    endprotoent();
     695    SetFS(sel);
     696}
     697
     698#undef  endprotoent
     699#define endprotoent _endprotoent
     700
     701inline void _setservent(int a)
     702{
     703 USHORT sel = RestoreOS2FS();
     704
     705    setservent(a);
     706    SetFS(sel);
     707}
     708
     709#undef  setservent
     710#define setservent _setservent
     711
     712inline struct servent *_getservent()
     713{
     714 struct servent * yyrc;
     715 USHORT sel = RestoreOS2FS();
     716
     717    yyrc = getservent();
     718    SetFS(sel);
     719
     720    return yyrc;
     721}
     722
     723#undef  getservent
     724#define getservent _getservent
     725
     726inline void _endservent()
     727{
     728 USHORT sel = RestoreOS2FS();
     729
     730    endservent();
     731    SetFS(sel);
     732}
     733
     734#undef  endservent
     735#define endservent _endservent
     736
     737inline int _tcp_h_errno()
     738{
     739 int yyrc;
     740 USHORT sel = RestoreOS2FS();
     741
     742    yyrc = tcp_h_errno();
     743    SetFS(sel);
     744
     745    return yyrc;
     746}
     747
     748#undef  tcp_h_errno
     749#define tcp_h_errno _tcp_h_errno
     750
     751inline struct hostent *_Rgethostbyname(char *a)
     752{
     753 struct hostent * yyrc;
     754 USHORT sel = RestoreOS2FS();
     755
     756    yyrc = Rgethostbyname(a);
     757    SetFS(sel);
     758
     759    return yyrc;
     760}
     761
     762#undef  Rgethostbyname
     763#define Rgethostbyname _Rgethostbyname
     764
    467765
    468766#endif  //__SOCKETWRAP_H__
  • trunk/src/wsock32/wsock32.cpp

    r7073 r7461  
    1 /* $Id: wsock32.cpp,v 1.44 2001-10-16 07:26:43 phaller Exp $ */
     1/* $Id: wsock32.cpp,v 1.45 2001-11-27 11:13:03 sandervl Exp $ */
    22
    33/*
     
    206206            strcpy(msg, "WSAEALREADY");
    207207            break;
     208        case WSAHOST_NOT_FOUND:
     209            strcpy(msg, "WSAHOST_NOT_FOUND");
     210            break;
    208211        default:
    209212            strcpy(msg, "unknown");
     
    13801383   ret = gethostname(name, namelen);
    13811384   if(ret == NULL) {
     1385        dprintf(("gethostname returned %s", name));
    13821386        WSASetLastError(NO_ERROR);
    13831387        return 0;
     
    14111415}
    14121416//******************************************************************************
     1417//NOTE: This function can possibly block for a very long time
     1418//      I.e. start ISDNPM without dialing in. gethostbyname will query
     1419//      each name server and retry several times (60+ seconds per name server)
    14131420//******************************************************************************
    14141421ODINFUNCTION1(ws_hostent *,OS2gethostbyname,
     
    14211428    struct hostent*     host;
    14221429   
    1423     USHORT sel = RestoreOS2FS();
     1430    dprintf(("gethostbyname %s", name));
     1431
    14241432    host = gethostbyname( (char*) name);
    1425     SetFS(sel);
    14261433   
    14271434    if( host != NULL )
Note: See TracChangeset for help on using the changeset viewer.