Search:

Type: Posts; User: mattholm

Search: Search took 0.01 seconds.

  1. Replies
    1
    Views
    1,713

    execl and printenv

    hi, im trying to execute printenv by writing:


    execl("/opt/gnu/bin/printenv", Null);

    but this doesnt work, is the code wrong or is the path wrong? (maybe it depends on system but how do find...
  2. Replies
    8
    Views
    1,333

    Thank you!!! it should be + sizeof(Header); ...

    Thank you!!! it should be + sizeof(Header);

    thanks alot! :)
  3. Replies
    8
    Views
    1,333

    I was hoping this line oldsize = ((Header...

    I was hoping this line


    oldsize = ((Header *)oldp - 1)->s.size * sizeof(Header);

    would make the oldp point to the header
  4. Replies
    8
    Views
    1,333

    the malloc first-fit and free part is from a book...

    the malloc first-fit and free part is from a book (so I will only write realloc and worst and bestfit for malloc) and the Header comes from this:



    typedef long Align; /*for alignment to long...
  5. Replies
    8
    Views
    1,333

    im writing a little library with malloc, realloc...

    im writing a little library with malloc, realloc and free and then im gonna do some performance analysis and compare with the built in functions. any ideas of why i get segmentationsfaults?
  6. Replies
    8
    Views
    1,333

    problem with realloc

    hi can anyone tell me whats wrong with my realloc
    I get segmentationfault when my testprogram does: p = realloc(p, 4711);



    void *realloc(void *oldp, size_t size)
    {
    if (oldp == NULL){ ...
  7. Replies
    5
    Views
    2,344

    i have tried that and it didnt work. sorry for...

    i have tried that and it didnt work. sorry for not saying so. if i put -pg in the end nothing happens (I get a new prompt but nothing more) and if I put it right after tstmalloc I get lots of errors...
  8. Replies
    5
    Views
    2,344

    in the many minutes that have passed i have...

    in the many minutes that have passed i have learned how to use it on a single program but not how to do it with my 2 programs. (where in the command to put it) any ideas for how to do that?

    the...
  9. Replies
    5
    Views
    2,344

    how to use gprof

    hi, i have written my own malloc and now I want to test it with a test program and use gprof to measure the performance.
    my to programs are: malloc.c and tstmalloc.c.

    how do i do this? I think it...
  10. Replies
    1
    Views
    2,323

    dereferencing void pointers in my realloc

    hi, can anyone tell me how to get around these problems?
    the two problems is:
    1. dereferencing "void *"-pointer
    2. the value of the type void is not ignored, as it should.



    /*realloc: change...
  11. Replies
    6
    Views
    3,386

    Thank you! :)

    Thank you! :)
  12. Replies
    6
    Views
    3,386

    forgot to say I did a minor change to it but it...

    forgot to say I did a minor change to it but it just keeps printing out the number 1.
  13. Replies
    6
    Views
    3,386

    ok, this is all of my code, im working in ubuntu...

    ok, this is all of my code, im working in ubuntu and compiling by writing "gcc -o 23 23.c" in the shell. i dont get any warnings but i dont know how to turn up the warning lvl.

    thanks for helping...
  14. Replies
    6
    Views
    3,386

    waitpid behaving strange...

    hi, my waitpid is behaving really strange can u see what im dooing wrong?
    (when my background processes are finished it prints out pid as 1 instead of the real pid and it never does the else part)
    ...
  15. Replies
    2
    Views
    1,344

    thank you very much!

    thank you very much!
  16. Replies
    2
    Views
    1,344

    whats wrong with my strcmp?

    hi, i think something is wrong with my strcmp since i never get the output "exiting" even if i write "exit"



    #include <stdio.h>
    #include <stdlib.h>
    #define MAXSIZE 200
    #include <sys/types.h>...
  17. Replies
    5
    Views
    4,122

    Thanks!

    Thanks!
  18. Replies
    5
    Views
    4,122

    strtok and execvp behaving wierd

    hi, i want to be able to type in "ls" but I need to type in "ls ls" to make it happen. what am I doing wrong?



    #include <sys/types.h>
    #include <unistd.h>
    #include <stdio.h>
    #include...
  19. Replies
    2
    Views
    3,113

    problem with fgets and execvp

    hi, im trying to read input from the user with fgets for example "ls" then use execvp to make the command happen but when i try it nothing happens. what am i missing?



    #include <sys/types.h>...
Results 1 to 19 of 19