[Mono-dev] [RFC 5/8] io-layer: Define makedev for Haiku

Andreas Färber andreas.faerber at web.de
Fri Apr 2 13:18:09 EDT 2010


Hey guys,

First, Haiku has the POSIX dev_t type declared in sys/types.h:
http://www.opengroup.org/onlinepubs/9699919799/basedefs/sys_types.h.html

Linux, BSDs, Solaris, OSX all seem to have a makedev macro or function  
to construct the final dev_t value from major and minor values (and  
major and minor macros/functions to obtain the individual values  
again). The stub implementation below is from FreeBSD iirc, OSX uses a  
different shift.

Should some implementation be added to Haiku?

Second, the use of makedev here comes from trying to parse a dev_t  
value from a string in a /proc/*/map[s] file [1], in load_modules [2].  
Apparently Haiku does not have /proc at all.
On Mac OS X, Mono uses _dyld_get_image_* functions instead [3].

What could I use on Haiku to enumerate process modules, from C code?

Thanks,
Andreas

[1] http://anonsvn.mono-project.com/viewvc/trunk/mono/mono/io-layer/processes.c?revision=153208#l2018
[2] http://anonsvn.mono-project.com/viewvc/trunk/mono/mono/io-layer/processes.c?revision=153208#l1868
[3] http://anonsvn.mono-project.com/viewvc/trunk/mono/mono/io-layer/processes.c?revision=153208#l1824

Am 02.04.2010 um 03:10 schrieb Zoltan Varga:

> Looks ok.
>
>         Zoltan
>
> On Thu, Apr 1, 2010 at 2:27 AM, Andreas Färber  
> <andreas.faerber at web.de> wrote:
> This commit is licensed under the MIT X11 license.
> ---
>  mono/io-layer/processes.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/mono/io-layer/processes.c b/mono/io-layer/processes.c
> index b591716..e8f13ef 100644
> --- a/mono/io-layer/processes.c
> +++ b/mono/io-layer/processes.c
> @@ -29,6 +29,9 @@
>  #ifdef HAVE_SYS_MKDEV_H
>  #include <sys/mkdev.h>
>  #endif
> +#ifdef __HAIKU__
> +#define makedev(maj,min) (((maj) << 8) | (min))
> +#endif
>
>  /* sys/resource.h (for rusage) is required when using osx 10.3 (but  
> not 10.4) */
>  #ifdef __APPLE__
> --
> 1.7.0.3
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list



More information about the Mono-devel-list mailing list