相关疑难解决方法(0)

SEEK_HOLE和SEEK_DATA在Ubuntu 12.04.2 LTS中不起作用

编译时我得到错误:

cc     holetest.c   -o holetest
holetest.c: In function ‘test_seek’:
holetest.c:48:19: error: ‘SEEK_HOLE’ undeclared (first use in this function)
holetest.c:48:19: note: each undeclared identifier is reported only once for each function it appears in
holetest.c:51:19: error: ‘SEEK_DATA’ undeclared (first use in this function)
make: *** [holetest] Error 1
Run Code Online (Sandbox Code Playgroud)

如果我删除SEEK_HOLE和SEEK_DATA,我没有任何问题.

我错过了包含或图书馆吗?

Makefile文件:

all: holetest

holetest: holetest.c
    rm -f holetest
    gcc holetest.c -o holetest
Run Code Online (Sandbox Code Playgroud)

holetest.c:

#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>

#define FILENAME …
Run Code Online (Sandbox Code Playgroud)

c seek lseek

1
推荐指数
1
解决办法
1715
查看次数

标签 统计

c ×1

lseek ×1

seek ×1