tsocket_bsd: Attempt to increase the SO_SNDBUF if we get EMSGSIZE in sendto()
[Samba.git] / lib / ntdb / test / api-80-tdb_fd.c
blob81b7284749ec169bec3715701f3eb30045b3d7f6
1 #include "config.h"
2 #include "ntdb.h"
3 #include "tap-interface.h"
4 #include <sys/types.h>
5 #include <sys/stat.h>
6 #include <fcntl.h>
7 #include "logging.h"
9 int main(int argc, char *argv[])
11 unsigned int i;
12 struct ntdb_context *ntdb;
13 int flags[] = { NTDB_INTERNAL, NTDB_DEFAULT, NTDB_NOMMAP,
14 NTDB_INTERNAL|NTDB_CONVERT, NTDB_CONVERT,
15 NTDB_NOMMAP|NTDB_CONVERT };
17 plan_tests(sizeof(flags) / sizeof(flags[0]) * 3);
18 for (i = 0; i < sizeof(flags) / sizeof(flags[0]); i++) {
19 ntdb = ntdb_open("api-80-ntdb_fd.ntdb", flags[i]|MAYBE_NOSYNC,
20 O_RDWR|O_CREAT|O_TRUNC, 0600, &tap_log_attr);
21 if (!ok1(ntdb))
22 continue;
24 if (flags[i] & NTDB_INTERNAL)
25 ok1(ntdb_fd(ntdb) == -1);
26 else
27 ok1(ntdb_fd(ntdb) > 2);
28 ntdb_close(ntdb);
29 ok1(tap_log_messages == 0);
31 return exit_status();