SVR4 IPC. Are these guys for real?

SVR4 IPC. Are these guys for real?

Post by Sinan Kara » Wed, 02 Nov 1994 03:22:11





>  Well, sho 'nuf it turned up.  Despite the SVR4 prototype in the manual
>page, Solaris and for that matter SunOS requires a pointer to semun
>rather than the union itself to be passed.  Also, as an added bonus, the
>Solaris 2.3 includes omit the definition of the semun union; you needed
>the typing exercise anyhow.  And now here it is... for your edification...
>the truely appalling workaround.

>/* InitVals is an array of three ushorts. */

>#ifndef sun
>      /* As per SVR4 and Sun's man pages.  (Even Linux gets this right.) */
>      if (semctl(SemId, 0, SETALL, InitVals))
>        return -1;
>#else
>      union semun ValsUn = InitVals;

>      /* As per SunOS and Solaris implementation. */
>      if (semctl(SemId, 0, SETALL, &ValsUn))
>        return -1;
>#endif

Not true.
Try:

    union sembuf{
       int val;
       struct semid_ds *buff;
       ushort *array;
    } arg;

    arg.val=0;

    semctl (my_semid ,SEM_2,SETVAL,arg) == -1

    etc.....

   You have to use the arguments as documented.

- Show quoted text -

>--
>Christopher Oliver                              Computer Science Office
>Concurrent Computations Research Center  __o    Friedmann Hall

>                                      (_)/ (_)  Kalamazoo, Michigan, 49008-5021

 
 
 

SVR4 IPC. Are these guys for real?

Post by Casper H.S. D » Wed, 02 Nov 1994 09:22:29



>  Well, sho 'nuf it turned up.  Despite the SVR4 prototype in the manual
>page, Solaris and for that matter SunOS requires a pointer to semun
>rather than the union itself to be passed.  Also, as an added bonus, the
>Solaris 2.3 includes omit the definition of the semun union; you needed
>the typing exercise anyhow.  And now here it is... for your edification...
>the truely appalling workaround.

If you have a problem between a pointer to a union and a union,
the most likely cuase is a mixup at your end.  A C library
on the SPARC *cannot* discern between a pointer to union
and a union.  A pointer to union is passed as a pointer.
A union is passed as a pointer.  (To a copy on the stack).

Did you pass an int (short whatever) instead?

Casper

 
 
 

1. Am my linux box hack by the bad guy

Hi All
I have a linux which run RH 7.3 and some common service (apache wu-ftp qmail
ssh....), but the mainly usage is the mail service, couple weeks ago I
notice that where every week of sunday, the linux box will become crazy that
continuously seding a lot of query to the remote site prot 80, it cause the
connection very slow and interrupt the income email .
Am my linux box hack by the bad guy and how can I solve this problem.

Please help
Thanks a lot

2. Conflict between SB PCI/16 and USB?

3. ipfilters, NAT and MAC address problem

4. Windows guy wants Linux but looks like real pain

5. Shadow Passwords

6. this darn system is really killing me dead you guys have been real helpful

7. tekram trouble

8. Determining whether I am using shared text segments under SVR4

9. RT (Real Time) class Scheduling on svr4

10. Guys,Guys BeOS For Linux Is Here !!

11. Real Time Clock not responding - Am I screwed??

12. how to -- shell SVR4 detect (uname and SVR4)