Author |
Message
|
ktg |
Posted: Thu Aug 21, 2008 1:06 am Post subject: C functions availability on different OS |
|
|
Centurion
Joined: 09 Jan 2006 Posts: 138 Location: India
|
Hi All,
How to check whether a C function is available on given system/OS other than by trying 'man' for the function or through compilation error?
For ex. strerror_r is available on Linux but not on Solaris. man strerror_r on Solaris fails.
TIA,
Kalpana |
|
Back to top |
|
 |
Gaya3 |
Posted: Thu Aug 21, 2008 2:18 am Post subject: |
|
|
 Jedi
Joined: 12 Sep 2006 Posts: 2493 Location: Boston, US
|
you cant compare unix/linux compiler and solaris compiler as it is.
there are quite some difference, how it is handling in the kernel level calls too.
you should go through C code portability part, (please search about this) _________________ Regards
Gayathri
-----------------------------------------------
Do Something Before you Die |
|
Back to top |
|
 |
bruce2359 |
Posted: Thu Aug 21, 2008 5:20 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
The vendor-supplied application programming reference manual is the place to see if a given c function is supported or not. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
jsware |
Posted: Thu Aug 21, 2008 5:23 am Post subject: Re: C functions availability on different OS |
|
|
 Chevalier
Joined: 17 May 2001 Posts: 455
|
ktg wrote: |
For ex. strerror_r is available on Linux but not on Solaris. man strerror_r on Solaris fails. |
The strerror function is thread safe on Solaris, but not on Linux. See http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6223913 for a description of strerror vs strerror_r on Solaris/Linux. _________________ Regards
John
The pain of low quaility far outlasts the joy of low price. |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Aug 21, 2008 5:24 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
|
Back to top |
|
 |
gbaddeley |
Posted: Thu Aug 21, 2008 7:35 pm Post subject: |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
grep funcname /usr/lib/include/*.h /usr/lib/include/sys/*.h
and then go looking in the matched .h files, as there may be #ifdef around the function prototype.
As state previously, the vendor documentation is the definative way to go.
Do you have any particular function in mind? Nearly all of the standard C run-time functions are available on all platforms that support a C compiler. _________________ Glenn |
|
Back to top |
|
 |
ktg |
Posted: Fri Aug 22, 2008 5:32 am Post subject: |
|
|
Centurion
Joined: 09 Jan 2006 Posts: 138 Location: India
|
Thanks every one.
I was looking for strerror_r in Solaris. This function is not available on Solaris 8 but is available on Solaris 10.
man libc gave the functions available on the system. But, I could not get free/online Appication programming reference for Solaris 8
Regards,
Kalpana |
|
Back to top |
|
 |
|