lseek to end?
lseek to end?
- Subject: lseek to end?
- From: Nathaniel Gray <email@hidden>
- Date: Sat, 5 Apr 2008 17:47:30 -0700
Can anybody help me understand why this fails every time with EINVAL
on Leopard x86?
#include <stdio.h>
#include <fcntl.h>
#include <assert.h>
int main(int argc, char *argv[]) {
int fd = open(argv[0], O_RDWR);
assert(fd != -1);
off_t s = lseek(fd, 0, SEEK_END);
if (s == -1) {
perror("Couldn't seek to end");
return 1;
}
printf("File is %d bytes\n", s);
return 0;
}
Thanks,
-n8
PS: Please CC me with replies.
--
>>>-- Nathaniel Gray -- Caltech Computer Science ------>
>>>-- Mojave Project -- http://mojave.cs.caltech.edu -->
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden