Thread View: pl.comp.os.linux.programowanie
2 messages
2 total messages
Started by Daniel Mróz
Sun, 19 Sep 1999 18:54
stat.st_{r}dev
Author: Daniel Mróz
Date: Sun, 19 Sep 1999 18:54
Date: Sun, 19 Sep 1999 18:54
16 lines
1244 bytes
1244 bytes
Czesc Takie glupie pytanie: co przechowuja pola st_dev i st_rdev w struk- turze stat? Co to jest `Device ID' (st_dev)? Ewentualnie, gdzie mozna o tym poczytac (szukalem w `man 2 stat' i `info libc'). Co to jest `Device ID' (st_dev)? Pozdrawiam Beorn -- ---------------------------------------------------------------------- Daniel 'Beorn' Mróz beorn@alpha.pl ----------------------------------ooo^..^ooo--------------------------
Re: stat.st_{r}dev
Author: Cezary H. Noweta
Date: Mon, 20 Sep 1999 14:37
Date: Mon, 20 Sep 1999 14:37
30 lines
2140 bytes
2140 bytes
Witam,
"Daniel Mróz" wrote:
> Takie glupie pytanie: co przechowuja pola st_dev i st_rdev w struk-
> turze stat? Co to jest `Device ID' (st_dev)? Ewentualnie, gdzie mozna
> o tym poczytac (szukalem w `man 2 stat' i `info libc'). Co to jest
> `Device ID' (st_dev)?
st_dev i st_rdev to 64-bitowe unsigned postaci major_dev_num * 0x0100 +
+ minor_dev_num. st_dev to numer urzadzenia, na ktorym znajduje sie
inod (plik). st_rdev to numer urzadzenia jesli podanym plikiem jest
nazwa urzadzenia, tzn.:
(a) stat("/root/jakisplik",...) zwraca st_dev == 0x0301 (jesli
/root/jakisplik znajduje sie na /dev/hda1) i st_rdev == 0,
(b) stat("/dev/tty4",...) zwraca st_dev == 0x0301 (jesli inod jest
na /dev/hda1) i st_rdev == 0x0404 (bo inod jest typu urzadzenie).
dev | major_num | minor_num
------+-----------+----------
hda1 | 3 | 1
tty4 | 4 | 4
Numery urzadzen sa w zrodlach jadra w Documentation/devices.txt
-- pozdrawiam
--
Cezary H. Noweta 90-237 LODZ, ul. J.Matejki 34/38 POLAND
(chn@irys.usun.drugiitrzeciczlon.uni.lodz.pl) +48 42 6356013, 6356012
University of Lodz - Main Library fax 6781678
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads