diff options
author | Conrad Scott <conrad.scott@dsl.pipex.com> | 2002-06-24 14:55:38 +0400 |
---|---|---|
committer | Conrad Scott <conrad.scott@dsl.pipex.com> | 2002-06-24 14:55:38 +0400 |
commit | 81ce55e9a336e5b0949e922321a5db9cc4f6a623 (patch) | |
tree | 99726a3a8c0a012549a4c6be922518389fd8ffd0 /winsup/cygwin | |
parent | 818553bd80d19433e36adf620cdb4a95152c15f4 (diff) |
Merged changes from HEAD
Diffstat (limited to 'winsup/cygwin')
-rw-r--r-- | winsup/cygwin/ChangeLog | 26 | ||||
-rwxr-xr-x | winsup/cygwin/cygserver_shm.cc | 3 | ||||
-rw-r--r-- | winsup/cygwin/cygwin.sc | 4 | ||||
-rw-r--r-- | winsup/cygwin/fhandler.cc | 13 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_socket.cc | 6 | ||||
-rw-r--r-- | winsup/cygwin/include/sys/ipc.h | 59 | ||||
-rw-r--r-- | winsup/cygwin/include/sys/shm.h | 76 | ||||
-rw-r--r-- | winsup/cygwin/ipc.cc | 2 | ||||
-rw-r--r-- | winsup/cygwin/lib/_cygwin_S_IEXEC.cc | 21 | ||||
-rw-r--r-- | winsup/cygwin/shm.cc | 2 | ||||
-rw-r--r-- | winsup/cygwin/winbase.h | 7 | ||||
-rw-r--r-- | winsup/cygwin/winsup.h | 7 |
12 files changed, 51 insertions, 175 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index abf83c419..9b8411dc8 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,29 @@ +2002-06-23 Conrad Scott <conrad.scott@dsl.pipex.com> + + * fhandler.cc (fhandler_base::fstat): Set S_IFIFO for pipes. + * fhandler_socket.cc (fhandler_socket.cc::fstat): Set S_IFSOCK. + +2002-06-23 Christopher Faylor <cgf@redhat.com> + + * lib/_cygwin_S_IEXEC.cc: Remove obsolete file. + +2002-06-23 Christopher Faylor <cgf@redhat.com> + + Use cygwin_{shm,ipc}.h instead of /sys/{shm,ipc}.h throughout. + * sys/ipc.h: Remove. + * sys/shm.h: Remove. + * cygwin_ipc.h: New file. + * cygwin_shm.h: New file. + +2002-06-23 Christopher Faylor <cgf@redhat.com> + + * cygwin.sc: Add recent changes from ld sources. + +2002-06-23 Conrad Scott <conrad.scott@dsl.pipex.com> + + * winsup.h: Move #ifdef EXPCGF code into "winbase.h". + * winbase.h: #ifdef EXPCGF code moved here from "winsup.h". + 2002-06-21 Conrad Scott <conrad.scott@dsl.pipex.com> * cygserver.cc: The tests for a duplicate server instance are now diff --git a/winsup/cygwin/cygserver_shm.cc b/winsup/cygwin/cygserver_shm.cc index 90473032c..06456095f 100755 --- a/winsup/cygwin/cygserver_shm.cc +++ b/winsup/cygwin/cygserver_shm.cc @@ -12,9 +12,6 @@ #include "woutsup.h" -#include <sys/types.h> -#include <sys/shm.h> - #include <assert.h> #include <errno.h> #include <stdio.h> diff --git a/winsup/cygwin/cygwin.sc b/winsup/cygwin/cygwin.sc index b050e3e37..fe00e2bd4 100644 --- a/winsup/cygwin/cygwin.sc +++ b/winsup/cygwin/cygwin.sc @@ -11,9 +11,9 @@ SECTIONS *(.glue_7t) *(.glue_7) ___CTOR_LIST__ = .; __CTOR_LIST__ = . ; - LONG (-1); *(.ctors); *(.ctor); LONG (0); + LONG (-1); *(SORT(.ctors.*)); *(.ctors); *(.ctor); LONG (0); ___DTOR_LIST__ = .; __DTOR_LIST__ = . ; - LONG (-1); *(.dtors); *(.dtor); LONG (0); + LONG (-1); *(SORT(.dtors.*)); *(.dtors); *(.dtor); LONG (0); *(.fini) /* ??? Why is .gcc_exc here? */ *(.gcc_exc) diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc index 04156c47c..1b8d4583e 100644 --- a/winsup/cygwin/fhandler.cc +++ b/winsup/cygwin/fhandler.cc @@ -829,18 +829,23 @@ fhandler_base::fstat (struct __stat64 *buf, path_conv *) { switch (get_device ()) { + case FH_PIPE: + buf->st_mode = S_IFIFO | STD_RBITS | STD_WBITS | S_IWGRP | S_IWOTH; + break; case FH_PIPEW: - buf->st_mode = STD_WBITS | S_IWGRP | S_IWOTH; + buf->st_mode = S_IFIFO | STD_WBITS | S_IWGRP | S_IWOTH; break; case FH_PIPER: - buf->st_mode = STD_RBITS; + buf->st_mode = S_IFIFO | STD_RBITS; + break; + case FH_FLOPPY: + buf->st_mode = S_IFBLK | STD_RBITS | STD_WBITS | S_IWGRP | S_IWOTH; break; default: - buf->st_mode = STD_RBITS | STD_WBITS | S_IWGRP | S_IWOTH; + buf->st_mode = S_IFCHR | STD_RBITS | STD_WBITS | S_IWGRP | S_IWOTH; break; } - buf->st_mode |= get_device () == FH_FLOPPY ? S_IFBLK : S_IFCHR; buf->st_nlink = 1; buf->st_blksize = S_BLKSIZE; time_as_timestruc_t (&buf->st_ctim); diff --git a/winsup/cygwin/fhandler_socket.cc b/winsup/cygwin/fhandler_socket.cc index 3ef35687e..6a6e0eeba 100644 --- a/winsup/cygwin/fhandler_socket.cc +++ b/winsup/cygwin/fhandler_socket.cc @@ -248,7 +248,11 @@ fhandler_socket::fstat (struct __stat64 *buf, path_conv *pc) { int res = fhandler_base::fstat (buf, pc); if (!res) - buf->st_ino = (ino_t) get_handle (); + { + buf->st_mode &= ~_IFMT; + buf->st_mode |= _IFSOCK; + buf->st_ino = (ino_t) get_handle (); + } return res; } diff --git a/winsup/cygwin/include/sys/ipc.h b/winsup/cygwin/include/sys/ipc.h deleted file mode 100644 index f319aebeb..000000000 --- a/winsup/cygwin/include/sys/ipc.h +++ /dev/null @@ -1,59 +0,0 @@ -/* sys/ipc.h - - Copyright 2001 Red Hat Inc. - Written by Robert Collins <rbtcollins@hotmail.com> - -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 _SYS_IPC_H -#define _SYS_IPC_H - -#ifdef __cplusplus -extern "C" -{ -#endif - -/* - * <sys/types.h> must be included before <sys/ipc.h>. We aren't meant - * to automatically include it however. - */ - -struct ipc_perm { - uid_t uid; - gid_t gid; - uid_t cuid; - gid_t cgid; - mode_t mode; -}; - -/* - * The mode flags used with the _get functions use the low order 9 - * bits for a mode request. - */ -#define IPC_CREAT 0x0200 -#define IPC_EXCL 0x0400 -#define IPC_NOWAIT 0x0800 - -/* This is a value that will _never_ be a valid key from ftok(3). */ -#define IPC_PRIVATE ((key_t) -2) - -/* - * Values for the cmd argument to shmctl(2). - * Commands 1000-1fff are reserved for IPC_xxx. - */ -#define IPC_RMID 0x1000 -#define IPC_SET 0x1001 -#define IPC_STAT 0x1002 -#define IPC_INFO 0x1003 /* For ipcs(8). */ - -key_t ftok(const char *, int); - -#ifdef __cplusplus -} -#endif - -#endif /* _SYS_IPC_H */ diff --git a/winsup/cygwin/include/sys/shm.h b/winsup/cygwin/include/sys/shm.h deleted file mode 100644 index d6873d9ac..000000000 --- a/winsup/cygwin/include/sys/shm.h +++ /dev/null @@ -1,76 +0,0 @@ -/* sys/shm.h - - Copyright 2001 Red Hat Inc. - Written by Robert Collins <rbtcollins@hotmail.com> - -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 _SYS_SHM_H -#define _SYS_SHM_H - -#include <sys/ipc.h> - -#ifdef __cplusplus -extern "C" -{ -#endif - -/* - * 64 Kb was hardcoded for x86. MS states this may change, but we need - * it in the header file. - */ -#define SHMLBA 65536 - -/* - * Values for the shmflg argument to shmat(2). - */ -#define SHM_RDONLY 0x01 /* Attach read-only, not read/write. */ -#define SHM_RND 0x02 /* Round shmaddr down to multiple of SHMLBA. */ - -/* - * Values for the cmd argument to shmctl(2). - * Commands 4000-4fff are reserved for SHM_xxx. - */ -#define SHM_STAT 0x4000 /* For ipcs(8) */ - -typedef long int shmatt_t; - -struct shmid_ds { - struct ipc_perm shm_perm; - size_t shm_segsz; - pid_t shm_lpid; - pid_t shm_cpid; - shmatt_t shm_nattch; - time_t shm_atime; - long shm_spare1; - time_t shm_dtime; - long shm_spare2; - time_t shm_ctime; - long shm_spare3; - long shm_spare4[2]; -}; - -/* Buffer type for shmctl(IPC_INFO, ...) as used by ipcs(8). */ -struct shminfo { - unsigned long shmmax; - unsigned long shmmin; - unsigned long shmmni; - unsigned long shmseg; - unsigned long shmall; - unsigned long shm_spare[4]; -}; - -void *shmat(int shmid, const void *shmaddr, int shmflg); -int shmctl(int shmid, int cmd, struct shmid_ds *buf); -int shmdt(const void *shmaddr); -int shmget(key_t key, size_t size, int shmflg); - -#ifdef __cplusplus -} -#endif - -#endif /* _SYS_SHM_H */ diff --git a/winsup/cygwin/ipc.cc b/winsup/cygwin/ipc.cc index 1f496d328..65924b354 100644 --- a/winsup/cygwin/ipc.cc +++ b/winsup/cygwin/ipc.cc @@ -11,7 +11,7 @@ details. */ #include "winsup.h" -#include <sys/ipc.h> +#include "cygwin_ipc.h" #include <sys/stat.h> extern "C" diff --git a/winsup/cygwin/lib/_cygwin_S_IEXEC.cc b/winsup/cygwin/lib/_cygwin_S_IEXEC.cc deleted file mode 100644 index 371126073..000000000 --- a/winsup/cygwin/lib/_cygwin_S_IEXEC.cc +++ /dev/null @@ -1,21 +0,0 @@ -/* _cygwin_S_IEXEC.cc: stat helper stuff - - Copyright 2001 Red Hat, Inc. - -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. */ - -extern "C" { -#include "winsup.h" -#include <sys/stat.h> -#include <sys/unistd.h> - -unsigned _cygwin_S_IEXEC = S_IEXEC; -unsigned _cygwin_S_IXUSR = S_IXUSR; -unsigned _cygwin_S_IXGRP = S_IXGRP; -unsigned _cygwin_S_IXOTH = S_IXOTH; -unsigned _cygwin_X_OK = X_OK; -}; diff --git a/winsup/cygwin/shm.cc b/winsup/cygwin/shm.cc index 7d52fa3b8..80a47318b 100644 --- a/winsup/cygwin/shm.cc +++ b/winsup/cygwin/shm.cc @@ -23,7 +23,7 @@ details. */ #include "dtable.h" #include "cygheap.h" #include "thread.h" -#include <sys/shm.h> +#include "cygwin_shm.h" #include "cygserver_shm.h" /* diff --git a/winsup/cygwin/winbase.h b/winsup/cygwin/winbase.h index d72bb0893..15d16a429 100644 --- a/winsup/cygwin/winbase.h +++ b/winsup/cygwin/winbase.h @@ -1,5 +1,12 @@ #include_next "winbase.h" +#ifdef EXPCGF +#define DECLARE_TLS_STORAGE char **tls[4096] __attribute__ ((unused)) +#else +#define DECLARE_TLS_STORAGE do {} while (0) +#define _WINBASE2_H +#endif + #ifndef _WINBASE2_H #define _WINBASE2_H diff --git a/winsup/cygwin/winsup.h b/winsup/cygwin/winsup.h index 2758569a5..5735985c7 100644 --- a/winsup/cygwin/winsup.h +++ b/winsup/cygwin/winsup.h @@ -25,13 +25,6 @@ details. */ #define NO_COPY __attribute__((nocommon)) __attribute__((section(".data_cygwin_nocopy"))) -#ifdef EXPCGF -#define DECLARE_TLS_STORAGE char **tls[4096] __attribute__ ((unused)) -#else -#define DECLARE_TLS_STORAGE do {} while (0) -#define _WINBASE2_H -#endif - #ifdef __cplusplus #if !defined(__STDC_VERSION__) || __STDC_VERSION__ >= 199900L |