From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2210) id 4EDA03870870; Mon, 30 May 2022 15:06:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4EDA03870870 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Ken Brown To: cygwin-cvs@sourceware.org, newlib-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: simplify some function names X-Act-Checkin: newlib-cygwin X-Git-Author: Ken Brown X-Git-Refname: refs/heads/master X-Git-Oldrev: 7c0de0af97d35c8fed5ffbf311e54af85d1c4af3 X-Git-Newrev: 2d9b48760c48f19b2941f05ee6720f510700823c Message-Id: <20220530150645.4EDA03870870@sourceware.org> Date: Mon, 30 May 2022 15:06:45 +0000 (GMT) X-BeenThere: newlib-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib GIT logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 May 2022 15:06:45 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D2d9b48760c4= 8f19b2941f05ee6720f510700823c commit 2d9b48760c48f19b2941f05ee6720f510700823c Author: Ken Brown Date: Sun May 22 15:18:48 2022 -0400 Cygwin: simplify some function names =20 Remove "32" or "64" from each of the following names: acl32, aclcheck32, aclfrommode32, aclfrompbits32, aclfromtext32, aclsort32, acltomode32, acltopbits32, acltotext32, facl32, fchown32, fcntl64, fstat64, _fstat64, _fstat64_r, ftruncate64, getgid32, getgrent32, getgrgid32, getgrnam32, getgroups32, getpwuid32, getpwuid_r32, getuid32, getuid32, initgroups32, lseek64, lstat64, mknod32, mmap64, setegid32, seteuid32, setgid32, setgroups32, setregid32, setreuid32, setuid32, stat64, _stat64_r, truncate64. =20 Remove prototypes and macro definitions of these names. =20 Remove "#ifndef __INSIDE_CYGWIN__" from some headers so that the new names will be available when compiling Cygwin. =20 Remove aliases that are no longer needed. =20 Include in fhandler_clipboard.cc for the declarations of geteuid and getegid. Diff: --- newlib/libc/include/pwd.h | 2 +- newlib/libc/include/sys/stat.h | 2 +- newlib/libc/include/sys/unistd.h | 16 +---- newlib/libc/posix/posix_spawn.c | 11 --- winsup/cygwin/cygheap.h | 2 +- winsup/cygwin/cygmalloc.h | 2 - winsup/cygwin/cygserver_ipc.h | 4 +- winsup/cygwin/fcntl.cc | 5 +- winsup/cygwin/fhandler.cc | 4 +- winsup/cygwin/fhandler_clipboard.cc | 5 +- winsup/cygwin/fhandler_disk_file.cc | 2 +- winsup/cygwin/fhandler_process.cc | 2 +- winsup/cygwin/fhandler_raw.cc | 4 +- winsup/cygwin/fhandler_socket_local.cc | 8 +-- winsup/cygwin/fhandler_tty.cc | 2 +- winsup/cygwin/glob.cc | 7 +- winsup/cygwin/grp.cc | 28 +++----- winsup/cygwin/include/cygwin/acl.h | 2 - winsup/cygwin/include/cygwin/grp.h | 7 -- winsup/cygwin/include/cygwin/stat.h | 10 --- winsup/cygwin/include/sys/mman.h | 2 - winsup/cygwin/ipc.cc | 2 +- winsup/cygwin/libc/fts.c | 9 --- winsup/cygwin/libc/minires.c | 4 +- winsup/cygwin/libc/rcmd.cc | 13 ++-- winsup/cygwin/libc/rexec.cc | 4 +- winsup/cygwin/mktemp.cc | 4 +- winsup/cygwin/mmap.cc | 8 +-- winsup/cygwin/passwd.cc | 8 +-- winsup/cygwin/path.cc | 4 +- winsup/cygwin/posix_ipc.cc | 10 +-- winsup/cygwin/sec_acl.cc | 41 ++++------- winsup/cygwin/security.cc | 4 +- winsup/cygwin/security.h | 2 - winsup/cygwin/syscalls.cc | 121 +++++++++++++----------------= ---- winsup/cygwin/uinfo.cc | 16 ++--- winsup/cygwin/winsup.h | 7 -- 37 files changed, 124 insertions(+), 260 deletions(-) diff --git a/newlib/libc/include/pwd.h b/newlib/libc/include/pwd.h index baae88410..45d1594ea 100644 --- a/newlib/libc/include/pwd.h +++ b/newlib/libc/include/pwd.h @@ -55,10 +55,10 @@ struct passwd { char *pw_shell; /* default shell */ }; =20 -#ifndef __INSIDE_CYGWIN__ struct passwd *getpwuid (uid_t); struct passwd *getpwnam (const char *); =20 +#ifndef __INSIDE_CYGWIN__ #if __MISC_VISIBLE || __POSIX_VISIBLE int getpwnam_r (const char *, struct passwd *, char *, size_t , struct passwd **); diff --git a/newlib/libc/include/sys/stat.h b/newlib/libc/include/sys/stat.h index 6525272dd..98f5addb4 100644 --- a/newlib/libc/include/sys/stat.h +++ b/newlib/libc/include/sys/stat.h @@ -142,7 +142,7 @@ int mkfifo (const char *__path, mode_t __mode ); int stat (const char *__restrict __path, struct stat *__restrict __sbuf ); mode_t umask (mode_t __mask ); =20 -#if defined (__SPU__) || defined(__rtems__) || defined(__CYGWIN__) && !def= ined(__INSIDE_CYGWIN__) +#if defined (__SPU__) || defined(__rtems__) || defined(__CYGWIN__) int lstat (const char *__restrict __path, struct stat *__restrict __buf ); int mknod (const char *__path, mode_t __mode, dev_t __dev ); #endif diff --git a/newlib/libc/include/sys/unistd.h b/newlib/libc/include/sys/uni= std.h index 3cc313080..216d779d8 100644 --- a/newlib/libc/include/sys/unistd.h +++ b/newlib/libc/include/sys/unistd.h @@ -21,9 +21,7 @@ int access (const char *__path, int __amode); unsigned alarm (unsigned __secs); int chdir (const char *__path); int chmod (const char *__path, mode_t __mode); -#if !defined(__INSIDE_CYGWIN__) int chown (const char *__path, uid_t __owner, gid_t __group); -#endif #if __BSD_VISIBLE || (__XSI_VISIBLE >=3D 4 && __POSIX_VISIBLE < 200112) int chroot (const char *__path); #endif @@ -79,11 +77,9 @@ int fchdir (int __fildes); #if __POSIX_VISIBLE >=3D 199309 int fchmod (int __fildes, mode_t __mode); #endif -#if !defined(__INSIDE_CYGWIN__) #if __BSD_VISIBLE || __XSI_VISIBLE >=3D 4 || __POSIX_VISIBLE >=3D 200809 int fchown (int __fildes, uid_t __owner, gid_t __group); #endif -#endif #if __ATFILE_VISIBLE int fchownat (int __dirfd, const char *__path, uid_t __owner, gid_t __grou= p, int __flags); #endif @@ -106,11 +102,9 @@ int getdomainname (char *__name, size_t __len); #if __BSD_VISIBLE int getentropy (void *, size_t); #endif -#if !defined(__INSIDE_CYGWIN__) gid_t getegid (void); uid_t geteuid (void); gid_t getgid (void); -#endif int getgroups (int __gidsetsize, gid_t __grouplist[]); #if __BSD_VISIBLE || __XSI_VISIBLE >=3D 4 long gethostid (void); @@ -135,9 +129,7 @@ pid_t getppid (void); #if __POSIX_VISIBLE >=3D 200809 || __XSI_VISIBLE >=3D 4 pid_t getsid (pid_t); #endif -#if !defined(__INSIDE_CYGWIN__) uid_t getuid (void); -#endif #if __BSD_VISIBLE || (__XSI_VISIBLE && __XSI_VISIBLE < 500) char * getusershell (void); #endif @@ -151,11 +143,9 @@ int isatty (int __fildes); #if __BSD_VISIBLE int issetugid (void); #endif -#if !defined(__INSIDE_CYGWIN__) #if __BSD_VISIBLE || __XSI_VISIBLE >=3D 4 || __POSIX_VISIBLE >=3D 200809 int lchown (const char *__path, uid_t __owner, gid_t __group); #endif -#endif int link (const char *__path1, const char *__path2); #if __ATFILE_VISIBLE int linkat (int __dirfd1, const char *__path1, int __dirfd2, const cha= r *__path2, int __flags); @@ -198,13 +188,11 @@ int ruserok (const char *rhost, int superuser, const = char *ruser, const char *lu #if __BSD_VISIBLE || (__XSI_VISIBLE >=3D 4 && __POSIX_VISIBLE < 200112) void * sbrk (ptrdiff_t __incr); #endif -#if !defined(__INSIDE_CYGWIN__) #if __BSD_VISIBLE || __POSIX_VISIBLE >=3D 200112 int setegid (gid_t __gid); int seteuid (uid_t __uid); #endif int setgid (gid_t __gid); -#endif #if __BSD_VISIBLE int setgroups (int ngroups, const gid_t *grouplist); #endif @@ -215,14 +203,12 @@ int setpgid (pid_t __pid, pid_t __pgid); #if __SVID_VISIBLE || __XSI_VISIBLE >=3D 500 int setpgrp (void); #endif -#if (__BSD_VISIBLE || __XSI_VISIBLE >=3D 4) && !defined(__INSIDE_CYGWIN__) +#if __BSD_VISIBLE || __XSI_VISIBLE >=3D 4 int setregid (gid_t __rgid, gid_t __egid); int setreuid (uid_t __ruid, uid_t __euid); #endif pid_t setsid (void); -#if !defined(__INSIDE_CYGWIN__) int setuid (uid_t __uid); -#endif #if __BSD_VISIBLE || (__XSI_VISIBLE && __XSI_VISIBLE < 500) void setusershell (void); #endif diff --git a/newlib/libc/posix/posix_spawn.c b/newlib/libc/posix/posix_spaw= n.c index fe912a8b7..85bfa6477 100644 --- a/newlib/libc/posix/posix_spawn.c +++ b/newlib/libc/posix/posix_spawn.c @@ -146,17 +146,6 @@ typedef struct __posix_spawn_file_actions_entry { * Spawn routines */ =20 -#if defined (__CYGWIN__) && defined (__i386__) -extern int getgid32 (void); -extern int getuid32 (void); -extern int setegid32 (gid_t egid); -extern int seteuid32 (uid_t euid); -#define setegid setegid32 -#define seteuid seteuid32 -#define getgid getgid32 -#define getuid getuid32 -#endif - static int process_spawnattr(const posix_spawnattr_t sa) { diff --git a/winsup/cygwin/cygheap.h b/winsup/cygwin/cygheap.h index a47d9819e..0bca8995b 100644 --- a/winsup/cygwin/cygheap.h +++ b/winsup/cygwin/cygheap.h @@ -102,7 +102,7 @@ public: user_groups groups; /* Primary and supp SIDs */ =20 HANDLE external_token; /* token from set_impersonation_token call */ - HANDLE internal_token; /* password-less token fetched in seteuid32 */ + HANDLE internal_token; /* password-less token fetched in seteuid */ HANDLE curr_primary_token; /* Just a copy of external or internal token= */ HANDLE curr_imp_token; /* impersonation token derived from primary token */ diff --git a/winsup/cygwin/cygmalloc.h b/winsup/cygwin/cygmalloc.h index 36f56294f..a6033c166 100644 --- a/winsup/cygwin/cygmalloc.h +++ b/winsup/cygwin/cygmalloc.h @@ -29,8 +29,6 @@ void dlmalloc_stats (); #if defined (DLMALLOC_VERSION) /* Building malloc.cc */ =20 extern "C" void __set_ENOMEM (); -void *mmap64 (void *, size_t, int, int, int, off_t); -# define mmap mmap64 # define MALLOC_FAILURE_ACTION __set_ENOMEM () # define USE_DL_PREFIX 1 =20 diff --git a/winsup/cygwin/cygserver_ipc.h b/winsup/cygwin/cygserver_ipc.h index 05029aff7..2938e1a73 100644 --- a/winsup/cygwin/cygserver_ipc.h +++ b/winsup/cygwin/cygserver_ipc.h @@ -36,8 +36,8 @@ ipc_set_proc_info (proc &blk, bool in_fork =3D false) { blk.cygpid =3D getpid (); blk.winpid =3D GetCurrentProcessId (); - blk.uid =3D geteuid32 (); - blk.gid =3D getegid32 (); + blk.uid =3D geteuid (); + blk.gid =3D getegid (); blk.gidcnt =3D 0; blk.gidlist =3D NULL; blk.is_admin =3D false; diff --git a/winsup/cygwin/fcntl.cc b/winsup/cygwin/fcntl.cc index 437fcf128..2bc52edb0 100644 --- a/winsup/cygwin/fcntl.cc +++ b/winsup/cygwin/fcntl.cc @@ -17,7 +17,7 @@ details. */ #include "cygtls.h" =20 extern "C" int -fcntl64 (int fd, int cmd, ...) +fcntl (int fd, int cmd, ...) { int res =3D -1; intptr_t arg =3D 0; @@ -79,5 +79,4 @@ fcntl64 (int fd, int cmd, ...) return res; } =20 -EXPORT_ALIAS (fcntl64, fcntl) -EXPORT_ALIAS (fcntl64, _fcntl) +EXPORT_ALIAS (fcntl, _fcntl) diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc index fc7bf0a0e..4fce0120a 100644 --- a/winsup/cygwin/fhandler.cc +++ b/winsup/cygwin/fhandler.cc @@ -1272,8 +1272,8 @@ fhandler_base::fstat (struct stat *buf) break; } =20 - buf->st_uid =3D geteuid32 (); - buf->st_gid =3D getegid32 (); + buf->st_uid =3D geteuid (); + buf->st_gid =3D getegid (); buf->st_nlink =3D 1; buf->st_blksize =3D PREFERRED_IO_BLKSIZE; =20 diff --git a/winsup/cygwin/fhandler_clipboard.cc b/winsup/cygwin/fhandler_c= lipboard.cc index 14820701c..e2814d1c7 100644 --- a/winsup/cygwin/fhandler_clipboard.cc +++ b/winsup/cygwin/fhandler_clipboard.cc @@ -18,6 +18,7 @@ details. */ #include "cygheap.h" #include "child_info.h" #include +#include =20 /* * Robert Collins: @@ -159,8 +160,8 @@ int __reg2 fhandler_dev_clipboard::fstat (struct stat *buf) { buf->st_mode =3D S_IFCHR | STD_RBITS | STD_WBITS | S_IWGRP | S_IWOTH; - buf->st_uid =3D geteuid32 (); - buf->st_gid =3D getegid32 (); + buf->st_uid =3D geteuid (); + buf->st_gid =3D getegid (); buf->st_nlink =3D 1; buf->st_blksize =3D PREFERRED_IO_BLKSIZE; =20 diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_d= isk_file.cc index 3cec1ed84..38bdb365b 100644 --- a/winsup/cygwin/fhandler_disk_file.cc +++ b/winsup/cygwin/fhandler_disk_file.cc @@ -1013,7 +1013,7 @@ cant_access_acl: switch (cmd) { case SETACL: - if (!aclsort32 (nentries, 0, aclbufp)) + if (!aclsort (nentries, 0, aclbufp)) { bool rw =3D false; res =3D setacl (get_handle (), pc, nentries, aclbufp, rw); diff --git a/winsup/cygwin/fhandler_process.cc b/winsup/cygwin/fhandler_pro= cess.cc index e2dd1286f..482dd176f 100644 --- a/winsup/cygwin/fhandler_process.cc +++ b/winsup/cygwin/fhandler_process.cc @@ -1049,7 +1049,7 @@ peb_teb_rinse_repeat: if (mount_table->conv_to_posix_path (dosname, posix_modname, 0)) sys_wcstombs (posix_modname, NT_MAX_PATH, dosname); - stat64 (posix_modname, &st); + stat (posix_modname, &st); } else if (!threads.fill_if_match (cur.abase, mb.Type, posix_modname) diff --git a/winsup/cygwin/fhandler_raw.cc b/winsup/cygwin/fhandler_raw.cc index 8d3314465..536d752b5 100644 --- a/winsup/cygwin/fhandler_raw.cc +++ b/winsup/cygwin/fhandler_raw.cc @@ -47,8 +47,8 @@ fhandler_dev_raw::fstat (struct stat *buf) =20 if (get_major () =3D=3D DEV_SD_HIGHPART_END && get_minor () =3D=3D 9= 999) buf->st_ino =3D get_ino (); - buf->st_uid =3D geteuid32 (); - buf->st_gid =3D getegid32 (); + buf->st_uid =3D geteuid (); + buf->st_gid =3D getegid (); buf->st_nlink =3D 1; buf->st_blksize =3D PREFERRED_IO_BLKSIZE; time_as_timestruc_t (&buf->st_ctim); diff --git a/winsup/cygwin/fhandler_socket_local.cc b/winsup/cygwin/fhandle= r_socket_local.cc index bd4081622..c7870733a 100644 --- a/winsup/cygwin/fhandler_socket_local.cc +++ b/winsup/cygwin/fhandler_socket_local.cc @@ -395,8 +395,8 @@ void fhandler_socket_local::af_local_set_sockpair_cred () { sec_pid =3D sec_peer_pid =3D getpid (); - sec_uid =3D sec_peer_uid =3D geteuid32 (); - sec_gid =3D sec_peer_gid =3D getegid32 (); + sec_uid =3D sec_peer_uid =3D geteuid (); + sec_gid =3D sec_peer_gid =3D getegid (); } =20 void @@ -592,8 +592,8 @@ void fhandler_socket_local::af_local_set_cred () { sec_pid =3D getpid (); - sec_uid =3D geteuid32 (); - sec_gid =3D getegid32 (); + sec_uid =3D geteuid (); + sec_gid =3D getegid (); sec_peer_pid =3D (pid_t) 0; sec_peer_uid =3D (uid_t) -1; sec_peer_gid =3D (gid_t) -1; diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index 825d80666..b8427dc8c 100644 --- a/winsup/cygwin/fhandler_tty.cc +++ b/winsup/cygwin/fhandler_tty.cc @@ -1818,7 +1818,7 @@ fhandler_pty_slave::facl (int cmd, int nentries, acle= nt_t *aclbufp) switch (cmd) { case SETACL: - if (!aclsort32 (nentries, 0, aclbufp)) + if (!aclsort (nentries, 0, aclbufp)) set_errno (ENOTSUP); break; case GETACL: diff --git a/winsup/cygwin/glob.cc b/winsup/cygwin/glob.cc index b14cf6dab..0d9f9c885 100644 --- a/winsup/cygwin/glob.cc +++ b/winsup/cygwin/glob.cc @@ -101,9 +101,6 @@ __FBSDID("$FreeBSD: src/lib/libc/gen/glob.c,v 1.28 2010= /05/12 17:44:00 gordon Ex #include "cygheap.h" #include "cygwin/version.h" =20 -#define getpwuid(uid) getpwuid32 (uid) -#define getuid() getuid32 () - #define CCHAR(c) (ignore_case_with_glob ? towlower (CHAR (c)) : CHAR (c)) #define Cchar(c) (ignore_case_with_glob ? towlower (c) : (c)) #endif @@ -868,7 +865,7 @@ g_lstat(Char *fn, struct stat *sb, glob_t *pglob) } if (pglob->gl_flags & GLOB_ALTDIRFUNC) return CYGWIN_gl_stat (gl_lstat); - return(lstat64(buf, sb)); + return(lstat(buf, sb)); } =20 static int @@ -882,7 +879,7 @@ g_stat(Char *fn, struct stat *sb, glob_t *pglob) } if (pglob->gl_flags & GLOB_ALTDIRFUNC) return CYGWIN_gl_stat (gl_stat); - return(stat64(buf, sb)); + return(stat(buf, sb)); } =20 static const Char * diff --git a/winsup/cygwin/grp.cc b/winsup/cygwin/grp.cc index 893e4cc0f..b06ad3791 100644 --- a/winsup/cygwin/grp.cc +++ b/winsup/cygwin/grp.cc @@ -300,15 +300,13 @@ getgr_cp (struct group *tempgr) } =20 extern "C" struct group * -getgrgid32 (gid_t gid) +getgrgid (gid_t gid) { struct group *tempgr =3D internal_getgrgid (gid); pthread_testcancel (); return getgr_cp (tempgr); } =20 -EXPORT_ALIAS (getgrgid32, getgrgid) - extern "C" int getgrnam_r (const char *nam, struct group *grp, char *buffer, size_t bufsize, struct group **result) @@ -340,15 +338,13 @@ getgrnam_r (const char *nam, struct group *grp, char = *buffer, } =20 extern "C" struct group * -getgrnam32 (const char *name) +getgrnam (const char *name) { struct group *tempgr =3D internal_getgrnam (name); pthread_testcancel (); return getgr_cp (tempgr); } =20 -EXPORT_ALIAS (getgrnam32, getgrnam) - /* getgrent functions are not reentrant. */ static gr_ent grent; =20 @@ -459,13 +455,11 @@ setgrent () } =20 extern "C" struct group * -getgrent32 (void) +getgrent (void) { return grent.getgrent (); } =20 -EXPORT_ALIAS (getgrent32, getgrent) - extern "C" void endgrent (void) { @@ -646,15 +640,13 @@ out: } =20 extern "C" int -getgroups32 (int gidsetsize, gid_t *grouplist) +getgroups (int gidsetsize, gid_t *grouplist) { cyg_ldap cldap; =20 return internal_getgroups (gidsetsize, grouplist, &cldap); } =20 -EXPORT_ALIAS (getgroups32, getgroups) - /* Core functionality of initgroups and getgrouplist. */ static void get_groups (const char *user, gid_t gid, cygsidlist &gsids) @@ -673,7 +665,7 @@ get_groups (const char *user, gid_t gid, cygsidlist &gs= ids) } =20 extern "C" int -initgroups32 (const char *user, gid_t gid) +initgroups (const char *user, gid_t gid) { assert (user !=3D NULL); cygsidlist tmp_gsids (cygsidlist_auto, 12); @@ -687,8 +679,6 @@ initgroups32 (const char *user, gid_t gid) return 0; } =20 -EXPORT_ALIAS (initgroups32, initgroups) - extern "C" int getgrouplist (const char *user, gid_t gid, gid_t *groups, int *ngroups) { @@ -725,11 +715,11 @@ getgrouplist (const char *user, gid_t gid, gid_t *gro= ups, int *ngroups) return ret; } =20 -/* setgroups32: standards? */ +/* setgroups: standards? */ extern "C" int -setgroups32 (int ngroups, const gid_t *grouplist) +setgroups (int ngroups, const gid_t *grouplist) { - syscall_printf ("setgroups32 (%d)", ngroups); + syscall_printf ("setgroups (%d)", ngroups); if (ngroups < 0 || (ngroups > 0 && !grouplist)) { set_errno (EINVAL); @@ -756,5 +746,3 @@ setgroups32 (int ngroups, const gid_t *grouplist) cygheap->user.groups.update_supp (gsids); return 0; } - -EXPORT_ALIAS (setgroups32, setgroups) diff --git a/winsup/cygwin/include/cygwin/acl.h b/winsup/cygwin/include/cyg= win/acl.h index 7b803134a..0e61bed69 100644 --- a/winsup/cygwin/include/cygwin/acl.h +++ b/winsup/cygwin/include/cygwin/acl.h @@ -70,7 +70,6 @@ typedef struct acl { mode_t a_perm; /* permissions */ } aclent_t; =20 -#ifndef __INSIDE_CYGWIN__ extern int acl (const char *__path, int __cmd, int __nentries, aclent_t *__aclbufp); extern int facl (int __fd, int __cmd, int __nentries, @@ -87,7 +86,6 @@ extern int aclfrompbits (aclent_t *__aclbufp, int __nent= ries, mode_t *__pbitsp); extern char *acltotext (aclent_t *__aclbufp, int __aclcnt); extern aclent_t *aclfromtext (char *__acltextp, int *__aclcnt); -#endif =20 #ifdef __cplusplus } diff --git a/winsup/cygwin/include/cygwin/grp.h b/winsup/cygwin/include/cyg= win/grp.h index ea253e936..a40d4d66a 100644 --- a/winsup/cygwin/include/cygwin/grp.h +++ b/winsup/cygwin/include/cygwin/grp.h @@ -16,13 +16,6 @@ details. */ extern "C" { #endif =20 -#ifdef __INSIDE_CYGWIN__ -struct group * getgrgid32 (gid_t gid); -struct group * getgrnam32 (const char *name); -gid_t getgid32 (); -gid_t getegid32 (); -#endif - extern int getgrouplist (const char *, gid_t, gid_t *, int *); =20 #ifdef __cplusplus diff --git a/winsup/cygwin/include/cygwin/stat.h b/winsup/cygwin/include/cy= gwin/stat.h index b890f61a1..7f1b61681 100644 --- a/winsup/cygwin/include/cygwin/stat.h +++ b/winsup/cygwin/include/cygwin/stat.h @@ -32,16 +32,6 @@ struct stat timestruc_t st_birthtim; }; =20 -#if defined (__INSIDE_CYGWIN__) || defined (_LIBC) - -extern int fstat64 (int fd, struct stat *buf); -extern int stat64 (const char *__restrict file_name, - struct stat *__restrict buf); -extern int lstat64 (const char *__restrict file_name, - struct stat *__restrict buf); - -#endif - #define st_atime st_atim.tv_sec #define st_mtime st_mtim.tv_sec #define st_ctime st_ctim.tv_sec diff --git a/winsup/cygwin/include/sys/mman.h b/winsup/cygwin/include/sys/m= man.h index 35fa9e9d2..4bdd6caea 100644 --- a/winsup/cygwin/include/sys/mman.h +++ b/winsup/cygwin/include/sys/mman.h @@ -74,9 +74,7 @@ extern "C" { #define MADV_UNMERGEABLE 11 #endif =20 -#ifndef __INSIDE_CYGWIN__ extern void *mmap (void *__addr, size_t __len, int __prot, int __flags, in= t __fd, off_t __off); -#endif extern int munmap (void *__addr, size_t __len); extern int mprotect (void *__addr, size_t __len, int __prot); extern int msync (void *__addr, size_t __len, int __flags); diff --git a/winsup/cygwin/ipc.cc b/winsup/cygwin/ipc.cc index 571ac8701..e670cdb2c 100644 --- a/winsup/cygwin/ipc.cc +++ b/winsup/cygwin/ipc.cc @@ -18,7 +18,7 @@ ftok (const char *path, int id) { struct stat statbuf; key_t tmp; - if (stat64 (path, &statbuf)) + if (stat (path, &statbuf)) { /* stat set the appropriate errno for us */ return (key_t) -1; diff --git a/winsup/cygwin/libc/fts.c b/winsup/cygwin/libc/fts.c index 003f85146..1826d2213 100644 --- a/winsup/cygwin/libc/fts.c +++ b/winsup/cygwin/libc/fts.c @@ -58,17 +58,8 @@ __FBSDID("$FreeBSD: src/lib/libc/gen/fts.c,v 1.39 2013/0= 2/11 02:00:16 svnexp Exp #define _open open #define _close close #define _dirfd dirfd -#ifdef __x86_64__ #define _fstat fstat #else -extern int stat64 (const char *path, struct stat *buf); -extern int fstat64 (int fd, struct stat *buf); -extern int lstat64 (const char *path, struct stat *buf); -#define stat(a,b) stat64((a),(b)) -#define _fstat(a,b) fstat64((a),(b)) -#define lstat(a,b) lstat64((a),(b)) -#endif -#else #include "un-namespace.h" =20 #include "gen-private.h" diff --git a/winsup/cygwin/libc/minires.c b/winsup/cygwin/libc/minires.c index b540f6a1b..5b43b3e68 100644 --- a/winsup/cygwin/libc/minires.c +++ b/winsup/cygwin/libc/minires.c @@ -237,12 +237,12 @@ static int open_sock(struct sockaddr_in *CliAddr, int= debug) return -1; } /* Set non-blocking */ - if (fcntl64(fd, F_SETFL, O_NONBLOCK) < 0) { + if (fcntl(fd, F_SETFL, O_NONBLOCK) < 0) { DPRINTF(debug, "fcntl: %s\n", strerror(errno)); return -1; } /* Set close on exec flag */ - if (fcntl64(fd, F_SETFD, 1) =3D=3D -1) { + if (fcntl(fd, F_SETFD, 1) =3D=3D -1) { DPRINTF(debug, "fcntl: %s\n", strerror(errno)); return -1; } diff --git a/winsup/cygwin/libc/rcmd.cc b/winsup/cygwin/libc/rcmd.cc index 6d087d777..e606e73cf 100644 --- a/winsup/cygwin/libc/rcmd.cc +++ b/winsup/cygwin/libc/rcmd.cc @@ -103,7 +103,6 @@ extern "C" { int cygwin_rresvport_af(int *alport, int family); int cygwin_select (int, fd_set *, fd_set *, fd_set *, struct timeval *); int cygwin_socket (int, int, int); - int seteuid32 (uid_t); } #endif =20 @@ -200,7 +199,7 @@ cygwin_rcmd_af(char **ahost, in_port_t rport, const cha= r *locuser, NULL); return (-1); } - fcntl64(s, F_SETOWN, pid); + fcntl(s, F_SETOWN, pid); if (cygwin_connect(s, ai->ai_addr, ai->ai_addrlen) >=3D 0) break; (void)close(s); @@ -458,10 +457,10 @@ again: * reading an NFS mounted file system, can't read files that * are protected read/write owner only. */ - uid =3D geteuid32(); - (void)seteuid32(pwd->pw_uid); + uid =3D geteuid(); + (void)seteuid(pwd->pw_uid); hostf =3D fopen(pbuf, "rt"); - (void)seteuid32(uid); + (void)seteuid(uid); =20 if (hostf =3D=3D NULL) return (-1); @@ -470,11 +469,11 @@ again: * user or root or if writeable by anyone but the owner, quit. */ cp =3D NULL; - if (lstat64(pbuf, &sbuf) < 0) + if (lstat(pbuf, &sbuf) < 0) cp =3D ".rhosts lstat failed"; else if (!S_ISREG(sbuf.st_mode)) cp =3D ".rhosts not regular file"; - else if (fstat64(fileno(hostf), &sbuf) < 0) + else if (fstat(fileno(hostf), &sbuf) < 0) cp =3D ".rhosts fstat failed"; else if (sbuf.st_uid && sbuf.st_uid !=3D pwd->pw_uid) cp =3D "bad .rhosts owner"; diff --git a/winsup/cygwin/libc/rexec.cc b/winsup/cygwin/libc/rexec.cc index 7f25123a0..7e337f1e2 100644 --- a/winsup/cygwin/libc/rexec.cc +++ b/winsup/cygwin/libc/rexec.cc @@ -215,7 +215,7 @@ next: break; case PASSWD: if ((*aname =3D=3D 0 || strcmp(*aname, "anonymous")) && - fstat64(fileno(cfile), &stb) >=3D 0 && + fstat(fileno(cfile), &stb) >=3D 0 && (stb.st_mode & 077) !=3D 0) { warnx("Error: .netrc file is readable by others."); warnx("Remove password or make file unreadable by others."); @@ -227,7 +227,7 @@ next: } break; case ACCOUNT: - if (fstat64(fileno(cfile), &stb) >=3D 0 + if (fstat(fileno(cfile), &stb) >=3D 0 && (stb.st_mode & 077) !=3D 0) { warnx("Error: .netrc file is readable by others."); warnx("Remove account or make file unreadable by others."); diff --git a/winsup/cygwin/mktemp.cc b/winsup/cygwin/mktemp.cc index 4dc157da4..710e432b4 100644 --- a/winsup/cygwin/mktemp.cc +++ b/winsup/cygwin/mktemp.cc @@ -100,7 +100,7 @@ _gettemp(char *path, int *doopen, int domkdir, size_t s= uffixlen, int flags) if (*trv =3D=3D '/') { *trv =3D '\0'; - int rval =3D stat64 (path, &sbuf); + int rval =3D stat (path, &sbuf); *trv =3D '/'; if (rval !=3D 0) return 0; @@ -131,7 +131,7 @@ _gettemp(char *path, int *doopen, int domkdir, size_t s= uffixlen, int flags) if (errno !=3D EEXIST) return 0; } - else if (lstat64 (path, &sbuf)) + else if (lstat (path, &sbuf)) return errno =3D=3D ENOENT; =20 /* If we have a collision, cycle through the space of filenames */ diff --git a/winsup/cygwin/mmap.cc b/winsup/cygwin/mmap.cc index d8f5cf046..5aa6d0c09 100644 --- a/winsup/cygwin/mmap.cc +++ b/winsup/cygwin/mmap.cc @@ -238,7 +238,7 @@ MapView (HANDLE h, void *addr, size_t len, DWORD openfl= ags, If it failed, and addr was not NULL and flags is not MAP_FIXED, try again with NULL address. =20 - Note: Retrying the mapping might be unnecessary, now that mmap64 chec= ks + Note: Retrying the mapping might be unnecessary, now that mmap checks for a valid memory area first. */ SIZE_T commitsize =3D attached (prot) ? 0 : len; status =3D NtMapViewOfSection (h, NtCurrentProcess (), &base, 0, commits= ize, @@ -832,7 +832,7 @@ mmap_worker (mmap_list *map_list, fhandler_base *fh, ca= ddr_t base, size_t len, } =20 extern "C" void * -mmap64 (void *addr, size_t len, int prot, int flags, int fd, off_t off) +mmap (void *addr, size_t len, int prot, int flags, int fd, off_t off) { syscall_printf ("addr %p, len %lu, prot %y, flags %y, fd %d, off %Y", addr, len, prot, flags, fd, off); @@ -1145,8 +1145,6 @@ out: return ret; } =20 -EXPORT_ALIAS (mmap64, mmap) - /* munmap () removes all mmapped pages between addr and addr+len. */ =20 extern "C" int @@ -1280,7 +1278,7 @@ mprotect (void *addr, size_t len, int prot) =20 syscall_printf ("mprotect (addr: %p, len %lu, prot %y)", addr, len, prot= ); =20 - /* See comment in mmap64 for a description. */ + /* See comment in mmap for a description. */ const size_t pagesize =3D wincap.allocation_granularity (); if ((uintptr_t) addr % pagesize) { diff --git a/winsup/cygwin/passwd.cc b/winsup/cygwin/passwd.cc index 1e4c5bab5..d1708953d 100644 --- a/winsup/cygwin/passwd.cc +++ b/winsup/cygwin/passwd.cc @@ -218,17 +218,15 @@ getpw_cp (struct passwd *temppw) } =20 extern "C" struct passwd * -getpwuid32 (uid_t uid) +getpwuid (uid_t uid) { struct passwd *temppw =3D internal_getpwuid (uid); pthread_testcancel (); return getpw_cp (temppw); } =20 -EXPORT_ALIAS (getpwuid32, getpwuid) - extern "C" int -getpwuid_r32 (uid_t uid, struct passwd *pwd, char *buffer, size_t bufsize,= struct passwd **result) +getpwuid_r (uid_t uid, struct passwd *pwd, char *buffer, size_t bufsize, s= truct passwd **result) { *result =3D NULL; =20 @@ -260,8 +258,6 @@ getpwuid_r32 (uid_t uid, struct passwd *pwd, char *buff= er, size_t bufsize, struc return 0; } =20 -EXPORT_ALIAS (getpwuid_r32, getpwuid_r) - extern "C" struct passwd * getpwnam (const char *name) { diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index 0ccdf9832..5e6d0ea87 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -3720,8 +3720,8 @@ get_current_dir_name (void) struct stat pwdbuf, cwdbuf; =20 if (pwd && strcmp (pwd, cwd) !=3D 0 - && stat64 (pwd, &pwdbuf) =3D=3D 0 - && stat64 (cwd, &cwdbuf) =3D=3D 0 + && stat (pwd, &pwdbuf) =3D=3D 0 + && stat (cwd, &cwdbuf) =3D=3D 0 && pwdbuf.st_dev =3D=3D cwdbuf.st_dev && pwdbuf.st_ino =3D=3D cwdbuf.st_ino) { diff --git a/winsup/cygwin/posix_ipc.cc b/winsup/cygwin/posix_ipc.cc index 1932ac8db..68d66e410 100644 --- a/winsup/cygwin/posix_ipc.cc +++ b/winsup/cygwin/posix_ipc.cc @@ -117,14 +117,14 @@ public: fl.l_whence =3D SEEK_SET; fl.l_start =3D 0; fl.l_len =3D size; - return fcntl64 (fd, F_SETLKW, &fl); + return fcntl (fd, F_SETLKW, &fl); } int unlock (int fd) { if (!fl.l_len) return 0; fl.l_type =3D F_UNLCK; - return fcntl64 (fd, F_SETLKW, &fl); + return fcntl (fd, F_SETLKW, &fl); } }; =20 @@ -424,7 +424,7 @@ sem_open (const char *name, int oflag, ...) /* Make certain initialization is complete */ for (i =3D 0; i < MAX_TRIES; i++) { - if (stat64 (semname, &statbuff) =3D=3D -1) + if (stat (semname, &statbuff) =3D=3D -1) { if (errno =3D=3D ENOENT && (oflag & O_CREAT)) { @@ -476,7 +476,7 @@ sem_open (const char *name, int oflag, ...) return SEM_FAILED; } =20 -extern "C" off_t lseek64 (int, off_t, int); +extern "C" off_t lseek (int, off_t, int); =20 int _sem_close (sem_t *sem, bool do_close) @@ -488,7 +488,7 @@ _sem_close (sem_t *sem, bool do_close) if (semaphore::getinternal (sem, &fd, &sf.hash, &sf.luid, &sf.value) =3D= =3D -1) return -1; if (!file.lock (fd, sizeof sf) - && lseek64 (fd, 0LL, SEEK_SET) !=3D (off_t) -1 + && lseek (fd, 0LL, SEEK_SET) !=3D (off_t) -1 && write (fd, &sf, sizeof sf) =3D=3D sizeof sf) ret =3D do_close ? semaphore::close (sem) : 0; =20 diff --git a/winsup/cygwin/sec_acl.cc b/winsup/cygwin/sec_acl.cc index a65d4a2b0..03dbb8050 100644 --- a/winsup/cygwin/sec_acl.cc +++ b/winsup/cygwin/sec_acl.cc @@ -1186,7 +1186,7 @@ out: memcpy (aclbufp, lacl, pos * sizeof (aclent_t)); for (idx =3D 0; idx < pos; ++idx) aclbufp[idx].a_perm &=3D S_IRWXO; - aclsort32 (pos, 0, aclbufp); + aclsort (pos, 0, aclbufp); } if (std_acl) *std_acl =3D standard_ACEs_only; @@ -1207,7 +1207,7 @@ getacl (HANDLE handle, path_conv &pc, int nentries, a= clent_t *aclbufp) } =20 extern "C" int -acl32 (const char *path, int cmd, int nentries, aclent_t *aclbufp) +acl (const char *path, int cmd, int nentries, aclent_t *aclbufp) { int res =3D -1; =20 @@ -1229,7 +1229,7 @@ acl32 (const char *path, int cmd, int nentries, aclen= t_t *aclbufp) } =20 extern "C" int -facl32 (int fd, int cmd, int nentries, aclent_t *aclbufp) +facl (int fd, int cmd, int nentries, aclent_t *aclbufp) { cygheap_fdget cfd (fd); if (cfd < 0) @@ -1401,7 +1401,7 @@ __aclcheck (aclent_t *aclbufp, int nentries, int *whi= ch, bool posix) } =20 extern "C" int -aclcheck32 (aclent_t *aclbufp, int nentries, int *which) +aclcheck (aclent_t *aclbufp, int nentries, int *which) { return __aclcheck (aclbufp, nentries, which, false); } @@ -1466,10 +1466,10 @@ __aclsort (int nentries, aclent_t *aclbufp) } =20 extern "C" int -aclsort32 (int nentries, int calclass, aclent_t *aclbufp) +aclsort (int nentries, int calclass, aclent_t *aclbufp) { if (!aclbufp || nentries < MIN_ACL_ENTRIES - || aclcheck32 (aclbufp, nentries, NULL)) + || aclcheck (aclbufp, nentries, NULL)) { set_errno (EINVAL); return -1; @@ -1481,7 +1481,7 @@ aclsort32 (int nentries, int calclass, aclent_t *aclb= ufp) } =20 extern "C" int -acltomode32 (aclent_t *aclbufp, int nentries, mode_t *modep) +acltomode (aclent_t *aclbufp, int nentries, mode_t *modep) { int pos; =20 @@ -1520,7 +1520,7 @@ acltomode32 (aclent_t *aclbufp, int nentries, mode_t = *modep) } =20 extern "C" int -aclfrommode32 (aclent_t *aclbufp, int nentries, mode_t *modep) +aclfrommode (aclent_t *aclbufp, int nentries, mode_t *modep) { int pos; =20 @@ -1557,15 +1557,15 @@ aclfrommode32 (aclent_t *aclbufp, int nentries, mod= e_t *modep) } =20 extern "C" int -acltopbits32 (aclent_t *aclbufp, int nentries, mode_t *pbitsp) +acltopbits (aclent_t *aclbufp, int nentries, mode_t *pbitsp) { - return acltomode32 (aclbufp, nentries, pbitsp); + return acltomode (aclbufp, nentries, pbitsp); } =20 extern "C" int -aclfrompbits32 (aclent_t *aclbufp, int nentries, mode_t *pbitsp) +aclfrompbits (aclent_t *aclbufp, int nentries, mode_t *pbitsp) { - return aclfrommode32 (aclbufp, nentries, pbitsp); + return aclfrommode (aclbufp, nentries, pbitsp); } =20 static char * @@ -1635,7 +1635,7 @@ __acltotext (aclent_t *aclbufp, int aclcnt, const cha= r *prefix, char separator, int options) { if (!aclbufp || aclcnt < 0 || aclcnt > MAX_ACL_ENTRIES - || (aclcnt > 0 && aclsort32 (aclcnt, 0, aclbufp))) + || (aclcnt > 0 && aclsort (aclcnt, 0, aclbufp))) { set_errno (EINVAL); return NULL; @@ -1776,7 +1776,7 @@ __acltotext (aclent_t *aclbufp, int aclcnt, const cha= r *prefix, char separator, } =20 extern "C" char * -acltotext32 (aclent_t *aclbufp, int aclcnt) +acltotext (aclent_t *aclbufp, int aclcnt) { return __acltotext (aclbufp, aclcnt, NULL, ',', 0); } @@ -1960,18 +1960,7 @@ __aclfromtext (const char *acltextp, int *aclcnt, bo= ol posix) } =20 extern "C" aclent_t * -aclfromtext32 (char *acltextp, int *aclcnt) +aclfromtext (char *acltextp, int *aclcnt) { return (aclent_t *) __aclfromtext (acltextp, aclcnt, false); } - -EXPORT_ALIAS (acl32, acl) -EXPORT_ALIAS (facl32, facl) -EXPORT_ALIAS (aclcheck32, aclcheck) -EXPORT_ALIAS (aclsort32, aclsort) -EXPORT_ALIAS (acltomode32, acltomode) -EXPORT_ALIAS (aclfrommode32, aclfrommode) -EXPORT_ALIAS (acltopbits32, acltopbits) -EXPORT_ALIAS (aclfrompbits32, aclfrompbits) -EXPORT_ALIAS (acltotext32, acltotext) -EXPORT_ALIAS (aclfromtext32, aclfromtext) diff --git a/winsup/cygwin/security.cc b/winsup/cygwin/security.cc index d48526619..04e777852 100644 --- a/winsup/cygwin/security.cc +++ b/winsup/cygwin/security.cc @@ -364,8 +364,8 @@ set_security_attribute (path_conv &pc, int attribute, P= SECURITY_ATTRIBUTES psa, psa->lpSecurityDescriptor =3D sd.malloc (SECURITY_DESCRIPTOR_MIN_LENGTH); RtlCreateSecurityDescriptor ((PSECURITY_DESCRIPTOR) psa->lpSecurityDescr= iptor, SECURITY_DESCRIPTOR_REVISION); - psa->lpSecurityDescriptor =3D set_posix_access (attribute, geteuid32 (), - getegid32 (), NULL, 0, + psa->lpSecurityDescriptor =3D set_posix_access (attribute, geteuid (), + getegid (), NULL, 0, sd, false); } =20 diff --git a/winsup/cygwin/security.h b/winsup/cygwin/security.h index f5ac1a922..ff2548027 100644 --- a/winsup/cygwin/security.h +++ b/winsup/cygwin/security.h @@ -438,8 +438,6 @@ bool authz_get_user_attribute (mode_t *attribute, PSECU= RITY_DESCRIPTOR psd, =20 /* sec_acl.cc */ struct acl; -extern "C" int aclsort32 (int, int, struct acl *); -extern "C" int acl32 (const char *, int, int, struct acl *); int searchace (struct acl *, int, int, uid_t id =3D ILLEGAL_UID); PSECURITY_DESCRIPTOR set_posix_access (mode_t, uid_t, gid_t, struct acl *,= int, security_descriptor &, bool); diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index bd4910690..b88edd998 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -1599,7 +1599,7 @@ EXPORT_ALIAS (open, _open ) EXPORT_ALIAS (open, _open64 ) =20 extern "C" off_t -lseek64 (int fd, off_t pos, int dir) +lseek (int fd, off_t pos, int dir) { off_t res; =20 @@ -1624,9 +1624,8 @@ lseek64 (int fd, off_t pos, int dir) return res; } =20 -EXPORT_ALIAS (lseek64, _lseek64) -EXPORT_ALIAS (lseek64, lseek) -EXPORT_ALIAS (lseek64, _lseek) +EXPORT_ALIAS (lseek, _lseek64) +EXPORT_ALIAS (lseek, _lseek) =20 extern "C" int close (int fd) @@ -1726,23 +1725,19 @@ chown_worker (const char *name, unsigned fmode, uid= _t uid, gid_t gid) } =20 extern "C" int -chown32 (const char * name, uid_t uid, gid_t gid) +chown (const char * name, uid_t uid, gid_t gid) { return chown_worker (name, PC_SYM_FOLLOW, uid, gid); } =20 -EXPORT_ALIAS (chown32, chown) - extern "C" int -lchown32 (const char * name, uid_t uid, gid_t gid) +lchown (const char * name, uid_t uid, gid_t gid) { return chown_worker (name, PC_SYM_NOFOLLOW, uid, gid); } =20 -EXPORT_ALIAS (lchown32, lchown) - extern "C" int -fchown32 (int fd, uid_t uid, gid_t gid) +fchown (int fd, uid_t uid, gid_t gid) { cygheap_fdget cfd (fd); if (cfd < 0) @@ -1762,8 +1757,6 @@ fchown32 (int fd, uid_t uid, gid_t gid) return res; } =20 -EXPORT_ALIAS (fchown32, fchown) - /* umask: POSIX 5.3.3.1 */ extern "C" mode_t umask (mode_t mask) @@ -1859,7 +1852,7 @@ fhandler_base::stat_fixup (struct stat *buf) { if (!dev_st_inited) { - stat64 ("/dev", &dev_st); + stat ("/dev", &dev_st); dev_st_inited =3D true; } buf->st_dev =3D dev_st.st_dev; @@ -1882,7 +1875,7 @@ fhandler_base::stat_fixup (struct stat *buf) } =20 extern "C" int -fstat64 (int fd, struct stat *buf) +fstat (int fd, struct stat *buf) { int res; =20 @@ -1902,17 +1895,16 @@ fstat64 (int fd, struct stat *buf) } =20 extern "C" int -_fstat64_r (struct _reent *ptr, int fd, struct stat *buf) +_fstat_r (struct _reent *ptr, int fd, struct stat *buf) { int ret; =20 - if ((ret =3D fstat64 (fd, buf)) =3D=3D -1) + if ((ret =3D fstat (fd, buf)) =3D=3D -1) ptr->_errno =3D get_errno (); return ret; } =20 -EXPORT_ALIAS (fstat64, fstat) -EXPORT_ALIAS (_fstat64_r, _fstat_r) +EXPORT_ALIAS (_fstat_r, _fstat64_r) =20 /* fsync: P96 6.6.1.1 */ extern "C" int @@ -2043,7 +2035,7 @@ stat_worker (path_conv &pc, struct stat *buf) } =20 extern "C" int -stat64 (const char *__restrict name, struct stat *__restrict buf) +stat (const char *__restrict name, struct stat *__restrict buf) { syscall_printf ("entering"); path_conv pc (name, PC_SYM_FOLLOW | PC_POSIX | PC_KEEP_HANDLE @@ -2053,22 +2045,21 @@ stat64 (const char *__restrict name, struct stat *_= _restrict buf) } =20 extern "C" int -_stat64_r (struct _reent *__restrict ptr, const char *__restrict name, +_stat_r (struct _reent *__restrict ptr, const char *__restrict name, struct stat *buf) { int ret; =20 - if ((ret =3D stat64 (name, buf)) =3D=3D -1) + if ((ret =3D stat (name, buf)) =3D=3D -1) ptr->_errno =3D get_errno (); return ret; } =20 -EXPORT_ALIAS (stat64, stat) -EXPORT_ALIAS (_stat64_r, _stat_r) +EXPORT_ALIAS (_stat_r, _stat64_r) =20 /* lstat: Provided by SVR4 and 4.3+BSD, POSIX? */ extern "C" int -lstat64 (const char *__restrict name, struct stat *__restrict buf) +lstat (const char *__restrict name, struct stat *__restrict buf) { syscall_printf ("entering"); path_conv pc (name, PC_SYM_NOFOLLOW | PC_POSIX | PC_KEEP_HANDLE, @@ -2076,8 +2067,6 @@ lstat64 (const char *__restrict name, struct stat *__= restrict buf) return stat_worker (pc, buf); } =20 -EXPORT_ALIAS (lstat64, lstat) - extern "C" int access (const char *fn, int flags) { @@ -3055,7 +3044,7 @@ posix_fallocate (int fd, off_t offset, off_t len) } =20 extern "C" int -ftruncate64 (int fd, off_t length) +ftruncate (int fd, off_t length) { int res =3D -1; cygheap_fdget cfd (fd); @@ -3074,11 +3063,9 @@ ftruncate64 (int fd, off_t length) return res; } =20 -EXPORT_ALIAS (ftruncate64, ftruncate) - /* truncate: Provided by SVR4 and 4.3+BSD. Not part of POSIX.1 or XPG3 */ extern "C" int -truncate64 (const char *pathname, off_t length) +truncate (const char *pathname, off_t length) { int fd; int res =3D -1; @@ -3087,7 +3074,7 @@ truncate64 (const char *pathname, off_t length) =20 if (fd !=3D -1) { - res =3D ftruncate64 (fd, length); + res =3D ftruncate (fd, length); close (fd); } syscall_printf ("%R =3D truncate(%s, %D)", res, pathname, length); @@ -3095,8 +3082,6 @@ truncate64 (const char *pathname, off_t length) return res; } =20 -EXPORT_ALIAS (truncate64, truncate) - extern "C" long _get_osfhandle (int fd) { @@ -3293,7 +3278,7 @@ mknod_worker (path_conv &pc, mode_t mode, _major_t ma= jor, _minor_t minor) } =20 extern "C" int -mknod32 (const char *path, mode_t mode, dev_t dev) +mknod (const char *path, mode_t mode, dev_t dev) { __try { @@ -3354,17 +3339,15 @@ mknod32 (const char *path, mode_t mode, dev_t dev) return -1; } =20 -EXPORT_ALIAS (mknod32, mknod) - extern "C" int mkfifo (const char *path, mode_t mode) { - return mknod32 (path, (mode & ~S_IFMT) | S_IFIFO, 0); + return mknod (path, (mode & ~S_IFMT) | S_IFIFO, 0); } =20 /* seteuid: standards? */ extern "C" int -seteuid32 (uid_t uid) +seteuid (uid_t uid) { debug_printf ("uid: %u myself->uid: %u myself->gid: %u", uid, myself->uid, myself->gid); @@ -3568,13 +3551,11 @@ seteuid32 (uid_t uid) return 0; } =20 -EXPORT_ALIAS (seteuid32, seteuid) - /* setuid: POSIX 4.2.2.1 */ extern "C" int -setuid32 (uid_t uid) +setuid (uid_t uid) { - int ret =3D seteuid32 (uid); + int ret =3D seteuid (uid); if (!ret) { cygheap->user.real_uid =3D myself->uid; @@ -3585,20 +3566,18 @@ setuid32 (uid_t uid) return ret; } =20 -EXPORT_ALIAS (setuid32, setuid) - extern "C" int -setreuid32 (uid_t ruid, uid_t euid) +setreuid (uid_t ruid, uid_t euid) { int ret =3D 0; bool tried =3D false; uid_t old_euid =3D myself->uid; =20 if (ruid !=3D ILLEGAL_UID && cygheap->user.real_uid !=3D ruid && euid != =3D ruid) - tried =3D !(ret =3D seteuid32 (ruid)); + tried =3D !(ret =3D seteuid (ruid)); if (!ret && euid !=3D ILLEGAL_UID) - ret =3D seteuid32 (euid); - if (tried && (ret || euid =3D=3D ILLEGAL_UID) && seteuid32 (old_euid)) + ret =3D seteuid (euid); + if (tried && (ret || euid =3D=3D ILLEGAL_UID) && seteuid (old_euid)) system_printf ("Cannot restore original euid %u", old_euid); if (!ret && ruid !=3D ILLEGAL_UID) cygheap->user.real_uid =3D ruid; @@ -3606,11 +3585,9 @@ setreuid32 (uid_t ruid, uid_t euid) return ret; } =20 -EXPORT_ALIAS (setreuid32, setreuid) - /* setegid: from System V. */ extern "C" int -setegid32 (gid_t gid) +setegid (gid_t gid) { debug_printf ("new egid: %u current: %u", gid, myself->gid); =20 @@ -3658,32 +3635,28 @@ setegid32 (gid_t gid) return 0; } =20 -EXPORT_ALIAS (setegid32, setegid) - /* setgid: POSIX 4.2.2.1 */ extern "C" int -setgid32 (gid_t gid) +setgid (gid_t gid) { - int ret =3D setegid32 (gid); + int ret =3D setegid (gid); if (!ret) cygheap->user.real_gid =3D myself->gid; return ret; } =20 -EXPORT_ALIAS (setgid32, setgid) - extern "C" int -setregid32 (gid_t rgid, gid_t egid) +setregid (gid_t rgid, gid_t egid) { int ret =3D 0; bool tried =3D false; gid_t old_egid =3D myself->gid; =20 if (rgid !=3D ILLEGAL_GID && cygheap->user.real_gid !=3D rgid && egid != =3D rgid) - tried =3D !(ret =3D setegid32 (rgid)); + tried =3D !(ret =3D setegid (rgid)); if (!ret && egid !=3D ILLEGAL_GID) - ret =3D setegid32 (egid); - if (tried && (ret || egid =3D=3D ILLEGAL_GID) && setegid32 (old_egid)) + ret =3D setegid (egid); + if (tried && (ret || egid =3D=3D ILLEGAL_GID) && setegid (old_egid)) system_printf ("Cannot restore original egid %u", old_egid); if (!ret && rgid !=3D ILLEGAL_GID) cygheap->user.real_gid =3D rgid; @@ -3691,8 +3664,6 @@ setregid32 (gid_t rgid, gid_t egid) return ret; } =20 -EXPORT_ALIAS (setregid32, setregid) - /* chroot: privileged Unix system call. */ /* FIXME: Not privileged here. How should this be done? */ extern "C" int @@ -3896,13 +3867,13 @@ locked_append (int fd, const void * buf, size_t siz= e) int count =3D 0; =20 do - if ((lock_buffer.l_start =3D lseek64 (fd, 0, SEEK_END)) !=3D (off_t) -1 - && fcntl64 (fd, F_SETLKW, &lock_buffer) !=3D -1) + if ((lock_buffer.l_start =3D lseek (fd, 0, SEEK_END)) !=3D (off_t) -1 + && fcntl (fd, F_SETLKW, &lock_buffer) !=3D -1) { - if (lseek64 (fd, 0, SEEK_END) !=3D (off_t) -1) + if (lseek (fd, 0, SEEK_END) !=3D (off_t) -1) write (fd, buf, size); lock_buffer.l_type =3D F_UNLCK; - fcntl64 (fd, F_SETLK, &lock_buffer); + fcntl (fd, F_SETLK, &lock_buffer); break; } while (count++ < 1000 @@ -4394,22 +4365,22 @@ popen (const char *command, const char *in_type) end of the pipe. Otherwise don't pass our end of the pipe to the child process. */ if (pipe_flags & O_CLOEXEC) - fcntl64 (__std[stdchild], F_SETFD, 0); + fcntl (__std[stdchild], F_SETFD, 0); else - fcntl64 (myfd, F_SETFD, FD_CLOEXEC); + fcntl (myfd, F_SETFD, FD_CLOEXEC); =20 /* Also don't pass the file handle currently associated with stdin/s= tdout to the child. This function may actually fail if the stdchild fd is closed. But that's ok. */ - int stdchild_state =3D fcntl64 (stdchild, F_GETFD, 0); - fcntl64 (stdchild, F_SETFD, stdchild_state | FD_CLOEXEC); + int stdchild_state =3D fcntl (stdchild, F_GETFD, 0); + fcntl (stdchild, F_SETFD, stdchild_state | FD_CLOEXEC); =20 /* Start a shell process to run the given command without forking. */ pid_t pid =3D ch_spawn.worker ("/bin/sh", argv, cur_environ (), _P_N= OWAIT, __std[0], __std[1]); =20 /* Reinstate the close-on-exec state */ - fcntl64 (stdchild, F_SETFD, stdchild_state); + fcntl (stdchild, F_SETFD, stdchild_state); =20 /* If pid >=3D 0 then spawn_guts succeeded. */ if (pid >=3D 0) @@ -4711,7 +4682,7 @@ fstatat (int dirfd, const char *__restrict pathname, = struct stat *__restrict st, cwdstuff::cwd_lock.release (); } else - return fstat64 (dirfd, st); + return fstat (dirfd, st); } path_conv pc (path, ((flags & AT_SYMLINK_NOFOLLOW) ? PC_SYM_NOFOLLOW : PC_SYM_FOLLOW) @@ -4869,7 +4840,7 @@ mknodat (int dirfd, const char *pathname, mode_t mode= , dev_t dev) char *path =3D tp.c_get (); if (gen_full_path_at (path, dirfd, pathname)) __leave; - return mknod32 (path, mode, dev); + return mknod (path, mode, dev); } __except (EFAULT) {} __endtry diff --git a/winsup/cygwin/uinfo.cc b/winsup/cygwin/uinfo.cc index f5d5093d3..ce997c0f8 100644 --- a/winsup/cygwin/uinfo.cc +++ b/winsup/cygwin/uinfo.cc @@ -279,37 +279,29 @@ getlogin (void) } =20 extern "C" uid_t -getuid32 (void) +getuid (void) { return cygheap->user.real_uid; } =20 -EXPORT_ALIAS (getuid32, getuid) - extern "C" gid_t -getgid32 (void) +getgid (void) { return cygheap->user.real_gid; } =20 -EXPORT_ALIAS (getgid32, getgid) - extern "C" uid_t -geteuid32 (void) +geteuid (void) { return myself->uid; } =20 -EXPORT_ALIAS (geteuid32, geteuid) - extern "C" gid_t -getegid32 (void) +getegid (void) { return myself->gid; } =20 -EXPORT_ALIAS (getegid32, getegid) - /* Not quite right - cuserid can change, getlogin can't */ extern "C" char * cuserid (char *src) diff --git a/winsup/cygwin/winsup.h b/winsup/cygwin/winsup.h index 1f265ec28..6d817f49f 100644 --- a/winsup/cygwin/winsup.h +++ b/winsup/cygwin/winsup.h @@ -41,17 +41,10 @@ details. */ #ifdef __cplusplus extern "C" { #endif -uid_t getuid32 (); -uid_t geteuid32 (); -int seteuid32 (uid_t); -gid_t getegid32 (void); -struct passwd *getpwuid32 (uid_t); -struct passwd *getpwnam (const char *); struct __sFILE64 *fopen64 (const char *, const char *); struct hostent *cygwin_gethostbyname (const char *name); /* Don't enforce definition of in_addr_t. */ uint32_t cygwin_inet_addr (const char *cp); -int fcntl64 (int fd, int cmd, ...); #ifdef __cplusplus } #endif