delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2003/09/25/12:16:08

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: Ben Peddell <killer DOT lightspeed AT bigpond DOT com>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020826
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: Re: howto get "Volume Seial Number"
References: <bks80d$com$1 AT caraway DOT media DOT kyoto-u DOT ac DOT jp>
Lines: 40
Message-ID: <XsEcb.122816$bo1.26188@news-server.bigpond.net.au>
Date: Thu, 25 Sep 2003 16:11:35 GMT
NNTP-Posting-Host: 144.134.89.159
X-Complaints-To: abuse AT bigpond DOT net DOT au
X-Trace: news-server.bigpond.net.au 1064506295 144.134.89.159 (Fri, 26 Sep 2003 02:11:35 EST)
NNTP-Posting-Date: Fri, 26 Sep 2003 02:11:35 EST
Organization: BigPond Internet Services
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

H.Shiozaki wrote:
> Please someone help me!
> I want to get "volume Serial Number" 
> from C: and cuurent drive:
> in conditin on [Win98 + DJGPP-2.03] at least.
> ---
> Is there "Volume Serial Number" term(consept?) in
> Linux, and FreeBSD environment?
> If so, I want "Volume Serial Number" from C-User-Application program.
> 
> Regards
> - - - - -
> FM: H.Shiozaki
> E-Mail: sios_hs AT yahoo DOT co DOT jp
> 

Sorry, the Serial Number (UUID - Universally Unique ID) is a
filesystem-dependant construct on GNU/Linux. It is not understood by the
kernel, so you need either a library call or a custom function to get it.

DOS actually supports the Volume Serial Number through an IOCTL call or
through a `kernel' call.

The IOCTL is:

#include <sys/ioctl.h>

struct drvinfo {
    short infolev;
    long sernum;
    char label[11];
    char type[8];
} drvinfo;
int status;
drvinfo.infolev = 0;
status = ioctl (driveno, DOS_GENBLKREQ, 0x0866, &drvinfo, 0, 0, 25);

It's somewhat harder to use the `kernel' call, since DJGPP does not
actually support it.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019