At 09:33 2003-09-23 -0500, Bruce Vining <bvining@xxxxxxxxxx> wrote:
> You need to be using the Integrated File System version of rename().  In
> the V5R2 Information Center take the path Programming/APIs/APIs by
> category/Unix-Type/Integrated File System APIs/rename()
> What is documented there is that if you define _POSIX_SOURCE you will get a
> rename() which unlinks the "new" if it exists.

Ahh, thank you.

Now I have compile-time problems on OS/400 V5R2.  

With _POSIX_SOURCE defined, <sys/types.h> a.k.a
QSYSINC/SYS(TYPES) declines to define fd_set.  <sys/time.h>
a.k.a. QSYSINC/SYS(TIME) subsequently uses fd_set as a type
identifier, and the compiler quite naturally chokes.

I can work around this problem quite easily by changing the
program to call Qp0lRenameUnlink() instead of rename(), but
I wonder if there is some a way to fix this without making
non-portable changes to the program.  Or, is there some
reason why a program should not try to include both
<sys/types.h> and <sys/time.h>?  On one hand, <sys/types.h>
seems to be perfectly deliberate in omitting the definition
of fd_set when _POSIX_SOURCE is defined.  On the other hand,
the documentation of select() in the iSeries information
shows the need to #include both files.

I have looked at "iSeries ILE C/C++ for iSeries Run-Time
Library Functions, Version 5, SC41-5607-01", "OS/400
the Posix site
<>, and the
iSeries information center for enlightenment about the
definition of fd_set.  Each of these shows lots of uses of
fd_set as a type identifier, but I have not found much about
the definition of fd_set.

Thank you for your attention.


This thread ...

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2019 by and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].