× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Re: Sockets programming in RPG-ILE
  • From: Buck Calabro/commsoft<mcalabro@xxxxxxxxxxxx>
  • Date: Fri, 12 Feb 1999 09:27:37 -0500

On 02/11/99 03:31:14 PM Jon.Paris wrote:

> >> When I run the RPG code, I get an "invalid argument" error.
>
>Have you tried switching the Const in the PR definition to being a pointer
>passed by Value ? 

Yup. Same thing.  The definition of fcntl() in the C program is QBFC_EXTERN 
int fcntl(int, int, ...); 
The Unix-Type API manual says that if the second parameter (the command) is 
F_SETFL, then the third parameter (the option) is also type int.  The 
fcntl.h include uses #define to set the values of F_SETFL and O_NONBLOCK. 
They get cast(?) to int in during run time: rc = fcntl(sd, F_SETFL, 
O_NONBLOCK).  You can't look at these values during debug, so I created two 
variables of type int just to see what would happen: rc = fcntl(sd, 
F_SETFL_i, O_NONBLOCK_i)  This code, (using 3 int variables) works fine in 
C.  If I try to use 3 int variables in RPG, I get an "invalid argument" 
error (errno=3021, or EINVAL) which tells me that one of my parameters is 
no good.  How can I find which one?  Using debug, I see that the darned 
values are the same in the RPG program as they are in the C program, which 
leads me to believe that I have the definition wrong somehow...

>You may also need to specify Align (is that the right
>one?) to force the pointer onto a natural boundary, right now it won't be
>on one.  C is funny that way <g>

One can't ALIGN a procedure prototype definition, alas.

Buck Calabro
CommSoft, Albany, NY
mailto:mcalabro@commsoft.net
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* This is the RPG/400 Discussion Mailing List!  To submit a new         *
* message, send your mail to "RPG400-L@midrange.com".  To unsubscribe   *
* from this list send email to MAJORDOMO@midrange.com and specify       *
* 'unsubscribe RPG400-L' in the body of your message.  Questions should *
* be directed to the list owner / operator: david@midrange.com          *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


As an Amazon Associate we earn from qualifying purchases.

This thread ...


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

This mailing list archive is Copyright 1997-2024 by midrange.com 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].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.