Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Jun 1998 18:30:15 +0200 (MET DST)
From:      Joerg Schilling <schilling@fokus.gmd.de>
To:        mike@smith.net.au, schilling@fokus.gmd.de
Cc:        freebsd-current@FreeBSD.ORG
Subject:   Re: cdrecord trouble on currnet
Message-ID:  <199806011630.SAA17075@sherwood.gmd.de>

next in thread | raw e-mail | index | archive | help
>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



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