現在、USS インターフェイスを使用して MVS にアプリを移植しています。次のプログラムを (C++ コンパイラを使用して) コンパイルする際に問題に直面しています。
#define _XOPEN_SOURCE_EXTENDED 1
#define _OE_SOCKETS
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
int main() {
struct in_addr add;
int sd = socket(AF_INET, SOCK_STREAM, 0);
inet_ntoa(add);
return 0;
}
IBM docs は、ソケット関数を使用したい人が定義する必要があると述べています_OE_SOCKETS
(そして_XOPEN_SOURCE_EXTENDED
それが C++ の場合)。しかし、未定義のシンボルソケットがあります:
$> c++ test.cpp
"./test.cpp", line 10.12: CCN5274 (S) The name lookup for "socket" did not find a declaration.
CCN0793(I) Compilation failed for file ./test.cpp. Object file not created.
FSUM3065 The COMPILE step ended with return code 12.
FSUM3017 Could not compile test.cpp. Correct the errors and try again.
少し調べてみると、sys/socket.h ヘッダー ファイルが破損していると思われます。実際、このファイルの抜粋を以下に示します。
690: #ifndef _OE_SOCKETS /* must be __UU */
...
732: int socket (int, int, int);
...
780: #endif /* ifndef _OE_SOCKETS */
#ifndef _OE_SOCKETS
は であるべきだと思い#ifdef _OE_SOCKETS
ます。
誰でも私にそれを確認できますか? ありがとう。
最後に、uname は私が使用しているボックスについて次のように述べています。
$> uname -a
OS/390 S0W1 20.00 03 2094