<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://sourceware.org/bugzilla/page.cgi?id=bugzilla.dtd">

<bugzilla version="4.4+"
          urlbase="http://sourceware.org/bugzilla/"
          
          maintainer="overseers@sourceware.org"
>

    <bug>
          <bug_id>1864</bug_id>
          
          <creation_ts>2005-11-14 20:38:00 +0000</creation_ts>
          <short_desc>bad struct statvfs declaration on Alpha when _FILE_OFFSET_BITS is defined</short_desc>
          <delta_ts>2012-02-15 18:16:37 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>glibc</product>
          <component>ports</component>
          <version>2.3.5</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Sergey Tikhonov">tsv</reporter>
          <assigned_to name="Not yet assigned to anyone">unassigned</assigned_to>
          <cc>glibc-bugs</cc>
    
    <cc>rth</cc>
    
    <cc>rth</cc>
    
    <cc>samuel.thibault</cc>
    
    <cc>stefaan.deroeck</cc>
    
    <cc>vapier</cc>
          <cf_gcchost>alpha-unknown-linux</cf_gcchost>
          <cf_gcctarget>alpha-unknown-linux</cf_gcctarget>
          <cf_gccbuild>alpha-unknown-linux</cf_gccbuild>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>6812</commentid>
    <comment_count>0</comment_count>
    <who name="Sergey Tikhonov">tsv</who>
    <bug_when>2005-11-14 20:38:15 +0000</bug_when>
    <thetext>GNU C Library development release version 2.3.5, by Roland McGrath et al.
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 4.0.1 20050727 (Red Hat 4.0.1-5).
Compiled on a Linux 2.4.20 system on 2005-11-01.

The following test program shows invalid behavior:
#include &lt;sys/statvfs.h&gt;
#include &lt;stdio.h&gt;

void print(struct statvfs value)
{
         printf(&quot;%ld\n&quot;, (long)value.f_bavail);
}

int main(int argc, char*argv[])
{
         struct statvfs st;
         if(argc!=2){
                 printf(&quot;usage: checkstat &lt;path&gt;\n&quot;);
                 return 1;
         }
         statvfs(argv[1], &amp;st);
         print(st);
}

falk@juist:/tmp% df /                   
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/hda1               127383     88516     32290  74% /
falk@juist:/tmp% gcc test.c &amp;&amp; ./a.out /
32290
falk@juist:/tmp% gcc -D_FILE_OFFSET_BITS=64 test.c &amp;&amp; ./a.out /
116483808061937

The problem seems to be that ./sysdeps/unix/sysv/linux/alpha/bits/typesizes.h is
different from ./sysdeps/generic/bits/typesizes.h and defines
__FSBLKCNT_T_TYPE, __FSBLKCNT64_T_TYPE, __FSFILCNT_T_TYPE, __FSFILCNT64_T_TYPE
macros as 32 and 64 bits. I guess the glibc is build with 32 bits
(__FSBLKCNT_T_TYPE, __FSFILCNT_T_TYPE) by default.

What is the correct way to fix it? To define above macros the same way as it is
done in generic version?

Thank you</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>6819</commentid>
    <comment_count>1</comment_count>
    <who name="Sergey Tikhonov">tsv</who>
    <bug_when>2005-11-15 15:05:45 +0000</bug_when>
    <thetext>It seems that in 1999 there was change that converted __FSBLKCNT_T_TYPE,
__FSFILCNT_T_TYPE from 64 bits to 32 bits for alpha. So the question is how it
should work with _FILE_OFFSET_BITS defined.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>7058</commentid>
    <comment_count>2</comment_count>
    <who name="Stefaan">stefaan.deroeck</who>
    <bug_when>2005-11-29 09:29:50 +0000</bug_when>
    <thetext>Encountered the same problem when trying to run net-snmp (daemon) on alpha
(latest gentoo stable). Worked around it by hacking into typesizes.h (yes, very
dirty). A clean fix would be really nice.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>24753</commentid>
    <comment_count>3</comment_count>
    <who name="Samuel Thibault">samuel.thibault</who>
    <bug_when>2008-08-12 02:30:12 +0000</bug_when>
    <thetext>Mmm, looking at kernel source, it looks likes alpha is indeed the only 64bit arch that has a 32bit stat/statfs interface (probably because that&apos;s the oldest one).  And although work has been done to expose a 64bit interface to userland for stat, it wasn&apos;t for statfs, and applications have been compiled with a dual 32/64bit interface.  Could you try the attached patch? </thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>24754</commentid>
    <comment_count>4</comment_count>
      <attachid>2903</attachid>
    <who name="Samuel Thibault">samuel.thibault</who>
    <bug_when>2008-08-12 02:31:21 +0000</bug_when>
    <thetext>Created attachment 2903
make alpha use a dual 32/64bit interface for *stat*fs*</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>25889</commentid>
    <comment_count>5</comment_count>
    <who name="Ulrich Drepper">drepper.fsp</who>
    <bug_when>2008-11-26 23:27:28 +0000</bug_when>
    <thetext>Alpha is not in the main tree anymore since we have no maintainer.  Somebody has
to step up and volunteer to be the maintainer of the alpha ports tree or nothing
will happen.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>53145</commentid>
    <comment_count>6</comment_count>
    <who name="Richard Henderson">rth</who>
    <bug_when>2012-02-15 18:16:37 +0000</bug_when>
    <thetext>This has been fixed since

commit 7ffd2bd725c3e4d77e6bfe36b76500d20427929d
Author: Richard Henderson &lt;rth@twiddle.net&gt;
Date:   Wed May 5 08:12:11 2010 -0700

    alpha: Do the 32/64-bit split on statfs routines.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>2903</attachid>
            <date>2008-08-12 02:31:00 +0000</date>
            <delta_ts>2008-08-12 02:31:21 +0000</delta_ts>
            <desc>make alpha use a dual 32/64bit interface for *stat*fs*</desc>
            <filename>patch</filename>
            <type>text/plain</type>
            <size>1969</size>
            <attacher name="Samuel Thibault">samuel.thibault</attacher>
            
              <data encoding="base64">SW5kZXg6IGFscGhhL2ZzdGF0ZnM2NC5jCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KUkNTIGZpbGU6IGFscGhhL2ZzdGF0
ZnM2NC5jCmRpZmYgLU4gYWxwaGEvZnN0YXRmczY0LmMKLS0tIC9kZXYvbnVsbAkxIEphbiAxOTcw
IDAwOjAwOjAwIC0wMDAwCisrKyBhbHBoYS9mc3RhdGZzNjQuYwkxMiBBdWcgMjAwOCAwMjoyODoy
NyAtMDAwMApAQCAtMCwwICsxIEBACisjaW5jbHVkZSAiLi4vZnN0YXRmczY0LmMiCkluZGV4OiBh
bHBoYS9mc3RhdHZmcy5jCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT0KUkNTIGZpbGU6IGFscGhhL2ZzdGF0dmZzLmMKZGlm
ZiAtTiBhbHBoYS9mc3RhdHZmcy5jCi0tLSAvZGV2L251bGwJMSBKYW4gMTk3MCAwMDowMDowMCAt
MDAwMAorKysgYWxwaGEvZnN0YXR2ZnMuYwkxMiBBdWcgMjAwOCAwMjoyODoyNyAtMDAwMApAQCAt
MCwwICsxIEBACisjaW5jbHVkZSAiLi4vZnN0YXR2ZnMuYyIKSW5kZXg6IGFscGhhL2ZzdGF0dmZz
NjQuYwo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09ClJDUyBmaWxlOiBhbHBoYS9mc3RhdHZmczY0LmMKZGlmZiAtTiBhbHBo
YS9mc3RhdHZmczY0LmMKLS0tIC9kZXYvbnVsbAkxIEphbiAxOTcwIDAwOjAwOjAwIC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0dmZzLmMKLS0tIC9kZXYvbnVsbAkxIEphbiAxOTcwIDAwOjAw
OjAwIC0wMDAwCisrKyBhbHBoYS9zdGF0dmZzLmMJMTIgQXVnIDIwMDggMDI6Mjg6MjcgLTAwMDAK
QEAgLTAsMCArMSBAQAorI2luY2x1ZGUgIi4uL3N0YXR2ZnMuYyIKSW5kZXg6IGFscGhhL3N0YXR2
ZnM2NC5jCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT0KUkNTIGZpbGU6IGFscGhhL3N0YXR2ZnM2NC5jCmRpZmYgLU4gYWxw
aGEvc3RhdHZmczY0LmMKLS0tIC9kZXYvbnVsbAkxIEphbiAxOTcwIDAwOjAwOjAwIC0wMDAwCisr
KyBhbHBoYS9zdGF0dmZzNjQuYwkxMiBBdWcgMjAwOCAwMjoyODoyNyAtMDAwMApAQCAtMCwwICsx
IEBACisjaW5jbHVkZSAiLi4vc3RhdHZmczY0LmMiCg==
</data>

          </attachment>
      

    </bug>

</bugzilla>