User Profile

Collapse

Profile Sidebar

Collapse
what
what
Last Activity: Jun 27 '12, 11:26 PM
Joined: May 2 '12
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • what
    replied to I get segmentation fault with "shmat" function
    in C
    I forgot to write that the error line is "*seg_part = 0;"
    See more | Go to post

    Leave a comment:


  • what
    started a topic I get segmentation fault with "shmat" function
    in C

    I get segmentation fault with "shmat" function

    I want to write in a file called "sharedmem" which is in the same directory that the code, but i get segmentation fault. I think I have found the line of the error, but i dont know how to solve it.
    This is the code:

    Code:
    #include <stdio.h>
    #include <stdlib.h>
    #include <sys/shm.h>
    #include <errno.h>
    
    long int *seg_part;
    
    void abandon(char message[]){
    	perror(message);
    ...
    See more | Go to post
    Last edited by Banfa; May 3 '12, 08:35 AM. Reason: Added code tags round the code
No activity results to display
Show More
Working...