Porting to OS/2: Case #4 socklen_t and macros for shutdown()

socklen_t


When porting network stuffs, you'll often encounter the complains of a compiler about socklen_t. Because OS/2 kLIBC does not define it. So we should define it by ourselves. It's simple. Just use typedef or #define.

1typedef int socklen_t;


1#define socklen_t int


Or, you can use -D option of gcc.

  • gcc some_options -Dsocklen_t=int some_options

Macros for shutdown()


shutdown() uses macros for its argument. Unfortunately, however, OS/2 kLIBC does not have them. They are SHUT_RD, SHUT_WR, and SHUT_RDWR. And they correspond to 0, 1 and 2, respectively. So use #define.

1
2
3
#define SHUT_RD     0
#define SHUT_WR     1
#define SHUT_RDWR   2


댓글

이 블로그의 인기 게시물

토렌트: < 왕좌의 게임 > 시즌 1 ~ 시즌 8 완결편 마그넷

토렌트: NGC < 코스모스 > 우리말 더빙 전편(1편~13편) 마그넷

토렌트: < 스타워즈 > Ep.1 ~ Ep.6 마그넷