This is the mail archive of the
libc-alpha@sourceware.cygnus.com
mailing list for the glibc project.
Re: iconv(3) return value
- To: Edmund GRIMLEY EVANS <edmundo at rano dot org>
- Subject: Re: iconv(3) return value
- From: Bruno Haible <haible at ilog dot fr>
- Date: Wed, 19 Jan 2000 14:17:25 +0100 (MET)
- Cc: libc-alpha at sourceware dot cygnus dot com
- References: <200001181914.UAA26294@jaures.ilog.fr><20000118231305.D9583@rano.org>
Edmund GRIMLEY EVANS writes:
> Bruno Haible <haible@ilog.fr>:
>
> > Correct:
> > res=0 errno=0 inptr+=1 inbytesleft=0 outptr+=1 outbytesleft=99
> > res=0 errno=EILSEQ inptr+=0 inbytesleft=1 outptr+=0 outbytesleft=100
> > res=0 errno=EILSEQ inptr+=1 inbytesleft=1 outptr+=1 outbytesleft=99
>
> Are you now suggesting that iconv should return (iconv_t)-1 only when
> the cd argument is invalid or when (!inbuf || !*inbuf) && outbuf &&
> *outbuf && (outbytesleft < length_of_reset_sequence)?
In my mail, I was suggesting that a return value of (size_t)(-1) is returned
only with errno = EBADF, not with any of EILSEQ, EINVAL, E2BIG.
I've submitted a clarification request to the OpenGroup guys. For the moment,
as long as they haven't clarified, libiconv and glibc's iconv continue to
return -1 whenever they set errno.
Bruno