public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* Portability of libattr
@ 2008-04-09 18:41 petr.pisar
  2008-04-09 18:54 ` Christoph Hellwig
  0 siblings, 1 reply; 5+ messages in thread
From: petr.pisar @ 2008-04-09 18:41 UTC (permalink / raw)
  To: xfs

[-- Attachment #1: Type: text/plain, Size: 891 bytes --]

Hello,

I'm adding support for extended atributes into few applications.
Unfortunatetally API for EA manipulation is not standartized and every
operating system uses its own solution. I thought libattr from attr package
could help me. However attr seems running on Linux (and maybe IRIX) only.

Therefore I've decided to use libc functions from every system directly. I've
succesfully ported my code to Linux, IRIX and Darwin (Max OS X). Their AE
syscalls are very similar. However FreeBSD API is more different. Because I'm
extending more applications I need to share the code.

So, my qustions are: should I write my own library or should I extend libattr.
As I can understand libattr code it's designed to port IRIX application on
Linux. Am I right? Or are you going support more OS's in libattr? Or exists
here some similar library providing unified interface fro more systems?

-- Petr

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Portability of libattr
  2008-04-09 18:41 Portability of libattr petr.pisar
@ 2008-04-09 18:54 ` Christoph Hellwig
  2008-04-11 15:01   ` Russell Cattelan
  0 siblings, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2008-04-09 18:54 UTC (permalink / raw)
  To: xfs

On Wed, Apr 09, 2008 at 08:41:08PM +0200, petr.pisar@atlas.cz wrote:
> Hello,
> 
> I'm adding support for extended atributes into few applications.
> Unfortunatetally API for EA manipulation is not standartized and every
> operating system uses its own solution. I thought libattr from attr package
> could help me. However attr seems running on Linux (and maybe IRIX) only.
> 
> Therefore I've decided to use libc functions from every system directly. I've
> succesfully ported my code to Linux, IRIX and Darwin (Max OS X). Their AE
> syscalls are very similar. However FreeBSD API is more different. Because I'm
> extending more applications I need to share the code.
> 
> So, my qustions are: should I write my own library or should I extend libattr.
> As I can understand libattr code it's designed to port IRIX application on
> Linux. Am I right? Or are you going support more OS's in libattr? Or exists
> here some similar library providing unified interface fro more systems?

Note: I'm not the maintainer of libattr, so I'm not the one to decide.

I think adding more systems is an excellent idea as it's a bit of a
porting layer already.  Russell will have to add FreeBSD support anyway
once he ports xfsdump to FreeBSD :)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Portability of libattr
  2008-04-09 18:54 ` Christoph Hellwig
@ 2008-04-11 15:01   ` Russell Cattelan
  2008-04-11 16:40     ` petr.pisar
  0 siblings, 1 reply; 5+ messages in thread
From: Russell Cattelan @ 2008-04-11 15:01 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs, petr.pisar

Christoph Hellwig wrote:
> On Wed, Apr 09, 2008 at 08:41:08PM +0200, petr.pisar@atlas.cz wrote:
>   
>> Hello,
>>
>> I'm adding support for extended atributes into few applications.
>> Unfortunatetally API for EA manipulation is not standartized and every
>> operating system uses its own solution. I thought libattr from attr package
>> could help me. However attr seems running on Linux (and maybe IRIX) only.
>>
>> Therefore I've decided to use libc functions from every system directly. I've
>> succesfully ported my code to Linux, IRIX and Darwin (Max OS X). Their AE
>> syscalls are very similar. However FreeBSD API is more different. Because I'm
>> extending more applications I need to share the code.
>>
>> So, my qustions are: should I write my own library or should I extend libattr.
>> As I can understand libattr code it's designed to port IRIX application on
>> Linux. Am I right? Or are you going support more OS's in libattr? Or exists
>> here some similar library providing unified interface fro more systems?
>>     
>
> Note: I'm not the maintainer of libattr, so I'm not the one to decide.
>
> I think adding more systems is an excellent idea as it's a bit of a
> porting layer already.  Russell will have to add FreeBSD support anyway
> once he ports xfsdump to FreeBSD :)
>
>   
nod.

I have not looked closely at the FreeBSD EA stuff so I don't know how 
different things
are. I can't imagine they are that far off?

I thought the libattr code does compile on IRIX. There was an effort at 
one point to only
have one usespace code base that worked on both linux and irix.

I would be really cool if we got FreeBSD support into libattr.

-Russell

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Portability of libattr
  2008-04-11 15:01   ` Russell Cattelan
@ 2008-04-11 16:40     ` petr.pisar
  2008-04-11 19:47       ` nscott
  0 siblings, 1 reply; 5+ messages in thread
From: petr.pisar @ 2008-04-11 16:40 UTC (permalink / raw)
  To: xfs

[-- Attachment #1: Type: text/plain, Size: 1194 bytes --]

On Fri, Apr 11, 2008 at 10:01:27AM -0500, Russell Cattelan wrote:
> I have not looked closely at the FreeBSD EA stuff so I don't know how
> different things are. I can't imagine they are that far off?
>
Unfortunatelly, I have no FreeBSD machine available now, but as I found in its
manual pages, they have splitted the names space and the rest of the EA name.
The namespaces are enumerated. So you can't just call
getxattr("user.mime_type', ...). Also they support reading EA from any
arbitrarry offset like Darwin. (Linux reads from first byte always). FreeBSD
API is little more rich.

> I thought the libattr code does compile on IRIX. There was an effort at one
> point to only have one usespace code base that worked on both linux and
> irix.
>
Great. Could you tell me which of these two APIs are the standard interface?
I'm a little confused about all the Linux code in libattr (like syscall
numbers) because glibc-2.6.1 has already syscall wrappers. So If added support
for Darwin of FreeBSD into libattr, which level should I implement?
attr_get(3) or getxattr(2/3) which is still parto of libattr? In other words:
Should I implement IRIX-styled API or the Linux-styled one?

-- Petr


[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Portability of libattr
  2008-04-11 16:40     ` petr.pisar
@ 2008-04-11 19:47       ` nscott
  0 siblings, 0 replies; 5+ messages in thread
From: nscott @ 2008-04-11 19:47 UTC (permalink / raw)
  To: xfs

> On Fri, Apr 11, 2008 at 10:01:27AM -0500, Russell Cattelan wrote:
>> I have not looked closely at the FreeBSD EA stuff so I don't know how
>> different things are. I can't imagine they are that far off?
>>
> Unfortunatelly, I have no FreeBSD machine available now, but as I found in
> its
> manual pages, they have splitted the names space and the rest of the EA
> name.
> The namespaces are enumerated. So you can't just call

This part (at least) is the same as the IRIX API (on IRIX the namespaces
are also enumerated).

> getxattr("user.mime_type', ...). Also they support reading EA from any
> arbitrarry offset like Darwin. (Linux reads from first byte always).
> FreeBSD
> API is little more rich.

Hmm, supporting that is a bit of an issue (do you need to?) - neither
IRIX nor Linux allow offsets for attrs.

>> I thought the libattr code does compile on IRIX. There was an effort at

libattr is providing a mapping between Linux (and potential other APIs)
and the IRIX libc API - so, there is no need for it to compile on IRIX.

> Great. Could you tell me which of these two APIs are the standard
> interface?

libattr exports the IRIX interface.  There are no standards here.

> I'm a little confused about all the Linux code in libattr (like syscall
> numbers) because glibc-2.6.1 has already syscall wrappers. So If added

libattr predates the libc interfaces.

> support
> for Darwin of FreeBSD into libattr, which level should I implement?
> attr_get(3) or getxattr(2/3) which is still parto of libattr? In other
> words:
> Should I implement IRIX-styled API or the Linux-styled one?

I'd suggest IRIX style, since I expect that will be closer to other
platforms,
and was the original intent with libattr.  I imagine the biggest problem will
be the list operation, that is by far the most complex (and wierd, on IRIX).

cheers.

--
Nathan

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-04-11 20:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-09 18:41 Portability of libattr petr.pisar
2008-04-09 18:54 ` Christoph Hellwig
2008-04-11 15:01   ` Russell Cattelan
2008-04-11 16:40     ` petr.pisar
2008-04-11 19:47       ` nscott

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox