Subject: [Solaris] archivers/macutil needs not-minor patch for Solaris
To: None <tech-pkg@netbsd.org>
From: Ignatios Souvatzis <ignatios@theory.cs.uni-bonn.de>
List: tech-pkg
Date: 01/21/2003 17:01:18
--3hAdtgBjtgL7p0NQ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi,

I've tried to quickly compile and install macutil. However, this doesn't
compile and can't easily be fixed because one utility function,
util/transname.c:transname() needs the maximum host file name length.=20

However, on Solaris, there is no such constant in any header files:

/*
 * POSIX 1003.1a, section 2.9.5, table 2-5 contains [NAME_MAX] and the
 * related text states:
 *
 * A definition of one of the values from Table 2-5 shall be omitted from t=
he
 * <limits.h> on specific implementations where the corresponding value is
 * equal to or greater than the stated minimum, but where the value can vary
 * depending on the file to which it is applied. The actual value supported=
 for
 * a specific pathname shall be provided by the pathconf() (5.7.1) function.
 *
 * This is clear that any machine supporting multiple file system types
 * and/or a network can not include this define, regardless of protection
 * by the _POSIX_SOURCE and _POSIX_C_SOURCE flags.
 *
 * #define      NAME_MAX        14
 */

Ok, fine with me, I thought, I'll rewrite it to use that. Unfortunately,
pathconf() needs the full pathname (or an open file descriptor) in order
to know the file system's limits, and transname() doesn't get that from
its callers (there are several).

There are three options:

1. NOT_FOR_PLATFORM=3D      SunOS-*-*

2. use _POSIX_NAME_MAX (14) - and even might be considered too big on Solar=
is,
   if your destination is on a old-style-MSDOS mounted floppy

3. redesign the macutil utilities to pass the full path name in all places
   to pass a reasonable full path and thus get the real limit from pathconf=
()
   inside transname().

Opinions?

Regards,
	Ignatios

--3hAdtgBjtgL7p0NQ
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: 2.6.i

iQEVAgUBPi1uxDCn4om+4LhpAQHnrgf9F1bqHaXUDOZbD+89vCmbR+VaOd9B9n04
/MEv5eChrJkQvdJX2fG33b8rp6UMTioIw1qdQgXAWm3+c5OjO8xX6Sy6dIbw2Hdj
vV8I8ZMReGNm3OOmAGOPcdB3aF00wRSl0SJ6Ts8dqpQ2qk7QKcnDVkv/gjYAPVMi
tbRx6y0lFuodlCN6sc1QqzwSjxmrGj0DEPd6+nXsZQGpHvhpoAk/d3htq/7v+QQ5
JuvsBMvdPNRPigRJaZBkIaPhN7xBsFZj0Kw57+0EpSdZohACJ3BROg/wsh4DjQ4F
WsHM27/pGtAwu5swfG5vxq6BrL391Kq2ZMXi5EETmko1k/e9/l1R9g==
=gwoI
-----END PGP SIGNATURE-----

--3hAdtgBjtgL7p0NQ--