Sponsored Content
Full Discussion: Hi...Need Help
Top Forums Programming Hi...Need Help Post 17951 by jack_2205 on Thursday 21st of March 2002 11:58:43 AM
Old 03-21-2002
Hi...Need Help

Hi,

I am getting a bus error when i run the following code.

#include <stdio.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>
#include <errno.h>

main()
{
int semid,retval;
semid=semget(0x20,1,IPC_CREAT|0666);
retval= semctl(semid,0,GETVAL,0);
printf("The value returned by the Getval is %d\n",retval);
semctl(semid,0,SETVAL,1);
printf("HI2\n");
retval= semctl(semid,0,GETVAL,0);
printf("The value returned by the Getval is %d\n",retval);
}



The bus error is due to this statement semctl(semid,0,SETVAL,1);

Can any one help to solve the problem.

Ur help will be appreciated.

Thanks..Jack
 
SHMIF_DUMPBUS(1)					    BSD General Commands Manual 					  SHMIF_DUMPBUS(1)

NAME
shmif_dumpbus -- examine shmif bus contents SYNOPSIS
shmif_dumpbus [-h] [-p pcapfile] busfile DESCRIPTION
The shmif_dumpbus utility examines the bus of an shmif(4) Ethernet interface. The most useful feature is converting the bus to the pcap(3) file format for later examination. shmif_dumpbus itself is limited to displaying only very basic information about each frame. shmif_dumpbus accepts the following flags: -h Print bus header only and skip contents. -p pcapfile Convert bus contents to the pcap(3) format and write the result to pcapfile. The file - signifies stdout. EXAMPLES
Feed the busfile contents to pcap: $ shmif_dumpbus -p - busfile | tcpdump -r - SEE ALSO
pcap(3), shmif(4), tcpdump(8) CAVEATS
shmif_dumpbus does not lock the busfile and is best used for post-mortem analysis of the bus traffic. The timestamp for each frame contains the sender's timestamp and may not be monotonically increasing with respect to the frame order in the dump. BSD
January 12, 2011 BSD
All times are GMT -4. The time now is 11:27 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy