Bug 80713 - Error for fseek() / fwrite() operation
Error for fseek() / fwrite() operation
Status: CLOSED WORKSFORME
Product: Red Hat Linux
Classification: Retired
Component: glibc (Show other bugs)
7.3
i686 Linux
medium Severity high
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-12-30 07:29 EST by Jean-Jacques Sarton
Modified: 2016-11-24 09:58 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-10-03 06:23:50 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jean-Jacques Sarton 2002-12-30 07:29:00 EST
From Bugzilla Helper:
User-Agent: Mozilla/4.72 [de] (X11; I; Linux 2.2.14 i586)

Description of problem:
The following code don't work:

fp = fopen("file", "r+");
fseek(fp,20L,SEEK_END);
pos = ftell(fp);
printf("Positionned at %d\n",pos);
fwrite(data, 100, 1 fp);
pos = ftell(fp);
printf("Positionned at %d\n",pos);
fclose(fp);

The data pointed by data are written at offset 0.
Ftell() report that all is OK.



Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. see above
2.
3.
    

Actual Results:  Positionned at 20
Positionned at 120

In fact the data was written at offset 0!

Expected Results:  proper work

Additional info:
Comment 1 Jakub Jelinek 2003-01-07 11:46:05 EST
You haven't specified how big file initially is.
If I create it empty (ie. touch file before running the prog),
I certainly cannot reproduce this, the data is written at offset 20 till
offset 120.
Comment 2 Ulrich Drepper 2003-10-03 06:23:50 EDT
No reply in almost nine months.  We cannot reproduce a problem.  Closing the bug
now.

Note You need to log in before you can comment on or make changes to this bug.