Create file link connect function handler

QNX SDP8.0Getting Started with the QNX OSDeveloperUser

Prototype:

int (*link) ( resmgr_context_t *ctp,
              io_link_t *msg,
              RESMGR_HANDLE_T *handle,
              io_link_extra_t *extra ) 

Classification:

Connect

Default handler:

none

Helper functions:

iofunc_link()

Client functions:

link(), linkat(), symlink(), symlinkat()

Messages:

_IO_CONNECT with subtype _IO_CONNECT_LINK

Data structure:

struct _io_connect {
  // internal fields (as described above)
  uint16_t path_len;
  uint8_t  extra_type;
  uint16_t extra_len;
  char     path [1];
};

struct _io_connect_link_reply {
  uint32_t reserved1;
  uint32_t file_type;
  uint8_t  eflag;
  uint8_t  reserved2[1];
  uint16_t chroot_len;
  uint32_t umask;
  uint16_t nentries;
  uint16_t path_len;
};

struct _io_connect_ftype_reply {
  uint16_t status;      /* Typically an errno */
  uint16_t reserved;
  uint32_t file_type;   /* _FTYPE_? in sys/ftype.h */
};

typedef union {
  struct _io_connect             connect;
  struct _io_connect_link_reply  link_reply;
  struct _io_connect_ftype_reply ftype_reply;
} io_link_t;

typedef union _io_link_extra {
  struct _io_resmgr_link_extra  resmgr;
  char                          path[];
} io_link_extra_t;

Description:

Creates a new link with the name given in the path member of msg to the existing pathname or symlink content specified by the path member of extra.

The mapping of the client function arguments to the message elements on the resource manager side is as follows:

Client function Argument in msg->path Argument in msg->extra
link() new existing
linkat() the path in newpath resolved with the directory indicated by newdirfd the path in oldpath resolved with the directory indicated by olddirfd
symlink() slink pname
symlinkat() the path in path resolved with the directory indicated by dirfd psymlink

Returns:

The status via the helper macro _RESMGR_STATUS().

Referenced by:

resmgr_connect_funcs_t connect table
Page updated: