Re: GUID on Linux
From: Jake Waskett (chilliesmad_at_hotmail.com)
Date: 03/14/04
- Next message: Mike Cox: "Case Study: Migrating drivers from Linux to a Micro-Kernel OS."
- Previous message: Christopher Browne: "Re: GUID on Linux"
- In reply to: Armel Asselin: "Re: GUID on Linux"
- Next in thread: Carlos Moreno: "Re: GUID on Linux"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 13 Mar 2004 23:24:42 +0000
Armel Asselin wrote:
> I have another question now: should I use "libuuid" (or a port of it) on
> Windows too ? or will the GUID of Windows CoCreateGuid and those of
> "libuuid" be "compatible" enough so that I am sure that they won't
> generate colliding IDs ?
>
> Armel
Well a UUID is a UUID. They both implement the DCE specification, so you
shouldn't get a collision. If I were you, I'd use CoCreateGuid on Windows
and libuuid on Linux, but write your own little abstraction layer to hide
the differences.
There is of course a remote chance of a collision anyway, but it's
sufficiently improbable that you shouldn't need to worry about it.
Reading elsewhere in this thread, what you need to do to GUARANTEE
uniqueness is the following: combine a unique machine identifier (such as
ethernet address, assigned as a configuration setting, etc) and a
locally-generated sequence number (32 or 64 bits should do it). You should
be able to get the database you're using to generate the sequence number
itself.
Regards,
Jake.
>
> "Jake Waskett" <chilliesmad@hotmail.com> a écrit dans le message de
> news:oPJ4c.344$V11.333@news-binary.blueyonder.co.uk...
>> Armel Asselin wrote:
>>
>> > Hello,
>> >
>> > I am searching a function on Linux (C/C++) which actually generates a
>> > globally unique identifier (GUID) as CoCreateGuid does on Windows ???
>> >
>> > Thx,
>> > Armel
>>
>> Try "man libuuid", part of e2fsprogs. It should do what you need I think.
>>
>> Regards,
>> Jake.
- Next message: Mike Cox: "Case Study: Migrating drivers from Linux to a Micro-Kernel OS."
- Previous message: Christopher Browne: "Re: GUID on Linux"
- In reply to: Armel Asselin: "Re: GUID on Linux"
- Next in thread: Carlos Moreno: "Re: GUID on Linux"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|