Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
LSH
lsh
Commits
25995656
Commit
25995656
authored
May 23, 2006
by
Niels Möller
Browse files
* configure.ac (HAVE_IOCTL_FIONREAD): Improved test.
Rev: configure.ac:1.70
parent
c868c445
Changes
1
Hide whitespace changes
Inline
Side-by-side
configure.ac
View file @
25995656
...
...
@@ -762,6 +762,7 @@ int main(int argc, char **argv)
} val;
int fds[2];
int res;
if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds) < 0)
{
...
...
@@ -772,12 +773,22 @@ int main(int argc, char **argv)
val.i[0] = 0xdeadbeaf;
val.i[1] = 0xdeadbeaf;
do
res = write(fds[1], "xxx", 3);
while (res < 0 && errno == EINTR);
if (res != 3)
{
printf("write failed: errno = %d.\n", errno);
return 1;
}
if (ioctl(fds[0], FIONREAD, val.i) < 0)
{
printf("ioctl FIONREAD failed: errno = %d.\n", errno);
return 1;
}
if (val.i[0] ==
0
&& val.i[1] == 0xdeadbeaf)
if (val.i[0] ==
3
&& val.i[1] == 0xdeadbeaf)
return 0;
#endif
return 1;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment