site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com In message <053B7261-343F-4F22-8A26-85D84A6DE763@caltech.edu>, Nathaniel Gray w rites:
Can anybody help me understand why this fails every time with EINVAL on Leopard x86?
Prototypes. Compile with warnings on; you'd have gotten the answer from the compiler.
#include <stdio.h> #include <fcntl.h> #include <assert.h>
You don't have unistd.h.
off_t s = lseek(fd, 0, SEEK_END);
Since you didn't declare it, lseek is declared implicit int, and 0 is not promoted to 64 bits. The rest follows. -s _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com