1 // Copyright 2015 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
14 // Tests libgo2.so, which does not export any functions.
15 // Read a string from the file descriptor and print it.
22 // The descriptor will be initialized in a thread, so we have to
23 // give a chance to get opened.
24 for (i = 0; i < 200; i++) {
25 n = read(fd, buf, sizeof buf);
28 if (errno != EBADF && errno != EINVAL) {
29 fprintf(stderr, "BUG: read: %s\n", strerror(errno));
33 // An EBADF error means that the shared library has not opened the
36 ts.tv_nsec = 10000000;
41 fprintf(stderr, "BUG: failed to read any data from pipe\n");
46 fprintf(stderr, "BUG: unexpected EOF\n");
50 if (n == sizeof buf) {