2 Copyright © 1995-2010, The AROS Development Team. All rights reserved.
12 #include "bsdsocket_intern.h"
13 #include "bsdsocket_util.h"
14 #include "netdb_util.h"
16 /*****************************************************************************
20 AROS_LH1(struct protoent
*, getprotobyname
,
23 AROS_LHA(char *, name
, A0
),
26 struct TaskBase
*, taskBase
, 41, BSDSocket
)
46 *****************************************************************************/
50 struct bsdsocketBase
*SocketBase
= taskBase
->glob
;
51 struct PROTOENT
*wsentry
;
52 struct protoent
*arosentry
= NULL
;
57 wsentry
= WSgetprotobyname(name
);
58 D(bug("[getprotobyname] Name: %s, WinSock protoent: 0x%p\n", name
, wsentry
));
62 arosentry
= CopyProtoEntry(wsentry
, taskBase
->pool
);
63 D(bug("[getprorobyname] AROS protoent: 0x%p\n", arosentry
));
69 err
= WSAGetLastError() - WSABASEERR
;
70 D(bug("[getprotobyname] WinSock error %u\n", err
));
78 FreeProtoEntry(taskBase
->pe
, taskBase
->pool
);
79 taskBase
->pe
= arosentry
;
82 SetError(err
, taskBase
);
88 } /* getprotobyname */