Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SH_DENY* equivalent in Solaris

Tags:

c++

gcc

porting

Solaris equivalent to fcntl.h and share.h

I am porting a big C++ project from Windows/VS to Solaris/Eclipse/gcc. The Windows code uses _SH_DENYNO etc which are in a Microsoft file share.h. The same file on the Sun at /usr/include/sys does not contain these, nor does any other I can find.

I suppose they have another name in Solaris. Can someone tell me where to find their equivalent? The windows versions have these values:

 #define _SH_DENYRW      0x10    /* deny read/write mode */
 #define _SH_DENYWR      0x20    /* deny write mode */
 #define _SH_DENYRD      0x30    /* deny read mode */
 #define _SH_DENYNO      0x40    /* deny none mode */
 #define _SH_SECURE      0x80    /* secure mode */

Do the Solaris versions have the same values?

(Sorry about the big font, it insisted)

like image 544
RedSonja Avatar asked Feb 02 '26 11:02

RedSonja


1 Answers

I think solaris, like other unix, is always _SH_DENYNO. You need explicit locking of files, try lockf or fcntl.

like image 118
J-16 SDiZ Avatar answered Feb 05 '26 00:02

J-16 SDiZ



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!