summaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorscottc <scottc>2002-06-24 10:55:33 +0000
committerscottc <scottc>2002-06-24 10:55:33 +0000
commit00218ce2ed1bb153754a31f628ea7b9d4600b72b (patch)
tree8219acbb7f8868552819abe3e5db2865390e5244 /winsup
parent0f600c4d9f32234a0e8d43326b102f4079beb297 (diff)
downloadgdb-00218ce2ed1bb153754a31f628ea7b9d4600b72b.tar.gz
Merged changes from HEAD
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog26
-rwxr-xr-xwinsup/cygwin/cygserver_shm.cc3
-rw-r--r--winsup/cygwin/cygwin.sc4
-rwxr-xr-x[-rw-r--r--]winsup/cygwin/cygwin_ipc.h (renamed from winsup/cygwin/include/sys/ipc.h)36
-rwxr-xr-xwinsup/cygwin/cygwin_shm.h89
-rw-r--r--winsup/cygwin/fhandler.cc13
-rw-r--r--winsup/cygwin/fhandler_socket.cc6
-rw-r--r--winsup/cygwin/include/sys/shm.h76
-rw-r--r--winsup/cygwin/ipc.cc2
-rw-r--r--winsup/cygwin/shm.cc2
-rw-r--r--winsup/cygwin/winbase.h7
-rw-r--r--winsup/cygwin/winsup.h7
12 files changed, 155 insertions, 116 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index abf83c41945..9b8411dc809 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 90473032c5e..06456095f88 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 b050e3e3702..fe00e2bd434 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/include/sys/ipc.h b/winsup/cygwin/cygwin_ipc.h
index f319aebeb54..c718a173a0e 100644..100755
--- a/winsup/cygwin/include/sys/ipc.h
+++ b/winsup/cygwin/cygwin_ipc.h
@@ -9,17 +9,16 @@ 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.
+#ifndef _SYS_IPC_H
+#define _SYS_IPC_H
+
+/* sys/types must be included before sys/ipc.h. We aren't meant to automatically
+ * include it however
*/
struct ipc_perm {
@@ -30,30 +29,25 @@ struct ipc_perm {
mode_t mode;
};
-/*
- * The mode flags used with the _get functions use the low order 9
- * bits for a mode request.
+/* 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)
+/* this is a value that will _never_ be a valid key from ftok */
+#define IPC_PRIVATE -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). */
+/* ctl commands 1000-1fff is ipc reserved */
+#define IPC_RMID 0x1003
+#define IPC_SET 0x1002
+#define IPC_STAT 0x1001
key_t ftok(const char *, int);
+#endif /* _SYS_IPC_H */
+
#ifdef __cplusplus
}
#endif
-
-#endif /* _SYS_IPC_H */
diff --git a/winsup/cygwin/cygwin_shm.h b/winsup/cygwin/cygwin_shm.h
new file mode 100755
index 00000000000..a3aa2f47383
--- /dev/null
+++ b/winsup/cygwin/cygwin_shm.h
@@ -0,0 +1,89 @@
+/* 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. */
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#ifndef _SYS_SHM_H
+#define _SYS_SHM_H
+
+#include "cygwin_ipc.h"
+
+#define SHM_RDONLY 1
+/* 64 Kb was hardcoded for x86. MS states this may change, but we need it in the header
+ * file.
+ */
+#define SHMLBA 65536
+#define SHM_RND 1
+
+typedef long int shmatt_t;
+
+#if defined(__INSIDE_CYGWIN__) && defined(__cplusplus)
+
+class _shmattach {
+public:
+ void *data;
+ int shmflg;
+ class _shmattach *next;
+};
+
+class shmid_ds {
+public:
+ 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;
+ time_t shm_dtime;
+ time_t shm_ctime;
+ void *mapptr;
+};
+
+class shmnode {
+public:
+ class shmid_ds * shmds;
+ int shm_id;
+ class shmnode *next;
+ key_t key;
+ HANDLE filemap;
+ HANDLE attachmap;
+ class _shmattach *attachhead;
+};
+
+#else
+/* this is what we return when queried. It has no bitwise correspondence
+ * the internal structures
+ */
+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;
+ time_t shm_dtime;
+ time_t shm_ctime;
+};
+#endif /* __INSIDE_CYGWIN__ */
+
+void *shmat(int, const void *, int);
+int shmctl(int, int, struct shmid_ds *);
+int shmdt(const void *);
+int shmget(key_t, size_t, int);
+
+#endif /* _SYS_SHM_H */
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc
index 04156c47c48..1b8d4583e7e 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 3ef35687e34..6a6e0eeba3f 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/shm.h b/winsup/cygwin/include/sys/shm.h
deleted file mode 100644
index d6873d9ac5a..00000000000
--- 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 1f496d328a7..65924b354c4 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/shm.cc b/winsup/cygwin/shm.cc
index 7d52fa3b814..80a47318bdf 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 d72bb0893ce..15d16a4292b 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 2758569a58d..5735985c71d 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