Ticket #379 (closed RFC: wontfix)

Opened 13 years ago

Last modified 11 years ago

Generate POSIX errno Constants

Reported by: chromatic Owned by: whiteknight
Priority: normal Milestone:
Component: configure Version:
Severity: medium Keywords:
Cc: jkeenan Language:
Patch status: Platform: all

Description

There's no easy way in Parrot right now to refer to EPERM, EAGAIN, EINTR, and other POSIX errno constants as constants (see the err i, i opcode, for example). The ability to do so would help us write more portable code that doesn't rely on hard-coded magic numbers or the hope of matching against the output of strerror().

It would be trivial to write a short configuration-process file which runs a C program to generate a PASM file with these values. It's a quick task to do, but connecting it to the right place in the configuration process might be a little trickier.

Change History

in reply to: ↑ description   Changed 12 years ago by jkeenan

Replying to chromatic:

> 
> It would be trivial to write a short configuration-process file 
> which runs a C program to generate a PASM file with these values.  
> It's a quick task to do, but connecting it to the right place in 
> the configuration process might be a little trickier.

Well, apparently it wasn't trivial or quick enough for anyone to pick up this ticket in the past 10 months. :-(

chromatic, could you provide suggestions?

Thank you very much.
kid51

  Changed 12 years ago by jkeenan

  • cc jkeenan added

  Changed 11 years ago by whiteknight

  • owner set to whiteknight
  • type changed from feature to RFC

A better question, I think, is whether we want the err family of opcodes in Parrot, and whether or not we should be insulating our users from those kinds of details. I suggest instead that we deprecate the err opcodes, and not be passing errno values to PIR users. When something goes wrong, Parrot can take those errno conditions and turn them into exceptions with the error message and maybe even the errno value included.

  Changed 11 years ago by nwellnhof

+1. Since we want to support non-POSIX systems like Windows, we shouldn't expose errno at all.

  Changed 11 years ago by cotto

  • status changed from new to closed
  • resolution set to wontfix

POSIX errno values should be exposed only indirectly through exceptions or other more generic mechanisms that will work on all platforms. I'm marking this as wontfix.

Note: See TracTickets for help on using tickets.