|
Andrew Goade wrote:
>
> ... I cannot seem to find a consistent definition for the
> O_SHARE_NONE option.
> ...
Andy, if you look in QSYSINC/H mbr FCNTL, you'll see this definition for
O_SHARE_NONE.
#define O_SHARE_NONE 000002000000
The initial 0 (that's a zero) means that this is an octal (powers of
eight) number. There are two ways to express this in RPG, as a
hexadimal number or a decimal number.
Here's how to get a hexadecimal number for it:
Start with the octal number. I've added some blanks to make it easier
to see.
0000 0200 0000
For each octal digit, write the 3 bits representing the digit. 0 = 000,
1 = 001, 2 = 010 etc.
000 000 000 000 000 010 000 000 000 000 000 000
Now, push them all together:
000000000000000010000000000000000000
and resplit them into groups of 4:
0000 0000 0000 0000 1000 0000 0000 0000 0000
and then get the hex digit for each group of 4 (0000=0, 1001=9, 1111=F
etc)
0 0 0 0 8 0 0 0 0
Remove or add zeros on the left to get 4 pairs
00 08 00 00
And you get
x'00080000'
Here's how to get a decimal number for it:
Start from the right and add multiples of powers of 8, starting with
8**0. A different example makes this easier to illustrate:
07352 = (7 * 1)
+ (3 * 8)
+ (5 * 64)
+ (2 * 8 * 64)
O_SHARE_NONE, 000002000000, has all zeros except the 8**6 one, so the
decimal value is 2 * 8** 6 = 524288
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.