#include #include #include #include #include #include "get_auth_data_fn.h" /* * This test is intended to ensure that the timestamps returned by * libsmbclient using smbc_stat() are the same as those returned by * smbc_fstat(). */ #define COMPARE(_st1, _st2, field) \ if (_st1.field != _st2.field) { \ printf("Field " #field " MISMATCH: st1=%lu, st2=%lu\n", \ (unsigned long) _st1.field, \ (unsigned long) _st2.field); \ } int main(int argc, char* argv[]) { int fd; struct stat st1; struct stat st2; char * url = argv[1]; int i; if(argc != 2) { printf("usage: %s \n", argv[0]); return 1; } smbc_init(get_auth_data_fn, 0); if ((fd = smbc_open(url, O_RDONLY, 0)) < 0) { perror("smbc_open"); return 1; } for (i = 0; i < 100; i++) { if (smbc_fstat(fd, &st2) < 0) { perror("smbc_fstat"); return 1; } } smbc_close(fd); return 0; }