Function rand() under AIX 3.2

Function rand() under AIX 3.2

Post by Binod Taterw » Thu, 25 Mar 1993 04:44:00



Can some one tell me why the following program generates random number
between 2**15-1, even when I am using the BSD version. I used the
following command to compile and link:

        cc -D_BSD -DBSD -DAIX randeg.c -lbsd -lc

I looked up the info pages of rand where it says that you need to use
-lbsd to generate random numbers between 2**32-1. Any help will be
appreciated. Thanks in advance.

System: IBM RS/6000 AIX 3.2.3
^^^^^^^
Program (randeg.c):
^^^^^^^^^^^^^^^^^^^
#include <stdio.h>
#include <sys/types.h>
#include <stdlib.h>

#define N 20
main ()
{
  int i;
  for (i=0; i<N;i++)
    printf("%2d) - %d\n", i, rand());
  return 0;

Quote:}

Output:
^^^^^^^
 0) - 16838
 1) - 5758
 2) - 10113
 3) - 17515
 4) - 31051
 5) - 5627
 6) - 23010
 7) - 7419
 8) - 16212
 9) - 4086
10) - 2749
11) - 12767
12) - 9084
13) - 12060
14) - 32225
15) - 17543
16) - 25089
17) - 21183
18) - 25137
19) - 25566
--

============================================================================
     Binod Taterway, Sr. User Consultant, Lehigh Univ. Computing Center
     ------------------------------------------------------------------

============================================================================

 
 
 

1. How to map CECP <-> AIX Code for tn3270 for AIX 3.2?

Could someone out there help me on this?

For AIX 3.1, I was able to do my own CECP <-> AIX Code mapping
as follows:
1.  Modify /usr/lib/nls/nlin/US.in_src and
           /usr/lib/nls/nliout/US.out_src accordingly,
2.  genxlt < ../US.in_src > ../US.in and
    genxlt < ../Us.out_src > ../US.out
3.  put ../US.in and ../US.out in my home directory.
They worked fine.

Now I am using AIX 3.2. The way of the mapping for tn3270 for AIX 3.2
seem changed. The /usr/lib/nls/nlin and /usr/lib/nls/nlout no longer
exist.

How can I map CECP <-> AIX Code for tn3270 for AIX 3.2?

Thanks in advance for any information!

Ching Shih


Disclaimer: I speak for myself. All opinions expressed are solely
my own.

2. CHAP Security Support with LINUX PPP

3. Need help with executables compiled on AIX 4.3 but being run on AIX 3.2

4. Reasons for me to toss Linux

5. Install AIX V4.2.1 on H50 which installed AIX V4.3.2 already

6. linux + floppy disk adaptor for memory stick = ?

7. AIX 3.2 vs AIX 4.1 Implementation of Berkeley sockets

8. number of processes on IRIX

9. Install package AiX 3.2 on AiX 4.3

10. Malloc AIX 3.1 vs. AIX 3.2

11. Security Problem with AIX 3.2 and AIX 3.1.5 w/ PTF 2007

12. AIX 4.1 dependence on AIX 3.2 server

13. C for AIX v3.1.4 and AIX v4.3.2