* Merge in cygwin-64bit-branch.

This commit is contained in:
Corinna Vinschen
2013-04-23 09:44:36 +00:00
parent 1875ee55d3
commit 61522196c7
253 changed files with 10632 additions and 5055 deletions

View File

@ -59,24 +59,20 @@ extern "C" {
#define OTHER OTHER_OBJ
#ifdef __INSIDE_CYGWIN__
#ifndef __x86_64__
typedef struct __acl16 {
int a_type;
__uid16_t a_id;
mode_t a_perm;
} __aclent16_t;
#endif
#endif
typedef struct __acl32 {
int a_type;
__uid32_t a_id;
mode_t a_perm;
} __aclent32_t;
#else
typedef struct acl {
int a_type; /* entry type */
uid_t a_id; /* UID | GID */
mode_t a_perm; /* permissions */
} aclent_t;
#endif
#ifndef __INSIDE_CYGWIN__
int _EXFUN(acl,(const char *path, int cmd, int nentries, aclent_t *aclbufp));

View File

@ -4,7 +4,7 @@
sys/config.h before. This way we can manaage our configuration
setting without bothering newlib.
Copyright 2003, 2007, 2008, 2009, 2010, 2012 Red Hat, Inc.
Copyright 2003, 2007, 2008, 2009, 2010, 2012, 2013 Red Hat, Inc.
Written by C. Vinschen.
This file is part of Cygwin.
@ -38,11 +38,31 @@ extern "C" {
we might as well just use it here. */
#ifdef _COMPILING_NEWLIB
#ifdef __x86_64__
#include "../tlsoffsets64.h"
/* We would like to use just "%gs:8", but on x86_64 gcc uses pc-relative
addressing and translates "gs:8" into the wrong addressing mode. */
static inline char *___getreent (void)
{
register char *ret;
__asm __volatile__ ("movq %%gs:8,%0" : "=r" (ret));
return ret + tls_local_clib;
}
#define __getreent() ((struct _reent *) ___getreent())
#else
#include "../tlsoffsets.h"
extern char *_tlsbase __asm__ ("%fs:4");
#define __getreent() (struct _reent *)(_tlsbase + tls_local_clib)
#endif
#endif /* _COMPILING_NEWLIB */
#ifdef __x86_64__
# define __SYMBOL_PREFIX
#else
# define __SYMBOL_PREFIX "_"
#endif
#define _SYMSTR(x) __SYMBOL_PREFIX #x
#define __FILENAME_MAX__ 4096 /* Keep in sync with PATH_MAX in limits.h. */
/* The following block of macros is required to build newlib correctly for

View File

@ -1,6 +1,6 @@
/* cygwin_dll.h
Copyright 1998, 1999, 2000, 2001, 2009, 2011 Red Hat, Inc.
Copyright 1998, 1999, 2000, 2001, 2009, 2011, 2012, 2013 Red Hat, Inc.
This file is part of Cygwin.
@ -26,8 +26,8 @@ details. */
CDECL_BEGIN \
int WINAPI Entry (HINSTANCE h, DWORD reason, void *ptr); \
typedef int (*mainfunc) (int, char **, char **); \
extern int cygwin_attach_dll (HMODULE, mainfunc); \
extern void cygwin_detach_dll (DWORD); \
extern PVOID cygwin_attach_dll (HMODULE, mainfunc); \
extern void cygwin_detach_dll (PVOID); \
CDECL_END \
\
static HINSTANCE storedHandle; \
@ -35,12 +35,14 @@ static DWORD storedReason; \
static void* storedPtr; \
int __dynamically_loaded; \
\
static int __dllMain (int a, char **b, char **c) \
static int __dllMain (int a __attribute__ ((unused)), \
char **b __attribute__ ((unused)), \
char **c __attribute__ ((unused))) \
{ \
return Entry (storedHandle, storedReason, storedPtr); \
} \
\
static DWORD dll_index; \
static PVOID dll_index; \
\
int WINAPI _cygwin_dll_entry (HINSTANCE h, DWORD reason, void *ptr) \
{ \
@ -56,7 +58,7 @@ int WINAPI _cygwin_dll_entry (HINSTANCE h, DWORD reason, void *ptr) \
storedPtr = ptr; \
__dynamically_loaded = (ptr == NULL); \
dll_index = cygwin_attach_dll (h, &__dllMain); \
if (dll_index == (DWORD) -1) \
if (dll_index == (PVOID) -1) \
ret = 0; \
} \
break; \
@ -67,7 +69,7 @@ int WINAPI _cygwin_dll_entry (HINSTANCE h, DWORD reason, void *ptr) \
if (ret) \
{ \
cygwin_detach_dll (dll_index); \
dll_index = (DWORD) -1; \
dll_index = (PVOID) -1; \
} \
} \
break; \

View File

@ -19,6 +19,7 @@ extern "C" {
#endif
#ifdef __INSIDE_CYGWIN__
#ifndef __x86_64__
struct __group16
{
char *gr_name;
@ -26,19 +27,12 @@ struct __group16
__gid16_t gr_gid;
char **gr_mem;
};
#endif
struct __group32
{
char *gr_name;
char *gr_passwd;
__gid32_t gr_gid;
char **gr_mem;
};
struct __group32 * getgrgid32 (__gid32_t gid);
struct __group32 * getgrnam32 (const char *name);
__gid32_t getgid32 ();
__gid32_t getegid32 ();
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 *);

View File

@ -1,6 +1,6 @@
/* sys/ipc.h
Copyright 2001, 2002 Red Hat Inc.
Copyright 2001, 2002, 2012, 2013 Red Hat Inc.
Written by Robert Collins <rbtcollins@hotmail.com>
This file is part of Cygwin.
@ -13,6 +13,7 @@ details. */
#define _CYGWIN_IPC_H
#include <sys/types.h>
#include <stdint.h>
#ifdef __cplusplus
extern "C"

View File

@ -1,6 +1,6 @@
/* sys/msg.h
Copyright 2002 Red Hat Inc.
Copyright 2002, 2012, 2013 Red Hat Inc.
Written by Conrad Scott <conrad.scott@dsl.pipex.com>
This file is part of Cygwin.
@ -32,11 +32,11 @@ extern "C"
/* Used for the number of messages in the message queue.
*/
typedef unsigned long msgqnum_t;
typedef uint32_t msgqnum_t;
/* Used for the number of bytes allowed in a message queue.
*/
typedef unsigned long msglen_t;
typedef uint32_t msglen_t;
struct msqid_ds
{
@ -66,27 +66,27 @@ struct msqid_ds
*/
struct msginfo
{
long msgmax; /* Maximum number of bytes per
int32_t msgmax; /* Maximum number of bytes per
message. */
long msgmnb; /* Maximum number of bytes on any one
int32_t msgmnb; /* Maximum number of bytes on any one
message queue. */
long msgmni; /* Maximum number of message queues,
int32_t msgmni; /* Maximum number of message queues,
system wide. */
long msgtql; /* Maximum number of messages, system
int32_t msgtql; /* Maximum number of messages, system
wide. */
long msgssz; /* Size of a message segment, must be
int32_t msgssz; /* Size of a message segment, must be
small power of 2 greater than 4. */
long msgseg; /* Number of message segments */
long msg_spare[2];
int32_t msgseg; /* Number of message segments */
int32_t msg_spare[2];
};
/* Buffer type for msgctl (MSG_INFO, ...) as used by ipcs(8).
*/
struct msg_info
{
long msg_ids; /* Number of allocated queues. */
long msg_num; /* Number of messages, system wide. */
long msg_tot; /* Size in bytes of messages, system wide. */
int32_t msg_ids; /* Number of allocated queues. */
int32_t msg_num; /* Number of messages, system wide. */
int32_t msg_tot; /* Size in bytes of messages, system wide. */
};
#endif /* _KERNEL */

View File

@ -1,6 +1,6 @@
/* sys/sem.h
Copyright 2002 Red Hat Inc.
Copyright 2002, 2012, 2013 Red Hat Inc.
Written by Conrad Scott <conrad.scott@dsl.pipex.com>
This file is part of Cygwin.
@ -67,23 +67,23 @@ struct sembuf
*/
struct seminfo
{
long semmni; /* Maximum number of unique semaphore
int32_t semmni; /* Maximum number of unique semaphore
sets, system wide. */
long semmns; /* Maximum number of semaphores,
int32_t semmns; /* Maximum number of semaphores,
system wide. */
long semmsl; /* Maximum number of semaphores per
int32_t semmsl; /* Maximum number of semaphores per
semaphore set. */
long semopm; /* Maximum number of operations per
int32_t semopm; /* Maximum number of operations per
semop call. */
long semmnu; /* Maximum number of undo structures,
int32_t semmnu; /* Maximum number of undo structures,
system wide. */
long semume; /* Maximum number of undo entries per
int32_t semume; /* Maximum number of undo entries per
undo structure. */
long semvmx; /* Maximum semaphore value. */
long semaem; /* Maximum adjust-on-exit value. */
long semmap; /* # of entries in semaphore map */
long semusz; /* size in bytes of undo structure */
long sem_spare[2];
int32_t semvmx; /* Maximum semaphore value. */
int32_t semaem; /* Maximum adjust-on-exit value. */
int32_t semmap; /* # of entries in semaphore map */
int32_t semusz; /* size in bytes of undo structure */
int32_t sem_spare[2];
};
/* Buffer type for semctl (SEM_INFO, ...) as used by ipcs(8).

View File

@ -1,6 +1,6 @@
/* sys/shm.h
Copyright 2001, 2002 Red Hat Inc.
Copyright 2001, 2002, 2012, 2013 Red Hat Inc.
Written by Robert Collins <rbtcollins@hotmail.com>
This file is part of Cygwin.
@ -40,12 +40,12 @@ extern "C"
/* Unsigned integer used for the number of current attaches.
*/
typedef unsigned int shmatt_t;
typedef uint32_t shmatt_t;
struct shmid_ds
{
struct ipc_perm shm_perm; /* Operation permission structure. */
size_t shm_segsz; /* Size of segment in bytes. */
uint32_t shm_segsz; /* Size of segment in bytes. */
pid_t shm_lpid; /* Process ID of last operation. */
pid_t shm_cpid; /* Process ID of creator. */
shmatt_t shm_nattch;/* Number of current attaches. */
@ -69,17 +69,20 @@ struct shmid_ds
*/
struct shminfo
{
long shmmax; /* Maximum size in bytes of a shared
int32_t shmmax; /* Maximum size in bytes of a shared
memory segment. */
long shmmin; /* Minimum size in bytes of a shared
int32_t shmmin; /* Minimum size in bytes of a shared
memory segment. */
long shmmni; /* Maximum number of shared memory
int32_t shmmni; /* Maximum number of shared memory
segments, system wide. */
long shmseg; /* Maximum number of shared memory
int32_t shmseg; /* Maximum number of shared memory
segments attached per process. */
long shmall; /* Maximum number of bytes of shared
memory, system wide. */
long shm_spare[4];
int32_t shmall; /* Maximum number of bytes of shared
memory, system wide.
Note that XSI IPC shared memory allocation is
restricted to a bit less than 2 Gigs, even on
64 bit, so using an int32_t here is sufficient. */
int32_t shm_spare[4];
};
/* Buffer type for shmctl (SHM_INFO, ...) as used by ipcs(8).
@ -87,9 +90,9 @@ struct shminfo
struct shm_info
{
#define shm_ids used_ids
long used_ids; /* Number of allocated segments. */
long shm_tot; /* Size in bytes of allocated segments. */
long shm_atts; /* Number of attached segments, system
int32_t used_ids; /* Number of allocated segments. */
int32_t shm_tot; /* Size in bytes of allocated segments. */
int32_t shm_atts; /* Number of attached segments, system
wide. */
};
#endif /* _KERNEL */

View File

@ -12,53 +12,144 @@
#ifndef _CYGWIN_SIGNAL_H
#define _CYGWIN_SIGNAL_H
#include <bits/wordsize.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __x86_64__
struct _uc_fpxreg {
__uint16_t significand[4];
__uint16_t exponent;
__uint16_t padding[3];
};
struct _uc_xmmreg {
__uint32_t element[4];
};
struct _fpstate
{
unsigned long cw;
unsigned long sw;
unsigned long tag;
unsigned long ipoff;
unsigned long cssel;
unsigned long dataoff;
unsigned long datasel;
unsigned char _st[80];
unsigned long nxst;
__uint16_t cwd;
__uint16_t swd;
__uint16_t ftw;
__uint16_t fop;
__uint64_t rip;
__uint64_t rdp;
__uint32_t mxcsr;
__uint32_t mxcr_mask;
struct _uc_fpxreg st[8];
struct _uc_xmmreg xmm[16];
__uint32_t padding[24];
};
struct ucontext
{
unsigned long cr2;
unsigned long dr0;
unsigned long dr1;
unsigned long dr2;
unsigned long dr3;
unsigned long dr6;
unsigned long dr7;
struct _fpstate fpstate;
unsigned long gs;
unsigned long fs;
unsigned long es;
unsigned long ds;
unsigned long edi;
unsigned long esi;
unsigned long ebx;
unsigned long edx;
unsigned long ecx;
unsigned long eax;
unsigned long ebp;
unsigned long eip;
unsigned long cs;
unsigned long eflags;
unsigned long esp;
unsigned long ss;
unsigned char _internal;
unsigned long oldmask;
__uint64_t p1home;
__uint64_t p2home;
__uint64_t p3home;
__uint64_t p4home;
__uint64_t p5home;
__uint64_t p6home;
__uint32_t cr2;
__uint32_t mxcsr;
__uint16_t cs;
__uint16_t ds;
__uint16_t es;
__uint16_t fs;
__uint16_t gs;
__uint16_t ss;
__uint32_t eflags;
__uint64_t dr0;
__uint64_t dr1;
__uint64_t dr2;
__uint64_t dr3;
__uint64_t dr6;
__uint64_t dr7;
__uint64_t rax;
__uint64_t rcx;
__uint64_t rdx;
__uint64_t rbx;
__uint64_t rsp;
__uint64_t rbp;
__uint64_t rsi;
__uint64_t rdi;
__uint64_t r8;
__uint64_t r9;
__uint64_t r10;
__uint64_t r11;
__uint64_t r12;
__uint64_t r13;
__uint64_t r14;
__uint64_t r15;
__uint64_t rip;
struct _fpstate fpregs;
__uint64_t vcx;
__uint64_t dbc;
__uint64_t btr;
__uint64_t bfr;
__uint64_t etr;
__uint64_t efr;
__uint8_t _internal;
__uint64_t oldmask;
};
#define __COPY_CONTEXT_SIZE ((unsigned) &((struct ucontext *) 0)->_internal)
#else /* !x86_64 */
struct _uc_fpreg
{
__uint16_t significand[4];
__uint16_t exponent;
};
struct _fpstate
{
__uint32_t cw;
__uint32_t sw;
__uint32_t tag;
__uint32_t ipoff;
__uint32_t cssel;
__uint32_t dataoff;
__uint32_t datasel;
struct _uc_fpreg _st[8];
__uint32_t nxst;
};
struct ucontext
{
__uint32_t cr2;
__uint32_t dr0;
__uint32_t dr1;
__uint32_t dr2;
__uint32_t dr3;
__uint32_t dr6;
__uint32_t dr7;
struct _fpstate fpstate;
__uint32_t gs;
__uint32_t fs;
__uint32_t es;
__uint32_t ds;
__uint32_t edi;
__uint32_t esi;
__uint32_t ebx;
__uint32_t edx;
__uint32_t ecx;
__uint32_t eax;
__uint32_t ebp;
__uint32_t eip;
__uint32_t cs;
__uint32_t eflags;
__uint32_t esp;
__uint32_t ss;
__uint8_t _internal;
__uint32_t oldmask;
};
#endif /* !x86_64 */
#define __COPY_CONTEXT_SIZE ((size_t) (uintptr_t) &((struct ucontext *) 0)->_internal)
typedef union sigval
{
@ -208,7 +299,13 @@ enum
perform notification */
};
#if __WORDSIZE == 64
typedef __uint64_t sigset_t;
#else
/* FIXME: We should probably raise the # of signals for 32 bit as well.
Unfortunately this is an ABI change so requires some forethought. */
typedef __uint32_t sigset_t;
#endif
typedef void (*_sig_func_ptr)(int);
@ -274,10 +371,15 @@ struct sigaction
#define SIGUSR1 30 /* user defined signal 1 */
#define SIGUSR2 31 /* user defined signal 2 */
#if __WORDSIZE == 64
#define NSIG 65 /* signal 0 implied */
#else
#define NSIG 33 /* signal 0 implied */
#endif
/* Real-Time signals per SUSv3. RT_SIGMAX is defined as 8 in limits.h */
#define SIGRTMIN 32
#define SIGRTMAX ((SIGRTMIN) + 0)
#define NSIG 33 /* signal 0 implied */
#define SIGRTMAX (NSIG - 1)
#define SIG_HOLD ((_sig_func_ptr)2) /* Signal in signal mask */

View File

@ -55,8 +55,8 @@ struct sockaddr_storage {
struct ucred {
pid_t pid;
__uid32_t uid;
__gid32_t gid;
uid_t uid;
gid_t gid;
};
struct linger {

View File

@ -16,49 +16,6 @@ details. */
extern "C" {
#endif
#if defined (__INSIDE_CYGWIN__) || defined (_COMPILING_NEWLIB)
struct __stat32
{
__dev16_t st_dev;
__ino32_t st_ino;
mode_t st_mode;
nlink_t st_nlink;
__uid16_t st_uid;
__gid16_t st_gid;
__dev16_t st_rdev;
_off_t st_size;
timestruc_t st_atim;
timestruc_t st_mtim;
timestruc_t st_ctim;
blksize_t st_blksize;
__blkcnt32_t st_blocks;
long st_spare4[2];
};
struct __stat64
{
__dev32_t st_dev;
__ino64_t st_ino;
mode_t st_mode;
nlink_t st_nlink;
__uid32_t st_uid;
__gid32_t st_gid;
__dev32_t st_rdev;
_off64_t st_size;
timestruc_t st_atim;
timestruc_t st_mtim;
timestruc_t st_ctim;
blksize_t st_blksize;
__blkcnt64_t st_blocks;
timestruc_t st_birthtim;
};
extern int fstat64 (int fd, struct __stat64 *buf);
extern int stat64 (const char *file_name, struct __stat64 *buf);
extern int lstat64 (const char *file_name, struct __stat64 *buf);
#endif
struct stat
{
dev_t st_dev;
@ -77,6 +34,33 @@ struct stat
timestruc_t st_birthtim;
};
#if defined (__INSIDE_CYGWIN__) || defined (_COMPILING_NEWLIB)
#ifndef __x86_64__
struct __stat32
{
__dev16_t st_dev;
__ino32_t st_ino;
mode_t st_mode;
nlink_t st_nlink;
__uid16_t st_uid;
__gid16_t st_gid;
__dev16_t st_rdev;
_off_t st_size;
timestruc_t st_atim;
timestruc_t st_mtim;
timestruc_t st_ctim;
blksize_t st_blksize;
__blkcnt32_t st_blocks;
long st_spare4[2];
};
#endif
extern int fstat64 (int fd, struct stat *buf);
extern int stat64 (const char *file_name, struct stat *buf);
extern int lstat64 (const char *file_name, struct stat *buf);
#endif
#define st_atime st_atim.tv_sec
#define st_mtime st_mtim.tv_sec
#define st_ctime st_ctim.tv_sec

View File

@ -1,6 +1,6 @@
/* cygwin/sysproto.h
Copyright 2003, 2005 Red Hat, Inc.
Copyright 2003, 2005, 2012, 2013 Red Hat, Inc.
This file is part of Cygwin.

View File

@ -26,10 +26,10 @@ time_t __cdecl timegm (struct tm *);
#ifndef __STRICT_ANSI__
extern int daylight __asm__ ("__daylight");
extern int daylight __asm__ (_SYMSTR (_daylight));
#ifndef __timezonefunc__
extern long timezone __asm__ ("__timezone");
extern long timezone __asm__ (_SYMSTR (_timezone));
#endif
#endif /*__STRICT_ANSI__*/

View File

@ -19,6 +19,7 @@ extern "C"
#include <stdint.h>
#include <endian.h>
#include <bits/wordsize.h>
#ifndef __timespec_t_defined
#define __timespec_t_defined
@ -32,68 +33,72 @@ typedef struct timespec timestruc_t;
#ifndef __off_t_defined
#define __off_t_defined
/* Based on the newlib definitions. */
#if __WORDSIZE == 64
typedef _off_t off_t;
#else
typedef _off64_t off_t;
#endif
#endif /*__off_t_defined*/
typedef __loff_t loff_t;
#ifndef __dev_t_defined
#define __dev_t_defined
typedef short __dev16_t;
typedef unsigned long __dev32_t;
typedef __dev32_t dev_t;
typedef __int16_t __dev16_t;
typedef __uint32_t dev_t;
#endif /*__dev_t_defined*/
#ifndef __blksize_t_defined
#define __blksize_t_defined
typedef long blksize_t;
typedef __int32_t blksize_t;
#endif /*__blksize_t_defined*/
#ifndef __blkcnt_t_defined
#define __blkcnt_t_defined
typedef long __blkcnt32_t;
typedef long long __blkcnt64_t;
typedef __blkcnt64_t blkcnt_t;
typedef __int32_t __blkcnt32_t;
typedef __int64_t blkcnt_t;
#endif /*__blkcnt_t_defined*/
#ifndef __fsblkcnt_t_defined
#define __fsblkcnt_t_defined
/* Keep as is. 32 bit on i386, 64 bit on x86_64. */
typedef unsigned long fsblkcnt_t;
#endif /* __fsblkcnt_t_defined */
#ifndef __fsfilcnt_t_defined
#define __fsfilcnt_t_defined
/* Keep as is. 32 bit on i386, 64 bit on x86_64. */
typedef unsigned long fsfilcnt_t;
#endif /* __fsfilcnt_t_defined */
#ifndef __uid_t_defined
#define __uid_t_defined
typedef unsigned short __uid16_t;
typedef unsigned long __uid32_t;
typedef __uid32_t uid_t;
typedef __uint32_t uid_t;
#endif /*__uid_t_defined*/
#ifndef __gid_t_defined
#define __gid_t_defined
typedef unsigned short __gid16_t;
typedef unsigned long __gid32_t;
typedef __gid32_t gid_t;
typedef __uint32_t gid_t;
#endif /*__gid_t_defined*/
#ifndef __ino_t_defined
#define __ino_t_defined
typedef unsigned long __ino32_t;
typedef unsigned long long __ino64_t;
typedef __ino64_t ino_t;
#ifndef __x86_64__
typedef __uint32_t __ino32_t;
#endif
typedef __uint64_t ino_t;
#endif /*__ino_t_defined*/
/* Generic ID type, must match at least pid_t, uid_t and gid_t in size. */
#ifndef __id_t_defined
#define __id_t_defined
typedef unsigned long id_t;
typedef __uint32_t id_t;
#endif /* __id_t_defined */
#if defined (__INSIDE_CYGWIN__)
#if defined (__INSIDE_CYGWIN__) && !defined (__x86_64__)
struct __flock32 {
short l_type; /* F_RDLCK, F_WRLCK, or F_UNLCK */
short l_whence; /* flag to choose starting offset */
@ -102,14 +107,6 @@ struct __flock32 {
short l_pid; /* returned with F_GETLK */
short l_xxx; /* reserved for future use */
};
struct __flock64 {
short l_type; /* F_RDLCK, F_WRLCK, or F_UNLCK */
short l_whence; /* flag to choose starting offset */
_off64_t l_start; /* relative offset, in bytes */
_off64_t l_len; /* length, in bytes; 0 means lock to EOF */
pid_t l_pid; /* returned with F_GETLK */
};
#endif
struct flock {

View File

@ -1,7 +1,7 @@
/* version.h -- Cygwin version numbers and accompanying documentation.
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
2007, 2008, 2009, 2010, 2011, 2012, 2013 Red Hat, Inc.
2007, 2008, 2009, 2010, 2011, 2012 Red Hat, Inc.
This file is part of Cygwin.