Unix
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   Web Development Archives Mailing Lists Unix

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Web Development Archives Sponsor:
  #1  
Old July 15th, 2008, 11:40 AM
Sergiu Ivanov
Guest
Dev Archives Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
How to stack libtrivfs-based translators

Hello,

I have written a libtrivfs-based translator (the source code is
supplied in the attachment), however I have problems with stacking it
upon itself. I compile it using the following command:

gcc -Wall -g -ltrivfs -lfshelp mangle.c -o mangle -DDEBUG -DMANGLE

Then I stack it upon an untranslated node foo, which is a text file
containing the text: 'Hello'. I use the following command:

settrans -a foo mangle

If I now try to stack mangle upon foo again, using the command:

settrans -L foo mangle

I receive the following error message:

settrans: foo: not supported

I also tried settrans -aL foo mangle (not sure if this matters), but I
obtain the same result. When I try fsysopts on the translated node foo
in the following way:

fsysopts foo

I get a similar error:

fsysopts: foo: not supported

As you can see from mangle.c, I print a message in a log file
whenever any of libtrivfs callbacks is called. After the two
invocations of settrans, this file still contains the greeting message
only (i.e. "Log session started").

Could you please tell me what I am doing wrong?

scolobb

Reply With Quote
  #2  
Old July 15th, 2008, 08:39 PM
Guest
Dev Archives Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
How to stack libtrivfs-based translators

Hi,

Tue, Jul 15, 2008 at 06:10:02PM +0300, Sergiu Ivanov wrote:

I have written a libtrivfs-based translator (the source code is
supplied in the attachment), however I have problems with stacking it
upon itself.
[]
If I now try to stack mangle upon foo again, using the command:

settrans -L foo mangle

I receive the following error message:

settrans: foo: not supported

This requires certain RPCs in fs.defs (and probably fsys.defs) to be
implemented, most notably file_set_translator. A quick look at
file-set-translator.c from libtrivfs shows us that
trivfs_S_file_set_translator() is "implemented" as

{ return EPNTSUPP; }

i.e. it's not implemented at all.

In other words, libtrivfs doesn't seem to support setting further
translators on the translated node out of the box. (I think you could
implement it manually, though)

I must admit that this surprises me quite a bit. I wonder whether there
is any good reason for that

When I try fsysopts on the translated node foo in the following way:

fsysopts foo

I get a similar error:

fsysopts: foo: not supported

You need to implement the trivfs_append_args() callback -- see the hello
translator for a trivial example, or others like pfinet for more complex
ones.

-antrik-

Reply With Quote
  #3  
Old July 25th, 2008, 01:10 PM
Guest
Dev Archives Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
How to stack libtrivfs-based translators

Hi,

Wed, Jul 23, 2008 at 12:00:59PM +0300, Sergiu Ivanov wrote:

Could anybody suggest and idea how to implement this
trivfs_S_file_set_translator callback? I tried to find some clues in
trivfs.h and in hurd-cvs, but my attempts ended fruitless

Have you checked what libnetfs does? Probably you need to do more or
less the same

-antrik-

Reply With Quote
Reply

Viewing: Web Development Archives Mailing Lists Unix > How to stack libtrivfs-based translators


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek