From 52296b850ce86ab911ec44370d721ec2d5d95254 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Sat, 9 Feb 2002 20:39:55 +0000 Subject: * include/cygwin/grp.h: New file. * include/cygwin/stat.h: Ditto. * include/cygwin/types.h: Add definitions for __off32_t, __off64_t, off_t, __uid16_t, __uid32_t, uid_t, __gid16_t, __gid32_t and gid_t. * include/sys/cygwin.h: Use correct uid and gid types. --- winsup/cygwin/ChangeLog | 9 ++++++ winsup/cygwin/include/cygwin/grp.h | 43 ++++++++++++++++++++++++++++ winsup/cygwin/include/cygwin/stat.h | 54 ++++++++++++++++++++++++++++++++++++ winsup/cygwin/include/cygwin/types.h | 22 ++++++++++++++- winsup/cygwin/include/sys/cygwin.h | 8 +++--- 5 files changed, 131 insertions(+), 5 deletions(-) create mode 100644 winsup/cygwin/include/cygwin/grp.h create mode 100644 winsup/cygwin/include/cygwin/stat.h diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 213a664..7ed9f8d 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,5 +1,14 @@ 2002-02-09 Corinna Vinschen + * include/cygwin/grp.h: New file. + * include/cygwin/stat.h: Ditto. + * include/cygwin/types.h: Add definitions for __off32_t, + __off64_t, off_t, __uid16_t, __uid32_t, uid_t, __gid16_t, + __gid32_t and gid_t. + * include/sys/cygwin.h: Use correct uid and gid types. + +2002-02-09 Corinna Vinschen + * dtable.cc (dtable::dup2): Revert previous patch. * fhandler.h: Ditto. (fhandler_socket::recv): Define new method. diff --git a/winsup/cygwin/include/cygwin/grp.h b/winsup/cygwin/include/cygwin/grp.h new file mode 100644 index 0000000..79b4bcc --- /dev/null +++ b/winsup/cygwin/include/cygwin/grp.h @@ -0,0 +1,43 @@ +/* cygwin/grp.h + + Copyright 2002 Red Hat Inc. + Written by Corinna Vinschen + +This file is part of Cygwin. + +This software is a copyrighted work licensed under the terms of the +Cygwin license. Please consult the file "CYGWIN_LICENSE" for +details. */ + +#ifndef _CYGWIN_GRP_H_ +#define _CYGWIN_GRP_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __INSIDE_CYGWIN__ +struct __group16 +{ + char *gr_name; + char *gr_passwd; + __gid16_t gr_gid; + char **gr_mem; +}; + +struct __group32 +{ + char *gr_name; + char *gr_passwd; + __gid32_t gr_gid; + char **gr_mem; +}; +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* _CYGWIN_GRP_H_ */ diff --git a/winsup/cygwin/include/cygwin/stat.h b/winsup/cygwin/include/cygwin/stat.h new file mode 100644 index 0000000..7385ebc --- /dev/null +++ b/winsup/cygwin/include/cygwin/stat.h @@ -0,0 +1,54 @@ +/* cygwin/stat.h + + Copyright 2002 Red Hat Inc. + Written by Corinna Vinschen + +This file is part of Cygwin. + +This software is a copyrighted work licensed under the terms of the +Cygwin license. Please consult the file "CYGWIN_LICENSE" for +details. */ + +#ifndef _CYGWIN_STAT_H +#define _CYGWIN_STAT_H + +#ifdef __cplusplus +extern "C" { +#endif + +struct stat +{ + dev_t st_dev; + ino_t st_ino; + mode_t st_mode; + nlink_t st_nlink; + __uid16_t __st_uid16; + __gid16_t __st_gid16; + dev_t st_rdev; + __off32_t __st_size32; + time_t st_atime; + __uid32_t __st_uid32; + time_t st_mtime; + __uid32_t __st_gid32; + time_t st_ctime; + long st_spare3; + long st_blksize; + long st_blocks; + __off64_t __st_size64; +}; + +#ifdef __CYGWIN_USE_BIG_TYPES__ +#define st_uid __st_uid32 +#define st_gid __st_gid32 +#define st_size __st_size64 +#else +#define st_uid __st_uid16 +#define st_gid __st_gid16 +#define st_size __st_size32 +#endif /* __CYGWIN_USE_BIG_TYPES__ */ + +#ifdef __cplusplus +} +#endif + +#endif /* _CYGWIN_STAT_H */ diff --git a/winsup/cygwin/include/cygwin/types.h b/winsup/cygwin/include/cygwin/types.h index c17eca4..585225f 100644 --- a/winsup/cygwin/include/cygwin/types.h +++ b/winsup/cygwin/include/cygwin/types.h @@ -1,6 +1,6 @@ /* types.h - Copyright 2001 Red Hat Inc. + Copyright 2001, 2002 Red Hat Inc. Written by Robert Collins This file is part of Cygwin. @@ -17,6 +17,26 @@ extern "C" #ifndef _CYGWIN_TYPES_H #define _CYGWIN_TYPES_H +typedef long __off32_t; +typedef long long __off64_t; +#ifdef __CYGWIN_USE_BIG_TYPES__ +typedef __off64_t off_t; +#else +typedef __off32_t off_t; +#endif + +typedef unsigned short __uid16_t; +typedef unsigned short __gid16_t; +typedef unsigned long __uid32_t; +typedef unsigned long __gid32_t; +#ifdef __CYGWIN_USE_BIG_TYPES__ +typedef __uid32_t uid_t; +typedef __gid32_t gid_t; +#else +typedef __uid16_t uid_t; +typedef __gid16_t gid_t; +#endif + #if !defined(__INSIDE_CYGWIN__) || !defined(__cplusplus) typedef void *pthread_t; diff --git a/winsup/cygwin/include/sys/cygwin.h b/winsup/cygwin/include/sys/cygwin.h index b8add0e..76c553e 100644 --- a/winsup/cygwin/include/sys/cygwin.h +++ b/winsup/cygwin/include/sys/cygwin.h @@ -209,8 +209,8 @@ extern int cygwin_attach_handle_to_fd (char *, int, HANDLE, mode_t, DWORD); #define TTY_CONSOLE 0x40000000 #ifndef _SYS_TYPES_H -typedef short uid_t; -typedef short gid_t; +typedef unsigned short __uid16_t; +typedef unsigned short __gid16_t; #endif struct external_pinfo @@ -219,8 +219,8 @@ struct external_pinfo pid_t ppid; HANDLE hProcess; DWORD dwProcessId, dwSpawnedProcessId; - uid_t uid; - gid_t gid; + __uid16_t uid; + __gid16_t gid; pid_t pgid; pid_t sid; int ctty; -- cgit v1.1