xfs
[Top] [All Lists]

fseeko64() suspended(details)

To: <linux-xfs@xxxxxxxxxxx>
Subject: fseeko64() suspended(details)
From: "yxy_oversea" <yxy_oversea@xxxxxxxxxxx>
Date: Fri, 3 Nov 2000 20:57:46 +0800
Cc: <majordomo@xxxxxxxxxxx>
Sender: owner-linux-xfs@xxxxxxxxxxx

Dear friends:
 Thanks for your answers.
 This time, I include my test source code, strace output and xfs_bmap ?v results here, wish it helps to solve the problem.
 
======================
My source code is as followed:
======================
 
#include <stdlib.h>

#define BIG_FILE "./bigone"
 
int main(int argc, char **argv)
{
 FILE *fd;
 __off64_t myoff;
 
 if( (fd=(FILE *)fopen64("./bigone", "rb")) == NULL ) 
 {
  perror( "\nopen bigone fail\n" );
  exit(0);
 }
 
 myoff=(__off64_t)1000000*(__off64_t)2200; 
 printf("\n begin to seek \n");
 if( fseeko64(fd,myoff, SEEK_SET) !=0 )
 {
  perror("\nseek fail\n");
  exit(0);
 }
 else
 {
  printf("\nseek ok!!\n");
 } 
 fclose(fd); 
 return 1;
}
------ end of source code --------
 

==============================
Strace result is as following:
==============================
 
execve("./a.out", ["./a.out"], [/* 20 vars */]) = 0
brk(0)                                  = 0x8049758
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40014000
open("/etc/ld.so.preload", O_RDONLY)    = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=11671, ...}) = 0
old_mmap(NULL, 11671, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40015000
close(3)                                = 0
open("/lib/libc.so.6", O_RDONLY)        = 3
fstat(3, {st_mode=S_IFREG|0755, st_size=4101324, ...}) = 0
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\210\212"..., 4096) = 4096
old_mmap(NULL, 1001564, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x40018000
mprotect(0x40105000, 30812, PROT_NONE)  = 0
old_mmap(0x40105000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0xec000) = 0x40105000
old_mmap(0x40109000, 14428, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x40109000
close(3)                                = 0
mprotect(0x40018000, 970752, PROT_READ|PROT_WRITE) = 0
mprotect(0x40018000, 970752, PROT_READ|PROT_EXEC) = 0
munmap(0x40015000, 11671)               = 0
personality(PER_LINUX)                  = 0
getpid()                                = 1138
brk(0)                                  = 0x8049758
brk(0x8049820)                          = 0x8049820
brk(0x804a000)                          = 0x804a000
open("./bigone", O_RDONLY|O_LARGEFILE)  = 3
fstat64(0x1, 0xbffff588)                = 0
old_mmap(NULL, 65536, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4010d000
fstat64(0x3, 0xbffffb6c)                = 0
old_mmap(NULL, 65536, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4011d000
_llseek(3, 18446744071614562304, [2199977984], SEEK_SET) = 0
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 22016) = 22016
close(3)                                = 0
munmap(0x4011d000, 65536)               = 0
write(1, "\n begin to seek \n\nseek ok!!\n", 28
 begin to seek
 
seek ok!!
) = 28
munmap(0x4010d000, 65536)               = 0
_exit(1)                                = ?
 
------ end of strace result --------
 
=====================
Information about file bigone
=====================
I generate “bigone” by using:
dd if=/dev/zero of=bigone bs=1024k count=4500
 
[root]# xfs_bmap -v bigone
bigone:
 EXT: FILE-OFFSET         BLOCK-RANGE      AG AG-OFFSET          TOTAL
   0: [0..1959935]:       96..1960031       0 (96..1960031)    1959936
   1: [1959936..3917823]: 1974904..3932791  1 (64..1957951)    1957888
   2: [3917824..5853183]: 3949744..5885103  2 (64..1935423)    1935360
   3: [5853184..7811071]: 5924584..7882471  3 (64..1957951)    1957888
   4: [7811072..9215999]: 7909024..9313951  4 (9664..1414591)  1404928
 
 
   Thank you very much.
 
                    yangxy
<Prev in Thread] Current Thread [Next in Thread>