Alternative for getline() function in AIX 5.3
Oleg Goldshmidt
pub at goldshmidt.org
Tue Jul 27 21:47:53 IDT 2010
"Nadav Har'El" <nyh at math.technion.ac.il> writes:
> The second alternative is to make use of the wonderful fact that
> Linux is free software, and just take the source code of getline()
> and incorporate it in your program! I can't imagine that getline()
> is more than a couple of dozen lines - it's not that
> complicated... In fact, you can probably easily write one
> yourself...
It may be possible, but maybe not as simple as finding the function's
code and pasting it into an AIX app. Getline is a part of glibc, which
is licensed under LGPL. This means that you can use it as a library
and link your application to it using an API without releasing the app
under LGPL, but I doubt you can use the code in a single application
without releasing it under LGPL or GPL (unless all the code is in a
header, which I doubt). IANAL, and I didn't look too
deeply, but this is what LGPL seems to say.
The procedure would be to determine which pieces of glibc would
together be enough to provide getline functionality in a library, and
then either try to compile it on AIX (which may or may not work,
depending on how much gcc-specific stuff there is) or cross-compile
the thing with gcc for AIX, taking care that the interface is not
GNU-specific and that none of the stuff needed to compile and link
clashes with the libc of AIX.
Then deliver the resulting library as a part of your overall AIX
package, and then take care of actual production / legal / support /
operations stuff (e.g., what is the procedure for delivering the code
of the resulting library on request?) that a commercial company needs
to deal with, unlike folks who just upload code to sourceforge or
something. (I am not saying it is impossible, I am saying it is a
serious issue beyond coding that requires involvement of many
functions in an organization).
It may or may not be simple... Or simpler than fgets, which is what
matters.
Disclaimer: I have not tried this and encountered difficulties, I am
just trying to imagine what the potential issues may be.
--
Oleg Goldshmidt | pub at goldshmidt.org
More information about the Linux-il
mailing list