#include "apue.h"
int main()
{
int flag=lseek(STDIN_FILENO,0,SEEK_CUR);
if(flag==-1)
{
printf("can't seek\n");
}
else
{
printf("seek ok\n");
printf("%d\n",flag);
}
return 0;
}
测试证明,lseek()返回为0,即文件的偏移值默认为0
#include "apue.h"
int main()
{
int flag=lseek(STDIN_FILENO,0,SEEK_CUR);
if(flag==-1)
{
printf("can't seek\n");
}
else
{
printf("seek ok\n");
printf("%d\n",flag);
}
return 0;
}
测试证明,lseek()返回为0,即文件的偏移值默认为0