(/). :
qnx/fsys
company/xyz
/company/xyz

Note: , .

, , ( nameloc). .

. . , , , .

, qnx_name_attach(). , qnx_name_locate().

QNX , . (UTC) 0 , 0 , 0 , 1 1970 . , TZ ( ).

, . sleep; sleep(). delay(), .

, , . POSIX Std 1003.4/Draft 9.

. . , ( Proc ). timer_create().

:

, . , , 9 . , 5 .

. :

: :
timer_settime()

, timer_delete().

ticksize qnx_timerperiod(). 500 50 .

, , timer_gettime().

- .

QNX (, ), , .

:

( ). , . , , .
: :
qnx_hint_attach()
qnx_hint_detach()

, . , ticksize.

, 50 , tick size. POSIX 1003.4 .

/

:

/

/ (I/O, Input/Output) QNX . / . QNX , ( ) , .

QNX . , - /, , , (.. ). , QNX.

/

, , open() /. , (Dev) /dev. open() /dev/xxx, /dev open() Dev ( ).

. . , , :
/ (Fsys)
/dev (Dev)
/dev/hd0 (Fsys)

, QNX (.. /) - , (.. /dev/hd0). . .
: : :
/dev/con1 /dev Dev
/dev/hd0 /dev/hd0 Fsys
/usr/dtdodge/test /Fsys

, , :

prefix=pid,unit:prefix=pid,unit:prefix=pid,unit

pid - ID I/O, unit - , , . , Fsys 3 Dev 5, :

/dev/hd0=3,a:/dev=5,a:/=3,e
: :
prefix
qnx_prefix_query()

QNX , . , . , . , QNX :
/dev/ser1
//10/dev/ser1 10
//0/dev/ser1
//20/usr/dtdodge/test 20

, //0

, , . , :

//5 ls /

ls 5, , :

ls /

. "/" , 5. , , , "/" 5, : !

, , , , ("/"). , , . , //9, :

/usr/home/luc

, :

//9/usr/home/luc

, " /usr/home/luc, 9- ".

, . , , 9, , 9 ( ). :

ls /

//9, :

ls //9/

, :

//5 ls /

ls 5, - //9, ls //9/. .
: :
qnx_prefix_getroot()
qnx_prefix_setroot()
on

, , . , - , .

, (, ), , . , ( ///), .

, I/O. , . :

prefix=-

, , ( , "/"). , (, 10), "/". :

/=//10/

, (/) //10/. , /usr/dtdodge/test :

//10/usr/dtdodge/test

; 10 , .. //10. 10, , , open(). .

, . :

/dev=5,a:/=//10/

, /dev, , , .

. , 20, :

/dev/printer=//20/dev/spool

/dev/printer . , , 20 :

/dev/fd0=//20/dev/fd0

, :

//20/dev/spool //20/dev/fd0

. . QNX . .

, , , .

( ), . , , .

, :

cd //18/

() 18, , . cd dev, //18/dev.

, :

cd /

, . , //9, , cd dev, //9/dev. , .

, . (///) , , , ( ). , , (.. ) .

cd

UNIX cd ( ) , . , - pwd, , cd.

QNX, , cd - "..". :

cd /usr/home/luc/test/../doc

/usr/home/luc/doc, .

" ".


Note: , fullpath.

I/O, open() , (FD), , I/O . ( Sendfd().)

, , . PID FD, , open(). (OCB open control block) I/O.

, I/O OCB PID FD.


fig: i/pidfdocb.gif


PID FD OCB /.


OCB . , . open() OCB. , , lseek(), FD, FD.

, .

, , . FD.


fig: i/tmpfile.gif


A /tmp/file . B .


OCB. :

FD OCB, OCB , , OCB.

, lseek() , , , .

, , dup(), . , .


fig: i/dupfd.gif


, FD dup(). .


spawn() exec(), fcntl() FD_CLOEXEC.

:

(Fsys) . Fsys , , .

?

QNX - , , , . QNX ; Fsys:

. - - - .

Fsys . :

, inode ( ) . inode " (inodes)". , ID . :

ID ID , . , , setuid ( ID ) setgid ( ID ).

QNX . .

. - , ( " ").

- , . . - , . ( " (inodes)" " ").

, /usr/bill/file2.


fig: i/dirpath.gif


QNX /usr/bill/file2.


, , . , link().

, POSIX, . :

QNX - , "" , open() read(). - .

QNX . - .

, , . , , ( - / ). 60 .


fig: i/extents.gif


, , QNX .




, , . , .

" ". , /.bitmap ( " QNX"). . .

(inodes)

QNX . . : , "", . .

, , . , inode ( ).

(.. ), inode . , inode /.inodes, inode.

, , .


fig: i/twolinks.gif


"more" "less".

, /.inodes:

: :
ln
link()

, , . ; . , , , . , .
: :
rm
remove() unlink()

. :

"" ; " " , .

, " " "/" - "/", - .

- , . / - , open(), - "". . , .

//1/usr/fred //2/usr/barney , , ( ). :

//1/usr/fred --> //2/usr/barney

, . . , :

//1/usr/eric/src/test.c --> //1/usr/src/game.c

Figure showing two nodes using symbolic links
: :
ln ( -s)
* rm
, ls

* , ,

. . unlink() ( ), lstat() readlink().

, , , . , ; SYMLOOP_MAX <limits.h>.

(pipes) FIFO

(pipes)

- , / - , . . PIPE_BUF <limits.h>. .

, , . , .

. (Shell). :

ls | more

ls more.
: :
("|")
pipe() popen()


Note: (Pipe) , . () / , .

FIFO

FIFO - , , , FIFO , .
: :
FIFO mkfifo
FIFO mkfifo()
FIFO rm
FIFO remove() unlink()

, :

. / , , .

, / , .

-

- - . -