2 * Copyright (c) 2012 The Native Client Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file.
9 #include "native_client/src/shared/imc/nacl_imc_c.h"
10 #include "native_client/src/shared/platform/nacl_error.h"
12 /* Writes the last error message to the standard error. */
13 static void failWithErrno(const char* message) {
16 if (0 == NaClGetLastErrorString(buffer, sizeof(buffer))) {
17 fprintf(stderr, "%s: %s", message, buffer);
22 int main(int argc, char* argv[]) {
25 UNREFERENCED_PARAMETER(argc);
26 UNREFERENCED_PARAMETER(argv);
28 if (0 != NaClSocketPair(pair)) {
29 failWithErrno("SocketPair");
32 if (0 != NaClClose(pair[0])) {
33 failWithErrno("NaClClose");
36 if (0 != NaClClose(pair[1])) {
37 failWithErrno("NaClClose");