[Click] opening handler file

Giovanni Di Stasi gdstasi at yahoo.it
Wed Mar 5 04:33:45 EST 2008


Hi, 
I simply wanted to write in the handler... I was specifying the wrong flags. At the end I worked out the situation opening the handler in this way:

open(filename, O|WRONLY|O_CREAT|O_TRUNC, 0666)



----- Messaggio originale -----
Da: Eddie Kohler <kohler at cs.ucla.edu>
A: Giovanni Di Stasi <gdstasi at yahoo.it>
Cc: Click Mailing List <click at amsterdam.lcs.mit.edu>
Inviato: Martedì 4 marzo 2008, 16:40:53
Oggetto: Re: [Click] opening handler file

You can't open handlers in append mode.  You must supply O_TRUNC when opening 
a handler file for writing.

If you really really really need this functionality, I suppose it could be 
done for read/write handlers by making append mode equal a read followed by 
writes.  But this is not the usual semantics of append mode.  Better to make 
your program work without it.

Eddie


Giovanni Di Stasi wrote:
> I'm writing a program which runs in user context and opens and writes into  a handler file exported by click in kernel mode.
> 
> I'm having problems in opening that file:
> 
> int fd_links;
> fd_links=open("/click/element/handler", O_WRONLY | O_APPEND);
> 
> The open call returns -1, and the error is "Permission denied".
> 
> The program runs with root privileges (at least I think so, it is a olsrd plugin).
> 
> Do you have any hints? I tried other flags, but I always get that error.
> 
> 
> 
>       ___________________________________ 
> L'email della prossima generazione? Puoi averla con la nuova Yahoo! Mail: http://it.docs.yahoo.com/nowyoucan.html
> 
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click





      ___________________________________ 
L'email della prossima generazione? Puoi averla con la nuova Yahoo! Mail: http://it.docs.yahoo.com/nowyoucan.html



More information about the click mailing list