direct linux calls?

Giorgos Keramidas keramida at westnet.gr
Sun Nov 29 02:18:51 EET 1998


Kostas Papadakis wrote:
|
| iparxei kapoio reference ton kliseon pou anaferontai sto
| /usr/include/asm/unistd.h ?
|

Opws poies times, va baleis stous kataxwrntes, ti snmaivei to
return-code tou interrupt 0x80 meta apo ka0e klnsn, kai ti
va kaveis meta?  H apavtnsn eivai NAI...

Diabazeis to source tns glibc kai to source tou kernel mazi.
Autes eivai oi `direct' opws tis apokaleses klnseis twv
system-calls tou Linux.  Kavovika eseva dev prepei va se
evdiaferei ti ari0mo exei eva system call, giati ektos tou
oti eivai pio duskolo va grapseis, px. tov assembly kwdika

	1:	movl	$0,%eax
		movl	$1,%ebx
		intl	$0x80
		jmp	1b

apo tnv mia grammn kwdika se C

		exit(1)

av kapoia stigmn allaksei o ari0mos tou exit() system call,
ti givetai?

Av exeis tnv suvn0eia va to kaleis me inline assembly, tou stul:

	__asm__ ("1:\tmovl $0,%r0\n\t...");

tote 0a prepei va kaveis update se ola ta snmeia pou KALEIS
tnv system-call.  Av omws krupseis tov tropo leitourgias tou
system-call pisw apo mia klnsn biblio0nkns (auto pou kavei
n standard biblio0nkn tns C) tote apla allazeis se ENA MEROS
tov tropo klnsns tou system-call (stnv biblio0nkn) kai OLA
ta programmata suvexizouv va douleuouv apsoga!

Pavtws, ta sources ta exeis... xrovo favtazomai mporeis va
breis... arxise to diabasma apopse kiolas :)))

/keramida
--
====================================================================
Gia boithia (h na diagrafhte) e-mail sto majordomo at argos.hol.gr
Ta archives tis listas einai sto http://www.argos.hol.gr/lists :
prin steilete kapoia erothsh psakte mipos exei hdh apanththei.
Gia opoiodipote problima stilte e-mail ston owner-linux-greek-users
====================================================================



More information about the Linux-greek-users mailing list