Solved

Porting C code from Sun Solaris to IBM AIX

Posted on 1997-04-24
1
468 Views
Last Modified: 2013-12-05
I'm having problems porting C code written in Sun Solaris to IBM AIX. It seems that the 2 header files <time.h> and <sys/time.h> in the AIX version is not linked (compared to Solaris) and bound by the following code

#ifdef  _BSD_INCLUDES
#include <time.h>
#endif  /* _BSD_INCLUDES */

Is there any setting that needs to be configured in the C environment? Which standard does IBM AIX comform to (BSD or System V)?

The following errors were generated during compilation when the tm structure in <time.h> is placed together with timeval & timezone structures <sys/time.h> inside the same source file.

"fepfunc1.c", line 59.11: 1506-117 (S) Operand must be a scalar type.
"fepfunc1.c", line 62.17: 1506-022 (S) "tm_year" is not a member of "struct tm".
"fepfunc1.c", line 63.17: 1506-022 (S) "tm_mon" is not a member of "struct tm".
"fepfunc1.c", line 64.17: 1506-022 (S) "tm_mday" is not a member of "struct tm".
"fepfunc1.c", line 94.11: 1506-117 (S) Operand must be a scalar type.
"fepfunc1.c", line 97.25: 1506-022 (S) "tm_hour" is not a member of "struct tm".
"fepfunc1.c", line 98.25: 1506-022 (S) "tm_min" is not a member of "struct tm".
"fepfunc1.c", line 135.16: 1506-098 (E) Missing argument(s).
"fepfunc1.c", line 136.11: 1506-117 (S) Operand must be a scalar type.
0
Comment
Question by:derick042497
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 4

Accepted Solution

by:
jos010697 earned 20 total points
ID: 1250117
Sun swapped the functionality of time.h and sys/time.h.
I normally just include time.h and define a preprocessor
constant _ALL_SOURCE (as in -D_ALL_SOURCE)
and everything works fine then ...

BTW AIX is more SysV-ish; if you want BSD functionality,
define _BSD. (the appropriate manual pages tell you when
to define this thingy ...)

kind regards,

Jos
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question