EDIT Solved I was forgetting to malloc the sem pointers.
Type: Posts; User: chinook86
EDIT Solved I was forgetting to malloc the sem pointers.
Sorry that was just bad formatting of my code when I pasted it in here. The colons and if statements are fine in my code. sem_init() is a system call so I really don't have any control on what...
next question.
mailbox *new=malloc(sizeof(mailbox));
if(sem_init(new->mailavailable,0,0));
The program segfaults in the sem_init()
My thanks.
I am trying to make two linked lists. My nodes are defined as follows:
typedef struct{
char *message;
int msglength;
pthread_t sender;
mail *next;
}mail;
typedef struct{
Thanks for the help guys. This was a programing assignment designed to learn system calls on a unix based system. Therefore, I decided to use the system("cat -u ....") command.
I have a program that creates multiple binary files. The problem is that I need to merge the files together. I can use the cat command afterwards and merge the files by hand. I would like however to...
It works if i do that. However, As soon as I try to access an element from the struct by doing p1->start I get a seg fault. It is just starting to ........ me off.
The hash can hold any object.
Here we go. So i passed a struct object into my hashtable with a key. The hashtable when called upon with the key returns a (void *). I want to set my local struct equal to the data at that (void *)....
Yah I forgot about that. I how would I pass that back then. The function accepts a string splits it up into integers and puts it into an array. Now, I need that array but I am not supposed to use...
Ok i have a function that returns an address to an array of ints which contains 4 items. How do I assign the contents of that address to a local variable.
The return statements is this return...