[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [CPROG] IO-port



Hejsa Jørn,
>  Har du Link eller en smule kode hvor man kan se et eksempel hvor de ting
> bliver brugt
Det følgende er ud af fri hukommelse, og er ikke testet:

	int userid = 0;
	/* get the user id */
	userid = getuid();
	/* check if the current user has the rights to change to user id 0 */
	if(setuid(0)){
		/* setuid failed - insert your own stuff here */
  	}
	else{
    		/* else we call ioperm to open the io ports we need */
    		ioperm(0x300, 2, 1);                
		/* grant access to ports $300 and $301 */
  	}
	/* set uid to the original user */
 	setuid(userid);  

Et godt sted at kigge er man siderne over de forskellige funktioner (man
ioperm).
Et andet godt sted er news-gruppen comp.unix.programmer, eller dennes
FAQ.
Du er selvfølgelig også meget velkommen til at kontakte mig igen.

Mvh
//Brix
-- 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 Name:   Henrik Brix Andersen         Web: http://freakfoster.dhis.org
 E-mail: sslug@sslug  Get Linux: http://www.linux.org
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:08 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *