Solved

Porting C code from Sun Solaris to IBM AIX

Posted on 1997-04-24
1
459 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
1 Comment
 
LVL 4

Accepted Solution

by:
jos010697 earned 20 total points
Comment Utility
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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…
Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
The goal of this video is to provide viewers with basic examples to understand how to use strings and some functions related to them in the C programming language.

763 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now