-#define _LARGEFILE64_SOURCE
#define _FILE_OFFSET_BITS 64
#include <sys/types.h>
sec_size = sizeof(*feat_sec) * nr_sections;
sec_start = self->data_offset + self->data_size;
- lseek64(fd, sec_start + sec_size, SEEK_SET);
+ lseek(fd, sec_start + sec_size, SEEK_SET);
if (perf_header__has_feat(self, HEADER_TRACE_INFO)) {
struct perf_file_section *trace_sec;
trace_sec = &feat_sec[idx++];
/* Write trace info */
- trace_sec->offset = lseek64(fd, 0, SEEK_CUR);
+ trace_sec->offset = lseek(fd, 0, SEEK_CUR);
read_tracing_data(fd, attrs, nr_counters);
- trace_sec->size = lseek64(fd, 0, SEEK_CUR) - trace_sec->offset;
+ trace_sec->size = lseek(fd, 0, SEEK_CUR) - trace_sec->offset;
}
buildid_sec = &feat_sec[idx++];
/* Write build-ids */
- buildid_sec->offset = lseek64(fd, 0, SEEK_CUR);
+ buildid_sec->offset = lseek(fd, 0, SEEK_CUR);
err = dsos__write_buildid_table(fd);
if (err < 0) {
pr_debug("failed to write buildid table\n");
goto out_free;
}
- buildid_sec->size = lseek64(fd, 0, SEEK_CUR) -
- buildid_sec->offset;
+ buildid_sec->size = lseek(fd, 0, SEEK_CUR) -
+ buildid_sec->offset;
dsos__cache_build_ids();
}
- lseek64(fd, sec_start, SEEK_SET);
+ lseek(fd, sec_start, SEEK_SET);
err = do_write(fd, feat_sec, sec_size);
if (err < 0)
pr_debug("failed to write feature section\n");
pr_debug("failed to write perf header\n");
return err;
}
- lseek64(fd, self->data_offset + self->data_size, SEEK_SET);
+ lseek(fd, self->data_offset + self->data_size, SEEK_SET);
self->frozen = 1;
return 0;
sec_size = sizeof(*feat_sec) * nr_sections;
- lseek64(fd, self->data_offset + self->data_size, SEEK_SET);
+ lseek(fd, self->data_offset + self->data_size, SEEK_SET);
if (perf_header__getbuffer64(self, fd, feat_sec, sec_size))
goto out_free;
struct perf_header *ph,
int feat, int fd)
{
- if (lseek64(fd, self->offset, SEEK_SET) < 0) {
+ if (lseek(fd, self->offset, SEEK_SET) == (off_t)-1) {
pr_debug("Failed to lseek to %Ld offset for feature %d, "
"continuing...\n", self->offset, feat);
return 0;
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
-#define _LARGEFILE64_SOURCE
+#define _FILE_OFFSET_BITS 64
#include <dirent.h>
#include <stdio.h>
char *str = NULL;
int size = 0;
int i;
- s64 r;
+ off_t r;
for (;;) {
r = read(input_fd, buf, BUFSIZ);
i++;
/* move the file descriptor to the end of the string */
- r = lseek64(input_fd, -(r - i), SEEK_CUR);
- if (r < 0)
+ r = lseek(input_fd, -(r - i), SEEK_CUR);
+ if (r == (off_t)-1)
die("lseek");
if (str) {
static void get_next_page(int cpu)
{
- off64_t save_seek;
- off64_t ret;
+ off_t save_seek;
+ off_t ret;
if (!cpu_data[cpu].page)
return;
update_cpu_data_index(cpu);
/* other parts of the code may expect the pointer to not move */
- save_seek = lseek64(input_fd, 0, SEEK_CUR);
+ save_seek = lseek(input_fd, 0, SEEK_CUR);
- ret = lseek64(input_fd, cpu_data[cpu].offset, SEEK_SET);
- if (ret < 0)
+ ret = lseek(input_fd, cpu_data[cpu].offset, SEEK_SET);
+ if (ret == (off_t)-1)
die("failed to lseek");
ret = read(input_fd, cpu_data[cpu].page, page_size);
if (ret < 0)
die("failed to read page");
/* reset the file pointer back */
- lseek64(input_fd, save_seek, SEEK_SET);
+ lseek(input_fd, save_seek, SEEK_SET);
return;
}