From 75ebfc6f7a7692d772b729b2d83038a9054b4f90 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Fri, 12 May 2000 06:55:09 +0000 Subject: Merge from TNG. (This used to be commit af5ded9f17addb4bc89ecb762b9b99d2f99463ab) --- testsuite/nsswitch/bigfd.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 testsuite/nsswitch/bigfd.c (limited to 'testsuite/nsswitch/bigfd.c') diff --git a/testsuite/nsswitch/bigfd.c b/testsuite/nsswitch/bigfd.c new file mode 100644 index 0000000000..99e402e0f3 --- /dev/null +++ b/testsuite/nsswitch/bigfd.c @@ -0,0 +1,38 @@ +/* + * Test maximum number of file descriptors winbind daemon can handle + */ + +#include +#include +#include +#include + +int main(int argc, char **argv) +{ + struct passwd *pw; + int i; + + while(1) { + + /* Start getpwent until we get an NT user. This way we know we + have at least opened a connection to the winbind daemon */ + + setpwent(); + + while((pw = getpwent()) != NULL) { + if (strchr(pw->pw_name, '/') != NULL) { + break; + } + } + + if (pw != NULL) { + i++; + printf("got pwent handle %d\n", i); + } else { + printf("winbind daemon not running?\n"); + exit(1); + } + + sleep(1); + } +} -- cgit