[Mono-list] How to get linux constants like PATH_MAX into mono
Andreas Heertsch
heertsch at gmail.com
Tue Apr 21 12:08:41 EDT 2009
2009/4/20 Jonathan Pryor <jonpryor at vt.edu>
> On Sun, 2009-04-19 at 12:51 -0700, Heertsch wrote:
> > is there a way to get the value auf PATH_MAX (linux constant for lenght
> of a
> > pathname in bytes) into c# code?
>
> I would suggest not using any such mechanism, if possible, as not all
> platforms have an actual filename limit (e.g. GNU HURD).
Jon, I totally agree!
I try to port libusb via LibUsbDotNet to Linux/OSX. The authors from libusb
wrote structures with PATH_MAX as field lenght. So I have to integrate this
malformed code. :(
In the event that you must have a limit, under Linux you can use
> Syscall.pathconf() [0] with PathconfName._PC_PATH_MAX:
>
> long maxPathLen =
> Syscall.pathconf("/", PathconfName._PC_PATH_MAX)
Thanks, that's what I need.
Andreas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20090421/2dc26ed1/attachment-0001.html
More information about the Mono-list
mailing list