aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin/grp.cc
diff options
context:
space:
mode:
authorKen Brown <kbrown@cornell.edu>2022-05-22 15:16:47 -0400
committerKen Brown <kbrown@cornell.edu>2022-05-29 17:45:52 -0400
commit7c0de0af97d35c8fed5ffbf311e54af85d1c4af3 (patch)
tree3bb55b0481abfc813711fa0e21f591eeea53cf76 /winsup/cygwin/grp.cc
parent98180795ded4dae9bb5d24e7d38a4589fca9a0cf (diff)
downloadnewlib-7c0de0af97d35c8fed5ffbf311e54af85d1c4af3.zip
newlib-7c0de0af97d35c8fed5ffbf311e54af85d1c4af3.tar.gz
newlib-7c0de0af97d35c8fed5ffbf311e54af85d1c4af3.tar.bz2
Cygwin: remove some 32-bit-only function definitions
Remove the definitions of the following: acl, aclcheck, aclfrommode, aclfrompbits, aclfromtext, aclsort, acltomode, acltopbits, acltotext, chown, fchown, _fcntl, fstat, _fstat_r, ftruncate, getegid, geteuid, getgid, getgrent, getgrgid, getgrnam, getgroups, getpwduid, getpwuid, getpwuid_r, getuid, initgroups, lacl, lacl32, lchown, lseek, lstat, mknod, mmap, setegid, seteuid, setgid, setgroups, setregid, setreuid, setuid, stat, _stat_r, truncate. [For most of these, the corresponding 64-bit entry points are obtained by exporting aliases. For example, acl is an alias for acl32, and truncate is an alias for truncate64.] Remove the following structs and all code using them (which is 32-bit only): __stat32, __group16, __flock32, __aclent16_t. Remove the typedefs of __blkcnt32_t __dev16_t, __ino32_t, which are used only in code that has been removed. Put the typedefs of __uid16_t and __gid16_t in one header, instead of one header if __INSIDE_CYGWIN__ is defined and a different header otherwise.
Diffstat (limited to 'winsup/cygwin/grp.cc')
-rw-r--r--winsup/cygwin/grp.cc98
1 files changed, 0 insertions, 98 deletions
diff --git a/winsup/cygwin/grp.cc b/winsup/cygwin/grp.cc
index 23e2d02..893e4cc 100644
--- a/winsup/cygwin/grp.cc
+++ b/winsup/cygwin/grp.cc
@@ -237,24 +237,6 @@ internal_getgrgid (gid_t gid, cyg_ldap *pldap)
return NULL;
}
-#ifdef __i386__
-static struct __group16 *
-grp32togrp16 (struct __group16 *gp16, struct group *gp32)
-{
- if (!gp16 || !gp32)
- return NULL;
-
- /* Copying the pointers is actually unnecessary. Just having the correct
- return type is important. */
- gp16->gr_name = gp32->gr_name;
- gp16->gr_passwd = gp32->gr_passwd;
- gp16->gr_gid = (__gid16_t) gp32->gr_gid; /* Not loss-free */
- gp16->gr_mem = gp32->gr_mem;
-
- return gp16;
-}
-#endif
-
extern "C" int
getgrgid_r (gid_t gid, struct group *grp, char *buffer, size_t bufsize,
struct group **result)
@@ -325,17 +307,7 @@ getgrgid32 (gid_t gid)
return getgr_cp (tempgr);
}
-#ifdef __x86_64__
EXPORT_ALIAS (getgrgid32, getgrgid)
-#else
-extern "C" struct __group16 *
-getgrgid (__gid16_t gid)
-{
- static struct __group16 g16; /* FIXME: thread-safe? */
-
- return grp32togrp16 (&g16, getgrgid32 (gid16togid32 (gid)));
-}
-#endif
extern "C" int
getgrnam_r (const char *nam, struct group *grp, char *buffer,
@@ -375,17 +347,7 @@ getgrnam32 (const char *name)
return getgr_cp (tempgr);
}
-#ifdef __x86_64__
EXPORT_ALIAS (getgrnam32, getgrnam)
-#else
-extern "C" struct __group16 *
-getgrnam (const char *name)
-{
- static struct __group16 g16; /* FIXME: thread-safe? */
-
- return grp32togrp16 (&g16, getgrnam32 (name));
-}
-#endif
/* getgrent functions are not reentrant. */
static gr_ent grent;
@@ -502,17 +464,7 @@ getgrent32 (void)
return grent.getgrent ();
}
-#ifdef __x86_64__
EXPORT_ALIAS (getgrent32, getgrent)
-#else
-extern "C" struct __group16 *
-getgrent ()
-{
- static struct __group16 g16; /* FIXME: thread-safe? */
-
- return grp32togrp16 (&g16, getgrent32 ());
-}
-#endif
extern "C" void
endgrent (void)
@@ -701,31 +653,7 @@ getgroups32 (int gidsetsize, gid_t *grouplist)
return internal_getgroups (gidsetsize, grouplist, &cldap);
}
-#ifdef __x86_64__
EXPORT_ALIAS (getgroups32, getgroups)
-#else
-extern "C" int
-getgroups (int gidsetsize, __gid16_t *grouplist)
-{
- gid_t *grouplist32 = NULL;
-
- if (gidsetsize < 0)
- {
- set_errno (EINVAL);
- return -1;
- }
- if (gidsetsize > 0 && grouplist)
- grouplist32 = (gid_t *) alloca (gidsetsize * sizeof (gid_t));
-
- int ret = getgroups32 (gidsetsize, grouplist32);
-
- if (gidsetsize > 0 && grouplist)
- for (int i = 0; i < ret; ++ i)
- grouplist[i] = grouplist32[i];
-
- return ret;
-}
-#endif
/* Core functionality of initgroups and getgrouplist. */
static void
@@ -759,15 +687,7 @@ initgroups32 (const char *user, gid_t gid)
return 0;
}
-#ifdef __x86_64__
EXPORT_ALIAS (initgroups32, initgroups)
-#else
-extern "C" int
-initgroups (const char *user, __gid16_t gid)
-{
- return initgroups32 (user, gid16togid32(gid));
-}
-#endif
extern "C" int
getgrouplist (const char *user, gid_t gid, gid_t *groups, int *ngroups)
@@ -837,22 +757,4 @@ setgroups32 (int ngroups, const gid_t *grouplist)
return 0;
}
-#ifdef __i386__
-extern "C" int
-setgroups (int ngroups, const __gid16_t *grouplist)
-{
- gid_t *grouplist32 = NULL;
-
- if (ngroups > 0 && grouplist)
- {
- grouplist32 = (gid_t *) alloca (ngroups * sizeof (gid_t));
- if (grouplist32 == NULL)
- return -1;
- for (int i = 0; i < ngroups; i++)
- grouplist32[i] = grouplist[i];
- }
- return setgroups32 (ngroups, grouplist32);
-}
-#else
EXPORT_ALIAS (setgroups32, setgroups)
-#endif