Call for testing: OpenSSH-5.9
Darren Tucker
dtucker at zip.com.au
Mon Aug 29 14:48:11 EST 2011
On Sun, Aug 28, 2011 at 9:18 PM, Darren Tucker <dtucker at zip.com.au> wrote:
[...]
> I trussed an sshd (on Solaris 10 x86) and the failure seems to be polling FDs:
confirmed: it's poll. Still not sure what to do about it, it's used
in atomicio.
$ cat polltest.c
#include <sys/time.h>
#include <sys/resource.h>
#include <stdio.h>
#include <poll.h>
#include <errno.h>
int main(int argc, char **argv)
{
struct rlimit rl_zero;
struct pollfd pfd;
int fd, r, enforce_limit = 0;
if (argc == 2 && strcmp(argv[1], "limit") == 0)
enforce_limit = 1;
fd = open("/dev/null", "r");
if (enforce_limit) {
rl_zero.rlim_cur = rl_zero.rlim_max = 0;
setrlimit(RLIMIT_FSIZE, &rl_zero);
setrlimit(RLIMIT_NOFILE, &rl_zero);
}
pfd.fd = fd;
pfd.events = POLLOUT;
r = poll(&pfd, 1, -1);
printf("poll = %d, error: %s\n", r, strerror(errno));
}
$ gcc polltest.c && ./a.out
poll = 1, error: Error 0
$ ./a.out limit
poll = -1, error: Invalid argument
--
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69
Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.
More information about the openssh-unix-dev
mailing list