Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 Jan 1996 16:32:47 +1100
From:      Bruce Evans <bde@zeta.org.au>
To:        joerg_wunsch@uriah.heep.sax.de, wollman@lcs.mit.edu
Cc:        freebsd-current@FreeBSD.org
Subject:   Re: minor change to ls -l
Message-ID:  <199601020532.QAA00370@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>The question for me is: will mknod(8) accept a minor number in hex?

No.  mknod uses atoi() to (mis)interpret its numeric args.  It can't
even handle an arg of 2^31 = 2147483648, since atoi() returns LONG_MAX =
2147483648 for too-large args and no attempt is made to check for
errors.  (It's not possible to check for errors in a standard way
because the behaviour of atoi() when the result can't be represented is
undefined, but FreeBSD's atoi() is equivalent to (int)strtol(), so
checking errno works iff sizeof(int) == sizeof(long).)

>If not, and you plan to stick with this change, then you need to
>change mknod as well.

It's not necessary, just useful.  atoi should accept numbers in all
bases.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199601020532.QAA00370>