asmlinkage long sys32_getresgid16(u16 __user *rgid, u16 __user *egid, u16 __user *sgid) { int retval; if (!(retval = put_user(high2lowgid(current->gid), rgid)) && !(retval = put_user(high2lowgid(current->egid), egid))) retval = put_user(high2lowgid(current->sgid), sgid); return retval; }
asmlinkage long sys_getresgid16(old_gid_t *rgid, old_gid_t *egid, old_gid_t *sgid) { int retval; if (!(retval = put_user(high2lowgid(current->gid), rgid)) && !(retval = put_user(high2lowgid(current->egid), egid))) retval = put_user(high2lowgid(current->sgid), sgid); return retval; }
SYSCALL_DEFINE3(getresgid16, old_gid_t __user *, rgid, old_gid_t __user *, egid, old_gid_t __user *, sgid) { const struct cred *cred = current_cred(); int retval; if (!(retval = put_user(high2lowgid(cred->gid), rgid)) && !(retval = put_user(high2lowgid(cred->egid), egid))) retval = put_user(high2lowgid(cred->sgid), sgid); return retval; }
int cp_compat_stat(struct kstat *stat, struct compat_stat __user *statbuf) { compat_ino_t ino; int err; if (stat->size > MAX_NON_LFS || !old_valid_dev(stat->dev) || !old_valid_dev(stat->rdev)) return -EOVERFLOW; ino = stat->ino; if (sizeof(ino) < sizeof(stat->ino) && ino != stat->ino) return -EOVERFLOW; err = put_user(old_encode_dev(stat->dev), &statbuf->st_dev); err |= put_user(stat->ino, &statbuf->st_ino); err |= put_user(stat->mode, &statbuf->st_mode); err |= put_user(stat->nlink, &statbuf->st_nlink); err |= put_user(high2lowuid(stat->uid), &statbuf->st_uid); err |= put_user(high2lowgid(stat->gid), &statbuf->st_gid); err |= put_user(old_encode_dev(stat->rdev), &statbuf->st_rdev); err |= put_user(stat->size, &statbuf->st_size); err |= put_user(stat->atime.tv_sec, &statbuf->st_atime); err |= put_user(stat->atime.tv_nsec, &statbuf->st_atime_nsec); err |= put_user(stat->mtime.tv_sec, &statbuf->st_mtime); err |= put_user(stat->mtime.tv_nsec, &statbuf->st_mtime_nsec); err |= put_user(stat->ctime.tv_sec, &statbuf->st_ctime); err |= put_user(stat->ctime.tv_nsec, &statbuf->st_ctime_nsec); err |= put_user(stat->blksize, &statbuf->st_blksize); err |= put_user(stat->blocks, &statbuf->st_blocks); err |= put_user(0, &statbuf->__unused4[0]); err |= put_user(0, &statbuf->__unused4[1]); return err; }
static int groups16_to_user(old_gid_t __user *grouplist, struct group_info *group_info) { int i; old_gid_t group; for (i = 0; i < group_info->ngroups; i++) { group = high2lowgid(GROUP_AT(group_info, i)); if (put_user(group, grouplist+i)) return -EFAULT; } return 0; }
asmlinkage long sys_getegid16(void) { return high2lowgid(current->egid); }
asmlinkage long sys32_getgid16(void) { return high2lowgid(current->gid); }