Find the answer to your Linux question:
Results 1 to 9 of 9
hi i've been using knoppix for a few weeks because of a class at the university. this class is basically learning how to create processes in linux using C language. ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined! Dpontes11's Avatar
    Join Date
    Nov 2005
    Location
    Gondomar, Portugal
    Posts
    68

    Creating FIFO's


    hi

    i've been using knoppix for a few weeks because of a class at the university. this class is basically learning how to create processes in linux using C language.

    the problem i'm having is the following:

    im tying to use the named pipes, known as FIFO's. the thing is, when i try to create a normal unnamed pipe, it creates it and works without any problem. however, when i want to create a FIFO, it doesn't create it.

    it's not a instructional error, as i've shown this problem to my teacher.

    he said it might be because simply knoppix doesn't give me permitions to create this FIFO.

    any sugestions on what I should do, if in fact there is something i can do?

    thanx

  2. #2
    Linux Guru lakerdonald's Avatar
    Join Date
    Jun 2004
    Location
    St. Petersburg, FL
    Posts
    5,035
    How are you creating this FIFO? What is the exact mkfifo invocation you're using?

  3. #3
    Just Joined! Dpontes11's Avatar
    Join Date
    Nov 2005
    Location
    Gondomar, Portugal
    Posts
    68
    sorry about the delay... no internet acess for the last few days!

    the code i'm using is:
    Code:
    unlink("temp_fifo");
    mknod("temp_fifo",S_IFIFO|0660,0);
    when testing this last line, it returns (-1), which means that the creation on the FIFO failed.

    anyway, i hope this brings new light to someone who might be able to help me out...

    thanx

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru lakerdonald's Avatar
    Join Date
    Jun 2004
    Location
    St. Petersburg, FL
    Posts
    5,035
    Okay, include <errno.h> and <stdio.h>, then add:
    Code:
    perror&#40;NULL&#41;;
    after the mknod() so that you can see what the exact error was.

  6. #5
    Just Joined! Dpontes11's Avatar
    Join Date
    Nov 2005
    Location
    Gondomar, Portugal
    Posts
    68
    Ok, i'll do that.

    I've been told by a friend that Knoppix really doesn't allow the creation of FIFO's, but still there could be a way...

    thanks

  7. #6
    Just Joined! Dpontes11's Avatar
    Join Date
    Nov 2005
    Location
    Gondomar, Portugal
    Posts
    68
    Ok, so this is what came up:

    Code:
    Operation Not Permitted
    a bit generalistic, i guess...

    Maybe knoppix really doens allow the creation of FIFO's.

  8. #7
    Linux Guru lakerdonald's Avatar
    Join Date
    Jun 2004
    Location
    St. Petersburg, FL
    Posts
    5,035
    Are you root at the time?

  9. #8
    Just Joined! Dpontes11's Avatar
    Join Date
    Nov 2005
    Location
    Gondomar, Portugal
    Posts
    68
    yes,i am... any suggestions yet, or are you as lost as me?

  10. #9
    Linux Guru lakerdonald's Avatar
    Join Date
    Jun 2004
    Location
    St. Petersburg, FL
    Posts
    5,035
    Well according to
    Code:
    errno&#40;3&#41;
    , "Operation not Permitted" is associated with EPERM. According to mknod(2):
    Code:
     EPERM  mode requested creation of something other than a regular  file,
                  FIFO  &#40;named pipe&#41;, or Unix domain socket, and the caller is not
                  privileged &#40;Linux&#58; does not have the CAP_MKNOD capability&#41;; also
                  returned  if the filesystem containing pathname does not support
                  the type of node requested.
    What kind of filesystem are you trying this on?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •