From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/14301 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Michael Forney Newsgroups: gmane.linux.lib.musl.general Subject: Re: Removing sys/sysmacros.h from sys/types.h Date: Sat, 29 Jun 2019 15:11:23 -0700 Message-ID: References: <20190614211502.GJ1506@brightrain.aerifal.cx> <20190629214156.GM1506@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="264199"; mail-complaints-to="usenet@blaine.gmane.org" To: musl@lists.openwall.com Original-X-From: musl-return-14317-gllmg-musl=m.gmane.org@lists.openwall.com Sun Jun 30 00:11:40 2019 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.89) (envelope-from ) id 1hhLZL-0016c3-SK for gllmg-musl@m.gmane.org; Sun, 30 Jun 2019 00:11:39 +0200 Original-Received: (qmail 7333 invoked by uid 550); 29 Jun 2019 22:11:36 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 7290 invoked from network); 29 Jun 2019 22:11:36 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mforney-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=zHD9BiiNNhGEHIz1uQ6V13/qjvW4K5cZo4NO1aa2d0w=; b=cuAalkEfwcTBWVXKBlxMZobxyLiayvx1xj0A71FH8aFOxiZL10V230naxoUB3n8s1d fsR6ufWpA7dlx8JM8/7CdjtdjzdCoTZoYT45qotj3edurBIkcJSkYnrY6bKdThUHYJWH 2IgJKL+AqyXYwxvrUWT0YhTMyBbqSmX2SF03xBTwlCFvXChEBEe02wrugTDDwqH8ksA2 LPwXltKsKe+cV9mx0wd0iA/kwQb4naFMKVUVZZ6jUq/viVFne5YyWAhFjDaPfeOcaItr gWf/RzYMkCAN226usZER1ZaXuIxtHiJqx71rg/i/xoYUIzxwGT58sFb72kAKWrJ/5ale DqaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=zHD9BiiNNhGEHIz1uQ6V13/qjvW4K5cZo4NO1aa2d0w=; b=Lc5VQcfVZCH8cXjyqcyiaqU+cGvSJEXBqjJFS9diXHuVQvBS8UfGtW/JMVSiZeU7P5 tcDGUN3SvVe6LgHR+lX7dyTW0nzyulF9oj3dDPvxYA5ReYtBl5ostnIRv4TKLXiVo6i+ S59hQH2DVsZkaanTbic952LK2dvjSu0hnobDvLUjJdtCgVZfPw0eb2WRfnm8hg/xCzj5 /jMg0dCHj5AsJb+Lu70q1nNW7+Z/+yyGikNRee2u2NvClkOjjDFLex2X3Syowwj2wJlA t8I6kLTlR6zI2m0737rh13IGs6e8NkVPhzhvxKZbEffIM0FJY2isiip1EK7Pml7fTy0H Uv/w== X-Gm-Message-State: APjAAAVFdriBhUTlghMfaDOp6dcc1WKWgMT/2C7Z165Pb87GDWxSJxbN CtqmEnCj2U7GZ30B3tDNwhGeZlGvQgPUp2GtQIuLTGJw X-Google-Smtp-Source: APXvYqx6qS3cC3tzvRQvSafVkqsTkj6IO4RoCGFvB6FheHP2BVOLnfCISObvGg8aziAlF0149NFLzZKrSUGrMHd5VCM= X-Received: by 2002:a25:d3c8:: with SMTP id e191mr11151195ybf.66.1561846283570; Sat, 29 Jun 2019 15:11:23 -0700 (PDT) X-Originating-IP: [2601:647:5180:35d7::cf52] In-Reply-To: <20190629214156.GM1506@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:14301 Archived-At: On 2019-06-29, Rich Felker wrote: >> I'm just curious if there is a good way to use these macros in >> software that is otherwise portable without adding a configure script. >> Most BSDs don't have sys/sysmacros.h, and now glibc and musl require >> including sys/sysmacros.h to use them. >> >> It's a shame that while these macros are available on most unix-like >> operating systems, they can't be accessed in a generic way. > > There's really not much of a use for them at all in portable software. > Devices having "major/minor numbers", rather than dev_t just being an > abstract identifier, is an anachronism that's not really compatible > with exploding numbers of device types or operating systems that don't > expose any idea of a type/major. > > If you really do need them, you should probably just search for them > with a configure check, first for sys/sysmacros.h, then for any other > historical places they might have been found in. The case I'm interested in is implementing ls(1), which needs a way to display the dev_t in a human readable way, and tar(1) since the ustar format stores devmajor and devminor separately. But anyway, I guess adding a configure script is the only reliable way to use them. I wonder if any of the BSDs would consider adding sys/sysmacros.h... Thanks for your input.