This is the mail archive of the libc-alpha@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: iconv(3) return value


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]