[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ossec-list] string.h or strings.h
I've been installing ossec on Solaris, AIX, RedHat and working to
port ossec-hids to HP-UX. The string.h vs. strings.h issue has been
making me crazy. No matter which file I included I would get error
messages and the '-include string.h' CFLAG was not working for Solaris.
After analyzing which functions are included in which files, I decided to:
1. use '#include <string.h>' only.
2. convert all calls to index() and rindex() to strchr() and strrchr()
respectively.
string.h strings.h
------------------------------------------------------
AIX index index
strdup
strchr
------------------------------------------------------
RedHat index index
strdup
strchr
------------------------------------------------------
SOLARIS 8 & 9 index
strdup
strchr
------------------------------------------------------
HPUX index
strdup
strchr
This made my compiler shut up. But this may not work on other OSes.
According to www.gnu.org:
"Some systems give these functions the names index and rindex; other
systems use the names strchr and strrchr. Some systems support both
pairs of names, but neither pair works on all systems."
(http://www.gnu.org/prep/standards/html_node/System-Functions.html)
They recommend using strchr/strrchr and if they don't exist "define
them as macros in terms of the other pair." Unfortunately, their
assumption that macros HAVE_STRCHR and HAVE_STRRCHR exist is invalid
under Solaris 8 at least.
So we'll have fun, fun, fun 'til the *nix puts the strchr() away.
-- Leslie Arvin
arvin@xxxxxxxxxx, Office: FREH G409, Phone: 765-496-3971
Network Systems Administrator, ITI-Unix Platforms
Purdue University, Information Technology at Purdue
--~--~---------~--~----~------------~-------~--~----~
-~----------~----~----~----~------~----~------~--~---
OSSEC home |
Main Index |
Thread Index
OSSEC project: www.ossec.net.
Mailling list information: http://www.ossec.net/en/mailing_lists.html.