[M3devel] unused/little used stuff in m3core/unix?
Olaf Wagner
wagner at elegosoft.com
Fri Apr 16 13:09:06 CEST 2010
Quoting Jay K <jay.krell at cornell.edu>:
> Ok on preserving most/all of these but note I'm not keen on
> preserving like anything dealing with structs or time_t.
>
> There are various arguments for/against.
>
> This "systems" language interoperates well with C, directly, IF you
> control the C.
>
> Thus we have wrappers. We almost never interface directly with "the OS".
>
> Then again, same is true of C. Actual "kernels" have custom
> calling mechanisms, which gets wrapped in C.
>
> I'm not sure we should provide a general set of wrappers, or leave
> it to each user to write his own,
> or provide some simple small set. Leaving it to each user is error
> prone, granted.
>
> The historical implementation here was awful and *really* *not* the way.
>
> The question then is what should the implementation be.
One more or less POSIXish API within m3core would be OK with me.
It even needs not be complete, but I'd expect some well-known
standard functions there. Of course this doesn't answer the question
what should be included and what not.
Olaf
>> Date: Mon, 12 Apr 2010 10:12:12 +0200
>> From: wagner at elegosoft.com
>> To: m3devel at elegosoft.com
>> Subject: Re: [M3devel] unused/little used stuff in m3core/unix?
>>
>> Quoting Jay K <jay.krell at cornell.edu>:
>>
>> > Following are not used:
>> >
>> > fchmod
>> > fchown
>> > getpagesize
>> > sbrk
>> > creat
>> > isatty
>> >
>> > That isn't necessarily all.
>> >
>> > Some are used only in:
>> >
>> > C:\dev2\cm3.2\m3-libs\libm3\src\os\POSIX
>> > e.g.
>> > chdir
>> > getdtablesize
>> > execve
>> >
>> > Some are used only in the unused m3-pkgtools directory or by cvsup.
>> > e.g. umask
>> >
>> > These all traffic in pretty "plain" types (e.g. no structs, no
>> > time_t). So just keep them all?
>>
>> Yes. These are standard POSIX or Unix legacy interfaces.
>> Do not throw them out.
>>
>> > Note of course, uses of these somewhat or significantly inhibit
>> > porting to native Win32.
>>
>> As these are POSIX, that is to be expected.
>>
>> > Account for somewhat arbirary Posix-specific code outside the cm3 tree
>> > and err toward wrapping stuff that is easy?
>> >
>> > Or push the idea that m3core/libm3 are a good (and safe) portability
>> > layer and only provide what they need, and
>> > gradually move them towards C to reduce their needs?
>>
>> As a systems programming language, we should support standard OS
>> interfaces IMO.
>>
>> Olaf
--
Olaf Wagner -- elego Software Solutions GmbH
Gustav-Meyer-Allee 25 / Gebäude 12, 13355 Berlin, Germany
phone: +49 30 23 45 86 96 mobile: +49 177 2345 869 fax: +49 30 23 45 86 95
http://www.elegosoft.com | Geschäftsführer: Olaf Wagner | Sitz: Berlin
Handelregister: Amtsgericht Charlottenburg HRB 77719 | USt-IdNr: DE163214194
More information about the M3devel
mailing list