error: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘__off_t’ [-Werror=format=]
printf(“length of the file is : %d\n”, buf.st_size);
具体代码
#include <stdio.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/stat.h>
#include <unistd.h>
int main(int argc, char *argv[])
{
int fd = 0;
char *ptr = NULL;
struct stat buf = {
0}