XS-libuv

 view release on metacpan or  search on metacpan

libuv-1.49.2/ChangeLog  view on Meta::CPAN

* ibmi: Implement UDP disconnect (V-for-Vasili)

* doc: update active maintainers list (Ben Noordhuis)

* build: fix kFreeBSD build (James McCoy)

* build: remove Windows 2016 workflows (Darshan Sen)

* Revert "win,errors: remap ERROR_ACCESS_DENIED to UV_EACCES" (Darshan Sen)

* unix: simplify getpwuid call (Jameson Nash)

* build: filter CI by paths and branches (Jameson Nash)

* build: add iOS to macos CI (Jameson Nash)

* build: re-enable CI for windows changes (Jameson Nash)

* process,iOS: fix build breakage in process.c (Denny C. Dai)

* test: remove unused declarations in tcp_rst test (V-for-Vasili)

libuv-1.49.2/ChangeLog  view on Meta::CPAN

* include: add EOVERFLOW status code mapping (Darshan Sen)

* unix,fs: use uv__load_relaxed and uv__store_relaxed (Darshan Sen)

* win: fix string encoding issue of uv_os_gethostname (Eagle Liang)

* unix,process: add uv__write_errno helper function (Ricky Zhou)

* Re-merge "unix,stream: clear read/write states on close/eof" (Jameson Nash)

* unix,core: fix errno handling in uv__getpwuid_r (Darshan Sen)

* errors: map ESOCKTNOSUPPORT errno (Ryan Liptak)

* doc: uv_read_stop always succeeds (Simon Kissane)

* inet: fix inconsistent return value of inet_ntop6 (twosee)

* darwin: fix -Wsometimes-uninitialized warning (twosee)

* stream: introduce uv_try_write2 function (twosee)

libuv-1.49.2/ChangeLog  view on Meta::CPAN


* unix,win: add uv_if_{indextoname,indextoiid} (Pekka Nikander)


2017.10.03, Version 1.15.0 (Stable), 8b69ce1419d2958011d415a636810705c36c2cc2

Changes since version 1.14.1:

* unix: limit uv__has_forked_with_cfrunloop to macOS (Kamil Rytarowski)

* win: fix buffer size in uv__getpwuid_r() (tux.uudiin)

* win,tty: improve SIGWINCH support (Bartosz Sosnowski)

* unix: use fchmod() in uv_fs_copyfile() (cjihrig)

* unix: support copying empty files (cjihrig)

* unix: truncate destination in uv_fs_copyfile() (Nick Logan)

* win,build: keep cwd when setting build environment (darobs)

libuv-1.49.2/docs/src/misc.rst  view on Meta::CPAN


    Changes the current working directory.

.. c:function:: int uv_os_homedir(char* buffer, size_t* size)

    Gets the current user's home directory. On Windows, `uv_os_homedir()` first
    checks the `USERPROFILE` environment variable using
    `GetEnvironmentVariableW()`. If `USERPROFILE` is not set,
    `GetUserProfileDirectoryW()` is called. On all other operating systems,
    `uv_os_homedir()` first checks the `HOME` environment variable using
    :man:`getenv(3)`. If `HOME` is not set, :man:`getpwuid_r(3)` is called. The
    user's home directory is stored in `buffer`. When `uv_os_homedir()` is
    called, `size` indicates the maximum size of `buffer`. On success `size` is set
    to the string length of `buffer`. On `UV_ENOBUFS` failure `size` is set to the
    required length for `buffer`, including the null byte.

    .. warning::
        `uv_os_homedir()` is not thread safe.

    .. versionadded:: 1.6.0

libuv-1.49.2/docs/src/misc.rst  view on Meta::CPAN

    .. warning::
        `uv_os_tmpdir()` is not thread safe.

    .. versionadded:: 1.9.0

.. c:function:: int uv_os_get_passwd(uv_passwd_t* pwd)

    Gets a subset of the password file entry for the current effective uid (not
    the real uid). The populated data includes the username, euid, gid, shell,
    and home directory. On non-Windows systems, all data comes from
    :man:`getpwuid_r(3)`. On Windows, uid and gid are set to -1 and have no
    meaning, and shell is `NULL`. After successfully calling this function, the
    memory allocated to `pwd` needs to be freed with
    :c:func:`uv_os_free_passwd`.

    .. versionadded:: 1.9.0

.. c:function:: int uv_os_get_passwd2(uv_passwd_t* pwd, uv_uid_t uid)

    Gets a subset of the password file entry for the provided uid.
    The populated data includes the username, euid, gid, shell,
    and home directory. On non-Windows systems, all data comes from
    :man:`getpwuid_r(3)`. On Windows, uid and gid are set to -1 and have no
    meaning, and shell is `NULL`. After successfully calling this function, the
    memory allocated to `pwd` needs to be freed with
    :c:func:`uv_os_free_passwd`.

    .. versionadded:: 1.45.0

.. c:function:: int uv_os_get_group(uv_group_t* group, uv_uid_t gid)

    Gets a subset of the group file entry for the provided uid.
    The populated data includes the group name, gid, and members. On non-Windows

libuv-1.49.2/src/unix/core.c  view on Meta::CPAN

  }

  memcpy(buffer, buf, len + 1);
  buffer[len] = '\0';
  *size = len;

  return 0;
}


static int uv__getpwuid_r(uv_passwd_t *pwd, uid_t uid) {
  struct passwd pw;
  struct passwd* result;
  char* buf;
  size_t bufsize;
  size_t name_size;
  size_t homedir_size;
  size_t shell_size;
  int r;

  if (pwd == NULL)

libuv-1.49.2/src/unix/core.c  view on Meta::CPAN

  /* Calling sysconf(_SC_GETPW_R_SIZE_MAX) would get the suggested size, but it
   * is frequently 1024 or 4096, so we can just use that directly. The pwent
   * will not usually be large. */
  for (bufsize = 2000;; bufsize *= 2) {
    buf = uv__malloc(bufsize);

    if (buf == NULL)
      return UV_ENOMEM;

    do
      r = getpwuid_r(uid, &pw, buf, bufsize, &result);
    while (r == EINTR);

    if (r != 0 || result == NULL)
      uv__free(buf);

    if (r != ERANGE)
      break;
  }

  if (r != 0)

libuv-1.49.2/src/unix/core.c  view on Meta::CPAN

  grp->gid = gp.gr_gid;

  uv__free(buf);

  return 0;
#endif
}


int uv_os_get_passwd(uv_passwd_t* pwd) {
  return uv__getpwuid_r(pwd, geteuid());
}


int uv_os_get_passwd2(uv_passwd_t* pwd, uv_uid_t uid) {
  return uv__getpwuid_r(pwd, uid);
}


int uv_translate_sys_error(int sys_errno) {
  /* If < 0 then it's already a libuv error. */
  return sys_errno <= 0 ? sys_errno : -sys_errno;
}


int uv_os_environ(uv_env_item_t** envitems, int* count) {

libuv-1.49.2/src/win/util.c  view on Meta::CPAN

  } else {
    *size -= 1; /* Reserve space for NUL. */
    r = uv_utf16_to_wtf8(utf16buffer, utf16len, &utf8, size);
  }
  if (r == UV_ENOBUFS)
    *size += 1; /* Add space for NUL. */
  return r;
}


static int uv__getpwuid_r(uv_passwd_t* pwd) {
  HANDLE token;
  wchar_t username[UNLEN + 1];
  wchar_t *path;
  DWORD bufsize;
  int r;

  if (pwd == NULL)
    return UV_EINVAL;

  /* Get the home directory using GetUserProfileDirectoryW() */

libuv-1.49.2/src/win/util.c  view on Meta::CPAN


  pwd->shell = NULL;
  pwd->uid = -1;
  pwd->gid = -1;

  return 0;
}


int uv_os_get_passwd(uv_passwd_t* pwd) {
  return uv__getpwuid_r(pwd);
}


int uv_os_get_passwd2(uv_passwd_t* pwd, uv_uid_t uid) {
  return UV_ENOTSUP;
}


int uv_os_get_group(uv_group_t* grp, uv_uid_t gid) {
  return UV_ENOTSUP;



( run in 0.299 second using v1.01-cache-2.11-cpan-454fe037f31 )