Logo Search packages:      
Sourcecode: fuse version File versions  Download package

struct fuse_cmd* fuse_read_cmd ( struct fuse f ) [read]

Read a single command. If none are read, return NULL

Definition at line 3414 of file fuse.c.

References fuse_chan_bufsize(), fuse_chan_recv(), fuse_exit(), fuse_read_cmd(), and fuse_session_next_chan().

Referenced by fuse_read_cmd().

{
      struct fuse_chan *ch = fuse_session_next_chan(f->se, NULL);
      size_t bufsize = fuse_chan_bufsize(ch);
      struct fuse_cmd *cmd = fuse_alloc_cmd(bufsize);
      if (cmd != NULL) {
            int res = fuse_chan_recv(&ch, cmd->buf, bufsize);
            if (res <= 0) {
                  free_cmd(cmd);
                  if (res < 0 && res != -EINTR && res != -EAGAIN)
                        fuse_exit(f);
                  return NULL;
            }
            cmd->buflen = res;
            cmd->ch = ch;
      }
      return cmd;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index