static int sys_openat(int dirfd, const char *pathname, int flags, ...)

{

  /*

   * open(2) has extra parameter 'mode' when called with

   * flag O_CREAT.

   */

  if ((flags & O_CREAT) != 0) {

      va_list ap;

      mode_t mode;



      /*

       * Get the 'mode' parameter and translate it to

       * host bits.

       */

      va_start(ap, flags);

      mode = va_arg(ap, mode_t);

      mode = target_to_host_bitmask(mode, fcntl_flags_tbl);

      va_end(ap);



      return (openat(dirfd, pathname, flags, mode));

  }

  return (openat(dirfd, pathname, flags));

}

static int sys_openat(int dirfd, const char *pathname, int flags, ...)

{

  







  if ((flags & O_CREAT) != 0) {

      va_list ap;

      mode_t mode;



      







      va_start(ap, flags);

      mode = va_arg(ap, mode_t);

      mode = target_to_host_bitmask(mode, fcntl_flags_tbl);

      va_end(ap);



      return (openat(dirfd, pathname, flags, mode));

  }

  return (openat(dirfd, pathname, flags));

}

static int FUNC_0(int VAR_0, const char *VAR_1, int VAR_2, ...)

{

  







  if ((VAR_2 & O_CREAT) != 0) {

      va_list ap;

      mode_t mode;



      







      va_start(ap, VAR_2);

      mode = va_arg(ap, mode_t);

      mode = target_to_host_bitmask(mode, fcntl_flags_tbl);

      va_end(ap);



      return (openat(VAR_0, VAR_1, VAR_2, mode));

  }

  return (openat(VAR_0, VAR_1, VAR_2));

}

static int FUNC_0(int VAR_0, const char *VAR_1, int VAR_2, ...)
{ if ((VAR_2 & O_CREAT) != 0) { va_list ap; mode_t mode; va_start(ap, VAR_2); mode = va_arg(ap, mode_t); mode = target_to_host_bitmask(mode, fcntl_flags_tbl); va_end(ap); return (openat(VAR_0, VAR_1, VAR_2, mode)); } return (openat(VAR_0, VAR_1, VAR_2)); }