public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* getline is missing on solaris gcc 3.3.2
@ 2005-01-27  1:55 Jeff
  2005-01-27  2:23 ` Ian Lance Taylor
  0 siblings, 1 reply; 2+ messages in thread
From: Jeff @ 2005-01-27  1:55 UTC (permalink / raw)
  To: gcc-help

I'm trying to compile on Solaris 8 using gcc 3.3.2. This simple test
does not compile, saying that it can't find getline. Where is getline on
Solaris? This works fine on Linux.

#define _GNU_SOURCE
#include <cstdio>

int main(int argc, char* const* argv)
{
    FILE* fp = fopen("test","r");
    size_t n;
    char* lineptr = new char[80];
    ssize_t n_read = getline(&lineptr, &n, fp);
}


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: getline is missing on solaris gcc 3.3.2
  2005-01-27  1:55 getline is missing on solaris gcc 3.3.2 Jeff
@ 2005-01-27  2:23 ` Ian Lance Taylor
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Lance Taylor @ 2005-01-27  2:23 UTC (permalink / raw)
  To: Jeff; +Cc: gcc-help

Jeff <jeff@caesoft.biz> writes:

> I'm trying to compile on Solaris 8 using gcc 3.3.2. This simple test
> does not compile, saying that it can't find getline. Where is getline on
> Solaris? This works fine on Linux.
> 
> #define _GNU_SOURCE
> #include <cstdio>
> 
> int main(int argc, char* const* argv)
> {
>     FILE* fp = fopen("test","r");
>     size_t n;
>     char* lineptr = new char[80];
>     ssize_t n_read = getline(&lineptr, &n, fp);
> }

Questions about ordinary library functions are not questions about
gcc, and they should not go to gcc-help.

The getline function is not portable.  It is GNU/Linux specific.  It
is documented as such on the manpage and in the libc manual.  The
function is not available in the Solaris libraries.  You will have to
provide your own version.

Ian

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-01-27  2:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-27  1:55 getline is missing on solaris gcc 3.3.2 Jeff
2005-01-27  2:23 ` Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).