Latest GLIBC release

Q:The home page currently states that the latest version is 2.8, yet 2.7 is the latest version available on the ftp site. Why is that?
A:The GLIBC maintainer has said that release tarballs are a deprecated concept. Please reference this email to the libc-alpha mailing list:

The current stable release is the latest available cvs release branch (at the time of this writing, glibc 2.8). This particular version can be fetched with the following CVS command:

cvs -z 9 -d :pserver:anoncvs@sources.redhat.com:/cvs/glibc login
{enter "anoncvs" as the password}
cvs -z 9 -d :pserver:anoncvs@sources.redhat.com:/cvs/glibc co -r glibc-2_8-branch -P libc
{if you want 'ports' do the following}
cd libc
cvs -z 9 -d :pserver:anoncvs@sources.redhat.com:/cvs/glibc co -r glibc-2_8-branch ports

Old Crypt Add-on

Q:I get the following error about an old crypt add-on when I configure GLIBC. What's going on?

*** It seems that you're using an old `crypt' add-on.  crypt is now
*** part of glibc and using the old add-on will not work with this
*** release.  Start again with fresh sources and without the old
*** `crypt' add-on.

A:You must specify --enable-add-ons=foo, or --enable-add-ons (which defaults to nptl,libidn) to avoid the automatic search for addons from adding crypt. Don't enable 'crypt' and don't unpack any ancient crypt add-on tarballs into your source tree.

fgetc function / compliance to standard

Q:Does the behaviour of fgetc violate the c standard?

#include <stdio.h>
#include <unistd.h>

int main(void)
{
    int c;
    FILE *fp = fopen("file.txt", "r");
    for(;;) {
        c = fgetc(fp);
        if(c == EOF)
            sleep(1);
        else
            putchar(c);
    }   

    return 0;
}

This program reads until EOF, then sleeps. When I append new data to file.txt, it continues reading.

The c99 standard says in ยง7.19.7.1:

If the end-of-file indicator for the input stream pointed to by stream is not set and a
next character is present, the fgetc function obtains that character as an unsigned
char converted to an int and advances the associated file position indicator for the
stream (if defined).

If the end-of-file indicator for the stream is set, or if the stream is at end-of-file, the end-
of-file indicator for the stream is set and the fgetc function returns EOF. Otherwise, the
fgetc function returns the next character from the input stream pointed to by stream.

My manpage for feof / clearerr says:

The end-of-file indicator can only be cleared by the function clearerr().

When the program reaches end of file, the end-of-file indicator must be set and next time fgetc is used, it must return EOF again, even if there is new data available. Does this mean that glibc violates the standards or did I get something wrong?

None: Feedback (last edited 2009-04-11 13:17:10 by JoernHeissler)