From owner-freebsd-current Mon Jun 1 09:31:03 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id JAA07189 for freebsd-current-outgoing; Mon, 1 Jun 1998 09:31:03 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from mailhub.fokus.gmd.de (mailhub.fokus.gmd.de [193.175.134.209]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id JAA07175 for ; Mon, 1 Jun 1998 09:30:56 -0700 (PDT) (envelope-from schilling@fokus.gmd.de) Received: from sherwood.gmd.de (sherwood [193.175.133.102]) by mailhub.fokus.gmd.de (8.8.8/8.8.8) with ESMTP id SAA27122; Mon, 1 Jun 1998 18:30:39 +0200 (MET DST) Received: (from jes@localhost) by sherwood.gmd.de (8.8.8+Sun/8.8.8) id SAA17075; Mon, 1 Jun 1998 18:30:15 +0200 (MET DST) Date: Mon, 1 Jun 1998 18:30:15 +0200 (MET DST) From: Joerg Schilling Message-Id: <199806011630.SAA17075@sherwood.gmd.de> To: mike@smith.net.au, schilling@fokus.gmd.de Cc: freebsd-current@FreeBSD.ORG Subject: Re: cdrecord trouble on currnet Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >From mike@antipodes.cdrom.com Mon Jun 1 18:17:40 1998 >> You cannot deal with this problem: >> = >> Systems that define _SC_PAGESIZE or _SC_PAGE_SIZE (HP-UX) >> don't support getpagesize() so there is no way to fix this >> in runtime except if you introduce an additional = >> = >> HAVE_GETPAGESIZE >> = >> in the autoconfiguration. >> = >> But even then the code would be badly readable. = >This is a problem with the design of cdrecord, insofar as it's fairly Sorry, this is a problem for evryone who wants to write portable code. But FreeBSD seems to ignore this issue. You may have a functional sysconf(_SC_PAGESIZE) _and_ getpagesize() if you like to be able to run portable applications but you cannot have a non functional sysconf(_SC_PAGESIZE). This looks to me like Microsofts tried to create a Posix environment that is Posix compliant on the paper but would prevent you from running real world Posix applications on it. >clear it wasn't designed for portability. Probably the most expedient >move would be not to pretend that cdrecord is compliant with the default >POSIX API on FreeBSD for now, and wind back the presented API to one >that it is. That's what _POSIX_VERSION is all about. Right, when I started to write cdrecord, I thought that it would only run on SunOS 4.x and SunOS 5.x but now it is one of the most portable application that I made. >Thanks for the HP-UX pointer; I'll take note that _SC_PAGESIZE is = >implicitly assumed to mean DONT_HAVE_GETPAGESIZE. >> I would prefer if the sysconf code would call getpagesize() in userland= >=2E >This would defeat the entire purpose of sysconf(), which is to pass = >opaque constants to the kernel. I don't see any merit in hacking a = You should read the Posix standard: The POSIX standard does not describe the behaviour of a kernel interface but the interface of callbable functions in the c-library. >perfectly compliant interface to deal with (pardon my saying it) buggy = >applications. I would call a sysconf implementation that is not functional for sysconf(_SC_PAGESIZE) although getpagesize() exists buggy. Jörg EMail:joerg@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin js@cs.tu-berlin.de (uni) If you don't have iso-8859-1 schilling@fokus.gmd.de (work) chars I am J"org Schilling URL: http://www.fokus.gmd.de/usr/schilling ftp://ftp.fokus.gmd.de/pub/unix To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message