Re: [AD] No more END_OF_MAIN on *nix! |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On Monday 02 August 2004 18:03, Eric Botcazou wrote:
> Hum... procfs is a Linux-ism.
Both commercial versions of UNIX I have tested (Solaris and... some Alpha
variant) have procfs. Granted, it's not a Linux-compatible procfs in that
it doesn't have a /proc/pid/exe symlink, but there is a programming API
that a program can use to querry procfs. Afterall, ps has to convert a PID
to an executable filename or programname somehow.
> And invoking an external program is IMHO both
> dangerous (what happens if 'ps' is not there?)
I think this is a case that is of academic interest only. I'm not even sure
there are not things that require ps to be available higher up the chain
than Allegro programs.
The current code would just fail to open the pipe and return with an error.
> and expensive.
Negligible too in this case. Besides, we're not going to call
get_executable_name() from within a time-critical tight loop anyway.
> I think that adding OS-specific methods is fine, but you can't get rid of
> the portable method until all major Unices are covered.
Agreed.
I tried digging up some information on using the C procfs API I'll let you
know what I dig up.
Evert