<i id='s39vh'></i>

<span id='s39vh'></span><ins id='s39vh'></ins>
    <dl id='s39vh'></dl>
    <acronym id='s39vh'><em id='s39vh'></em><td id='s39vh'><div id='s39vh'></div></td></acronym><address id='s39vh'><big id='s39vh'><big id='s39vh'></big><legend id='s39vh'></legend></big></address>

  1. <tr id='s39vh'><strong id='s39vh'></strong><small id='s39vh'></small><button id='s39vh'></button><li id='s39vh'><noscript id='s39vh'><big id='s39vh'></big><dt id='s39vh'></dt></noscript></li></tr><ol id='s39vh'><table id='s39vh'><blockquote id='s39vh'><tbody id='s39vh'></tbody></blockquote></table></ol><u id='s39vh'></u><kbd id='s39vh'><kbd id='s39vh'></kbd></kbd>
      1. <i id='s39vh'><div id='s39vh'><ins id='s39vh'></ins></div></i>
      2. <fieldset id='s39vh'></fieldset>

        <code id='s39vh'><strong id='s39vh'></strong></code>

        1. Linux下取得UUID的方法分享

          • 时间:
          • 浏览:38
          • 来源:124软件资讯网

              HP和RedHat上可以使用uuidgen来天生,solaris上下令:makeuuid

              怎样通过C++编程取得UUID?

              1.安装libuuid库, libuuid.so.1包容在e2fsprogs里,本人的系统为RedHat7.3,下载ftp://194.199.20.114/linux/redhat/7.3/en/os/i386/RedHat/RPMS/e2fsprogs-1.27-3.i386.rpm

              2. 编辑文件uuid.cpp

              复制代码

              代码如下:

              #include ;

              #include ;

              #include ;

              int main()

              {

              uuid_t uu;

              uuid_generate( uu );

              std::cout << uu << std::endl;

              int i;

              for(i=0;i<16;i++)

              {

              printf("%x ",uu);

              }

              printf("\n");

              return 0;

              }

              #g++ -c –g uuid.o uuid.cpp

              #g++ -o –luuid uuid uuid.o

              其中/usr/include/uuid/uuid.h中有uuid_t的界说:

              typedef unsigned char uuid_t[16];