[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: stdout?

From: Ben Collins-Sussman <sussman_at_newton.collab.net>
Date: 2001-01-26 15:15:52 CET

Greg Stein <gstein@lyra.org> writes:

> #include <unistd.h>
> #include <apr_portable.h>
>
> {
> apr_file_t *file = NULL; /* ### grumble. NULL needed... */
>
> status = apr_put_os_file(&file, STDOUT_FILENO, pool);
> return file;
> }
>
> There ya go! :-)
>
> The put_os thing is os-specific, so it isn't portable.
>

Hmmm, I get a compile warning that arg 2 is implicitly converting an
integer to a pointer. If I cast it in place ((apr_os_file_t *)
STDOUT_FILENO), then it compiles fine, but I get a segfault right in
the middle of apr_put_os_file()!

(Specifically, in file_io/unix/open.c, line 227 where it tries to set
->filedes).

Also: what do you mean by your last sentence? How can something in
APR, a portability layer, be non-portable? :) I mean, we're talking
about grabbing stdout, which is an ANSI C thing, no?
Received on Sat Oct 21 14:36:20 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.