Operating System - OpenVMS
1752507 Members
5446 Online
108788 Solutions
New Discussion юеВ

Missing C Posix header files

 
SOLVED
Go to solution
MartinNi
Occasional Visitor

Missing C Posix header files

Hi,

I am quite new to OpenVMS, so forgive me if I ask something stupid. I am trying to compile a small C++ program with the Boost libraries on OpenVMS. I have managed to copy over all the header-only parts of Boost and that is enough for me at the moment. I also managed to compile one small test program that works. However in the next program, using Boost Interprocess, my compilation fails because

<sched.h>

is missing. This is a header from the C POSIX library, so I was expecting it to be there.

I am using the HP C++ compiler under OpenVMS 8.4.

>cxx /version

HP C++ V7.4-005 on OpenVMS IA64 V8.4

What to do? Any help is much appreciated.

4 REPLIES 4
Steven Schweda
Honored Contributor
Solution

Re: Missing C Posix header files

   I know nothing, but I'd guess that VMS offers no support for the
"POSIX realtime extensions as defined in POSIX 1003.1b-1993 (POSIX.1b)".

   What's "Boost"?  What does it do?  What are you trying to do with it?

> What to do? Any help is much appreciated.

   The missing header file may be only the beginning of your problems.
If you also need the sched_*() functions which, I gather, are declared
in <sched.h>, then you might need to implement the whole pile yourself.

   Scheduling on VMS may be significantly different from scheduling on a
UNIX/POSIX system.  At this point, I'd probably start looking for a
different way to do whatever this stuff would be doing.

Dennis Handly
Acclaimed Contributor

Re: Missing C Posix header files

> What's "Boost"?  What does it do?

 

C++ template libs:

https://en.wikipedia.org/wiki/Boost_(C%2B%2B_libraries)

MartinNi
Occasional Visitor

Re: Missing C Posix header files

Thank you, Steven.

I think you may be right. The Boost libraries are multi-platform and really handy if you want to write something portable. If it doesn't know anything else, it assumes POSIX. However, the POSIX support in OpenVMS seems rather sketchy, unfortunately.

I investigated a bit further and would like to share my findings here, if someone else wonders. Wikipedia has a list of the POSIX C header files here:

https://en.wikipedia.org/wiki/C_POSIX_library

By trial and error I came up with the following ones being supported by OpenVMS (the commented ones are not supported)

//#include <aio.h>
#include <arpa/inet.h>
#include <assert.h>
//#include <complex.h> // error "C99 header <complex.h> is not supported by this compiler."
//#include <cpio.h>
#include <ctype.h>
#include <dirent.h>
#include <dlfcn.h>
#include <errno.h>
#include <fcntl.h>
//#include <fenv.h>
#include <float.h>
//#include <fmtmsg.h>
//#include <fnmatch.h>
#include <ftw.h>
#include <glob.h>
#include <grp.h>
#include <iconv.h>
#include <inttypes.h>
#include <iso646.h>
#include <langinfo.h>
#include <libgen.h>
#include <limits.h>
#include <locale.h>
#include <math.h>
#include <monetary.h>
//#include <mqueue.h>
//#include <ndbm.h>
#include <net/if.h>
#include <netdb.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <nl_types.h>
#include <poll.h>
#include <pthread.h>
#include <pwd.h>
//#include <regex.h>
//#include <sched.h>
//#include <search.h>
#include <semaphore.h>
#include <setjmp.h>
#include <signal.h>
//#include <spawn.h>
#include <stdarg.h>
//#include <stdbool.h> // error "C99 header <stdbool.h> is not supported by this compiler."
#include <stddef.h>
//#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <stropts.h>
#include <sys/ipc.h>
#include <sys/mman.h>
//#include <sys/msg.h>
#include <sys/resource.h>
//#include <sys/select.h>
#include <sys/sem.h>
#include <sys/shm.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/statvfs.h>
#include <sys/time.h>
#include <sys/times.h>
#include <sys/types.h>
#include <sys/uio.h>
#include <sys/un.h>
#include <sys/utsname.h>
#include <sys/wait.h>
//#include <syslog.h>
//#include <tar.h>
//#include <termios.h>
//#include <tgmath.h> // error "C99 header <tgmath.h> is not supported by this compiler."
#include <time.h>
//#include <trace.h>
//#include <ulimit.h>
#include <unistd.h>
#include <utime.h>
//#include <utmpx.h>
#include <wchar.h>
#include <wctype.h>
//#include <wordexp.h>

I am back to the drawing board, but maybe I saved someone else from doing my mistakes.

/Martin

 

Craig A Berry
Honored Contributor

Re: Missing C Posix header files

Note that VSI has on its roadmap for this quarter some CRTL and header updates that should help with this sort of thing.

See:

http://vmssoftware.com/pdfs/VSI_Roadmap_20170306.pdf