GPGME Large File Support on HPUX (seek)
Aaron Bush
abush at microcenter.com
Thu Jun 21 21:37:47 CEST 2007
I'm having some problems with GPGME (1.1.4) and GPG (1.4.7) and the
large file support compile time options. I have compiled this on HPUX
11.00 and when I run the following C sample I get odd file offset
results. I have tried building GPGME with both CFLAGS set to
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 and CFLAGS as nothing.
---- sample ----
#include <gpgme.h>
int
main (int argc, char *argv[])
{
gpgme_data_t in;
off_t len;
gpgme_error_t err;
err = gpgme_data_new_from_mem(&in, "Hallo Leute\n", 12, 0);
printf("new_mem:%d %s->%d\n", __LINE__, gpgme_strerror(err),
err);
len = gpgme_data_seek(in, 0, SEEK_SET);
printf("Offset SEEK_SET = %d\n", len);
len = gpgme_data_seek(in, 0, SEEK_END);
printf("Offset SEEK_END = %d\n", len);
}
Compiling as:
1) gcc b.c `gpgme-config --libs --cflags` -D_FILE_OFFSET_BITS=64
./a.out
new_mem:12 Success->0
Offset SEEK_SET = 27907
Offset SEEK_END = 1073762736
2) gcc b.c `gpgme-config --libs --cflags`
./a.out
new_mem:12 Success->0
Offset SEEK_SET = -1
Offset SEEK_END = -1
I have read through similar posts and they all point to reading section
2.3 which refers to using the _FILE_OFFSET_BITS=64 and
LARGEFILE_SUPPORT=1 and building gpgme with large file support. When I
build with both preprocessor symbols I get:
3) gcc b.c `gpgme-config --libs --cflags` -D_FILE_OFFSET_BITS=64
-D_LARGEFILE_SOURCE=1
./a.out
new_mem:12 Success->0
Offset SEEK_SET = 29206
Offset SEEK_END = 1073762752
Any suggestions or pointers would be greatly appreciated.
Thanks,
-ab
More information about the Gnupg-devel
mailing list