int u_getpwuid_r_ocall()

in sgx_ustdc/env.c [76:91]


int u_getpwuid_r_ocall(uid_t uid,
                       struct passwd *pwd,
                       char *buf,
                       size_t buflen,
                       struct passwd **passwd_result)
{
    int ret = getpwuid_r(uid, pwd, buf, buflen, passwd_result);
    if (ret == 0 && *passwd_result != NULL) {
        pwd->pw_name = pwd->pw_name ? (char *)(pwd->pw_name - buf) : (char *)-1;
        pwd->pw_passwd = pwd->pw_passwd ? (char *)(pwd->pw_passwd - buf) : (char *)-1;
        pwd->pw_gecos = pwd->pw_gecos ? (char *)(pwd->pw_gecos - buf) : (char *)-1;
        pwd->pw_dir = pwd->pw_dir ? (char *)(pwd->pw_dir - buf) : (char *)-1;
        pwd->pw_shell = pwd->pw_shell ? (char *)(pwd->pw_shell - buf) : (char *)-1;
    }
    return ret;
}