Proper way to define new error in errno? trying to port GNU tar

9 views
Skip to first unread message

leith

unread,
Dec 30, 2009, 12:00:22 PM12/30/09
to minix3
I looked on the "wishlist" and saw that a GNU/BSD tar utility was on
there. So I grabbed GNU tar-1.2.2 and started going through the
motions. One issue I ran into was that, in a couple of files, it was
using EILSEQ as an Illegal Sequence error. However, I could not find
that defined in any Minix headers.

What is the recommended way to deal with this? Update errno.h?

As a temporary hack, I defined it in the files that were complaining
about it, but I don't consider that a good hack.

However, fixing that and a couple of other things...it compiled. I'm
still testing it. Pending the answer to this, I will submit it as a
new package.

Thanks.

Antoine Leca

unread,
Dec 30, 2009, 12:28:57 PM12/30/09
to min...@googlegroups.com
leith wrote:
> One issue I ran into was that, in a couple of files, it was
> using EILSEQ as an Illegal Sequence error. However, I could not find
> that defined in any Minix headers.

FYI: EILSEQ is an invention of the C committee (in 1994), it annonces
the occurrence of an encoding error in a multi-byte character decoding
(like for example an illegal value for a byte inside a non-ASCII UTF-8
character); since Minix does not deal at all with more-than-one-byte
characters, it cannot be emitted by any function of the standard library
(most of the related ones, e.g. mbrtowc(), do not even exist.)


> As a temporary hack, I defined it in the files that were complaining
> about it, but I don't consider that a good hack.

However, it might be a good solution!

Another possibility (that I often use for "traditional" signals which
are not defined on my platform, like SIGEMT, but are trapped by code
ported) could be to surround the lines where it is used with #ifdef

if (errno == ERANGE || errno == EDOM
#ifdef EILSEQ
|| errno == EILSEQ
#endif
) die_in_flames("...

I do not know if this is an official recommendation, or even if it is a
better or worse hack, yet I am happy with this, since I believe it
breaks the lowest number of things.


On the long term, adding EILSEQ to <errno.h> is probably the way to go.


Antoine

Leith Brandeland

unread,
Dec 30, 2009, 1:35:48 PM12/30/09
to min...@googlegroups.com
Attached is a patch to add the EILSEQ to errno.h.  If that isn't the preferred way to do it, someone please let me know.

I just picked a value that wasn't being used.

Thanks.


--

You received this message because you are subscribed to the Google Groups "minix3" group.
To post to this group, send email to min...@googlegroups.com.
To unsubscribe from this group, send email to minix3+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/minix3?hl=en.



errno.h.patch

Erik van der Kouwe

unread,
Dec 30, 2009, 3:53:36 PM12/30/09
to minix3
Hi,

Base your choice on whether the constant aught to be there. Some
programs use Linux-specific stuff and that is unwanted in MINIX.
However, POSIX standardized declarations aught to be in MINIX too.

The way to check this is to go to the Open Group website. Here one can
see that EILSEQ aught to be there:
http://www.opengroup.org/onlinepubs/000095399/basedefs/errno.h.html

Given that it aught to be there, you can modify the header file in the
MINIX source tree (be sure to use the latest SVN trunk) and post a
patch here. Justify the change by pointing to the standard.

With kind regards,
Erik

Moritz Wilhelmy

unread,
Jan 6, 2010, 4:48:37 AM1/6/10
to min...@googlegroups.com
Hi,

apropos multibyte characters, is there support (or at least planned)
for Unicode in Minix, and what is the state of it's implementation?

Kind Regards,
Moritz


2009/12/30 Erik van der Kouwe <eri...@gmail.com>:

D.C. van Moolenbroek

unread,
Jan 6, 2010, 5:15:45 AM1/6/10
to minix3
> apropos multibyte characters, is there support (or at least planned)
> for Unicode in Minix, and what is the state of it's[sic] implementation?

No and none.

Regards,
David

Reply all
Reply to author
Forward
0 new messages