Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorRobert Collins <rbtcollins@hotmail.com>2002-01-22 07:52:43 +0300
committerRobert Collins <rbtcollins@hotmail.com>2002-01-22 07:52:43 +0300
commit9f32892e665ee35e59ff677d922556a0530b8abf (patch)
tree2d821cddd8b46a0aae2fbc3dd1a470e0ed48ab09 /winsup
parent4dc42e4e0d00d0529e730b34966b7d6b49648d32 (diff)
Merged changes from HEAD
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog94
-rw-r--r--winsup/cygwin/Makefile.in9
-rwxr-xr-xwinsup/cygwin/cygmagic8
-rw-r--r--winsup/cygwin/cygwin.din4
-rw-r--r--winsup/cygwin/exceptions.cc9
-rw-r--r--winsup/cygwin/grp.cc2
-rw-r--r--winsup/cygwin/include/cygwin/version.h6
-rw-r--r--winsup/cygwin/include/sys/socket.h2
-rw-r--r--winsup/cygwin/net.cc61
-rw-r--r--winsup/cygwin/security.cc1
-rw-r--r--winsup/cygwin/sigproc.cc2
-rwxr-xr-xwinsup/cygwin/speclib3
-rw-r--r--winsup/cygwin/sync.h6
-rw-r--r--winsup/cygwin/syscalls.cc4
14 files changed, 192 insertions, 19 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index a86c64af2..cce04bf32 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -268,6 +268,100 @@ Tue Sep 25 16:22:00 2001 Robert Collins <rbtcollins@hotmail.com>
* include/sys/ipc.h: New file.
* include/sys/shm.h: New file.
+2002-01-21 Christopher Faylor <cgf@redhat.com>
+
+ * cygmagic: Suppress error output when figuring out if sum takes an
+ option.
+
+2002-01-21 Christopher Faylor <cgf@redhat.com>
+
+ * cygmagic: Attempt to figure out if sum takes an option.
+
+2002-01-21 DJ Delorie <dj@redhat.com>
+
+ * Makefile.in (libpthread.a): Pass the assembler also.
+ (libm.a): Ditto.
+ (libc.a): Ditto.
+ * speclib: Specify the assembler to dlltool.
+
+2002-01-21 Christopher Faylor <cgf@redhat.com>
+
+ * include/cygwin/version.h: Bump DLL minor number.
+
+2002-01-21 Corinna Vinschen <corinna@vinschen.de>
+
+ * grp.cc (getgrgid): Don't return default gid entry when ntsec is on.
+ * syscalls.cc (setegid): Don't set primary group in process token.
+
+2002-01-21 Christopher Faylor <cgf@redhat.com>
+
+ * speclib: Don't use /dev/null as DLL name. Just default to what's
+ already in .def file.
+
+2002-01-21 Christopher Faylor <cgf@redhat.com>
+
+ * exceptions.cc (sig_handle): Remove last vestiges of SA_NOCLDSTOP code
+ which caused SIGCHLD to be ignored.
+
+2002-01-20 Christopher Faylor <cgf@redhat.com>
+
+ * include/cygwin/version.h: Bump DLL minor number.
+
+2002-01-20 Christopher Faylor <cgf@redhat.com>
+
+ * syscalls.cc (regfree): Make dll_export.
+
+2002-01-20 Christopher Faylor <cgf@redhat.com>
+
+ * exceptions.cc (ctrl_c_handler): Convert windows pid to cygwin pid
+ when detecting if we should actually handle CTRL-C.
+
+2002-01-19 Christopher Faylor <cgf@redhat.com>
+
+ * Makefile.in (new-cygwin1.dll): Revert previous change. libsupc++.a
+ is only available in libstdc++-v3.
+
+2002-01-19 Christopher Faylor <cgf@redhat.com>
+
+ * exceptions.cc (sig_handle_tty_stop): Don't send SIGCHLD if parent
+ doesn't want it.
+ (sig_handle): Don't check for SA_NOCLDSTOP here. We don't have enough
+ information.
+
+2002-01-19 Christopher Faylor <cgf@redhat.com>
+
+ * include/cygwin/version.h: Bump DLL minor number.
+
+2002-01-19 Christopher Faylor <cgf@redhat.com>
+
+ * Makefile.in (new-cygwin1.dll): Just use -lsupc++ for link.
+ * sigproc.cc (proc_exists): Change existence criteria.
+ * sync.h (new_muto): Add volatile to definition to avoid gcc
+ optimization problems.
+
+2002-01-19 Corinna Vinschen <corinna@vinschen.de>
+
+ * include/cygwin/version.h: Bump API minor version to 51.
+
+2002-01-19 Mark Bradshaw <bradshaw@staff.crosswalk.com>
+
+ * cygwin.din: Add recvmsg and sendmsg.
+ * net.cc: Add cygwin_recvmsg and cygwin_sendmsg.
+ * /usr/include/sys/socket.h: Add recvmsg and sendmsg.
+
+2002-01-19 Corinna Vinschen <corinna@vinschen.de>
+
+ * security.cc (create_token): Close processes token handle as soon
+ as it's not used anymore.
+
+2002-01-17 Corinna Vinschen <corinna@vinschen.de>
+
+ * Makefile.in: Add fnmatch.o to DLL_OFILES.
+ * cygwin.din: Add fnmatch export symbol.
+ * fnmatch.c: New file.
+ * include/fnmatch.h: Ditto.
+ * include/cygwin/version.h: Bump API minor version to 50.
+
2002-01-15 Corinna Vinschen <corinna@vinschen.de>
* path.cc (fchdir): Call chdir with full windows path.
diff --git a/winsup/cygwin/Makefile.in b/winsup/cygwin/Makefile.in
index b61a79f22..39bbfb7ee 100644
--- a/winsup/cygwin/Makefile.in
+++ b/winsup/cygwin/Makefile.in
@@ -126,7 +126,8 @@ DLL_OFILES:=assert.o autoload.o cygheap.o cygserver_client.o \
fhandler_disk_file.o fhandler_dsp.o fhandler_floppy.o fhandler_mem.o \
fhandler_random.o fhandler_raw.o fhandler_serial.o fhandler_socket.o \
fhandler_tape.o fhandler_termios.o fhandler_tty.o fhandler_windows.o \
- fhandler_zero.o fork.o glob.o grp.o heap.o init.o ioctl.o ipc.o \
+ fhandler_zero.o fnmatch.o \
+ fork.o glob.o grp.o heap.o init.o ioctl.o ipc.o localtime.o \
localtime.o malloc.o miscfuncs.o mmap.o net.o ntea.o passwd.o path.o \
pinfo.o pipe.o poll.o pthread.o regcomp.o regerror.o regexec.o \
regfree.o registry.o resource.o scandir.o sched.o sec_acl.o \
@@ -286,13 +287,13 @@ dcrt0.o sigproc.o: child_info_magic.h
shared.o: shared_info_magic.h
libpthread.a: speclib cygwin.def pthread.o thread.o
- /bin/sh ${word 1, $^} $@ "${NM}" "${DLLTOOL}" ${wordlist 2, 99, $^}
+ /bin/sh ${word 1, $^} $@ "${NM}" "${DLLTOOL}" "${AS}" ${wordlist 2, 99, $^}
$(PWD)/libm.a: speclib cygwin.def $(LIBM)
- /bin/sh ${word 1, $^} $@ "${NM}" "${DLLTOOL}" ${wordlist 2, 99, $^}
+ /bin/sh ${word 1, $^} $@ "${NM}" "${DLLTOOL}" "${AS}" ${wordlist 2, 99, $^}
$(PWD)/libc.a: speclib cygwin.def $(PWD)/libm.a libpthread.a
- /bin/sh ${word 1, $^} -v $@ "${NM}" "${DLLTOOL}" ${wordlist 2, 99, $^}
+ /bin/sh ${word 1, $^} -v $@ "${NM}" "${DLLTOOL}" "${AS}" ${wordlist 2, 99, $^}
lib%.a: %.o
$(AR) cru $@ $?
diff --git a/winsup/cygwin/cygmagic b/winsup/cygwin/cygmagic
index 87e571d9c..387593878 100755
--- a/winsup/cygwin/cygmagic
+++ b/winsup/cygwin/cygmagic
@@ -17,10 +17,16 @@ cat <<EOF > $file_magic
/* autogenerated - do not edit */
#include "$file"
EOF
+if sum -r /dev/null >/dev/null 2>&1; then
+ sumit(){ sum -r $*; }
+else
+ sumit(){ sum $*; }
+fi
+
while [ -n "$1" ]; do
define=$1; shift
struct=$1; shift
- sum=`$gcc -E $file | sed -n "/^$struct/,/^};/p" | sed -e 's/[ ]//g' -e '/^$/d' | sum | awk '{printf "0x%x", $1}'`
+ sum=`$gcc -E $file | sed -n "/^$struct/,/^};/p" | sed -e 's/[ ]//g' -e '/^$/d' | sumit | awk '{printf "0x%x", $1}'`
echo "#define $define $sum"
curr=`sed -n "s/^#[ ]*define CURR_$define[ ][ ]*\([^ ][^ ]*\)/\1/p" $file`
[ "$curr" != "$sum" ] && echo "*** WARNING WARNING WARNING WARNING WARNING ***
diff --git a/winsup/cygwin/cygwin.din b/winsup/cygwin/cygwin.din
index 359e2c33d..5e472c82d 100644
--- a/winsup/cygwin/cygwin.din
+++ b/winsup/cygwin/cygwin.din
@@ -263,6 +263,8 @@ floor
_floor = floor
floorf
_floorf = floorf
+fnmatch
+_fnmatch = fnmatch
fmod
_fmod = fmod
fmodf
@@ -1034,6 +1036,8 @@ setsockopt = cygwin_setsockopt
inet_aton = cygwin_inet_aton
inet_ntoa = cygwin_inet_ntoa
recvfrom = cygwin_recvfrom
+recvmsg = cygwin_recvmsg
+sendmsg = cygwin_sendmsg
sendto = cygwin_sendto
shutdown = cygwin_shutdown
sethostent
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc
index cb4de7a37..cf7aaa5e6 100644
--- a/winsup/cygwin/exceptions.cc
+++ b/winsup/cygwin/exceptions.cc
@@ -600,6 +600,7 @@ sig_handle_tty_stop (int sig)
myself->process_state &= ~PID_STOPPED;
return;
}
+
myself->stopsig = sig;
/* See if we have a living parent. If so, send it a special signal.
* It will figure out exactly which pid has stopped by scanning
@@ -608,7 +609,8 @@ sig_handle_tty_stop (int sig)
if (my_parent_is_alive ())
{
pinfo parent (myself->ppid);
- sig_send (parent, SIGCHLD);
+ if (!(parent->getsig (SIGCHLD).sa_flags & SA_NOCLDSTOP))
+ sig_send (parent, SIGCHLD);
}
sigproc_printf ("process %d stopped by signal %d, myself->ppid_handle %p",
myself->pid, sig, myself->ppid_handle);
@@ -921,7 +923,7 @@ ctrl_c_handler (DWORD type)
/* We're only the process group leader when we have a valid pinfo structure.
If we don't have one, then the parent "stub" will handle the signal. */
- if (!pinfo (GetCurrentProcessId ()))
+ if (!pinfo (cygwin_pid (GetCurrentProcessId ())))
return TRUE;
tty_min *t = cygwin_shared->tty.get_tty (myself->ctty);
@@ -1032,9 +1034,6 @@ sig_handle (int sig, bool thisproc)
if (handler == (void *) SIG_ERR)
goto exit_sig;
- if ((sig == SIGCHLD) && (thissig.sa_flags & SA_NOCLDSTOP))
- goto done;
-
goto dosig;
stop:
diff --git a/winsup/cygwin/grp.cc b/winsup/cygwin/grp.cc
index fee420992..93af7063e 100644
--- a/winsup/cygwin/grp.cc
+++ b/winsup/cygwin/grp.cc
@@ -223,7 +223,7 @@ getgrgid (gid_t gid)
return group_buf + i;
}
- return default_grp;
+ return allow_ntsec ? NULL : default_grp;
}
extern "C"
diff --git a/winsup/cygwin/include/cygwin/version.h b/winsup/cygwin/include/cygwin/version.h
index f6c3b750f..f896e7039 100644
--- a/winsup/cygwin/include/cygwin/version.h
+++ b/winsup/cygwin/include/cygwin/version.h
@@ -44,7 +44,7 @@ details. */
/* The current cygwin version is 1.3.6 */
#define CYGWIN_VERSION_DLL_MAJOR 1003
-#define CYGWIN_VERSION_DLL_MINOR 7
+#define CYGWIN_VERSION_DLL_MINOR 10
/* Major numbers before CYGWIN_VERSION_DLL_EPOCH are
incompatible. */
@@ -147,12 +147,14 @@ details. */
47: Report EOTWarningZoneSize in struct mtget.
48: Export "posix" regex functions
49: Export setutent, endutent, utmpname, getutent, getutid, getutline.
+ 50: Export fnmatch.
+ 51: Export recvmsg, sendmsg.
*/
/* Note that we forgot to bump the api for ualarm, strtoll, strtoull */
#define CYGWIN_VERSION_API_MAJOR 0
-#define CYGWIN_VERSION_API_MINOR 49
+#define CYGWIN_VERSION_API_MINOR 51
/* There is also a compatibity version number associated with the
shared memory regions. It is incremented when incompatible
diff --git a/winsup/cygwin/include/sys/socket.h b/winsup/cygwin/include/sys/socket.h
index ca76419eb..51ed54e54 100644
--- a/winsup/cygwin/include/sys/socket.h
+++ b/winsup/cygwin/include/sys/socket.h
@@ -35,7 +35,9 @@ extern "C"
int recv (int, void *__buff, int __len, unsigned int __flags);
int recvfrom (int, char *__buff, int __len, int __flags,
struct sockaddr *__from, int *__fromlen);
+ int recvmsg(int s, struct msghdr *msg, int flags);
int send (int, const void *__buff, int __len, unsigned int __flags);
+ int sendmsg(int s, const struct msghdr *msg, int flags);
int sendto (int, const void *, int, unsigned int, const struct sockaddr *, int);
int setsockopt (int __s, int __level, int __optname, const void *optval, int __optlen);
int getsockopt (int __s, int __level, int __optname, void *__optval, int *__optlen);
diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc
index c73a5af18..01beab79a 100644
--- a/winsup/cygwin/net.cc
+++ b/winsup/cygwin/net.cc
@@ -34,6 +34,7 @@ details. */
#include "sigproc.h"
#include "pinfo.h"
#include "registry.h"
+#include <sys/uio.h>
extern "C" {
int h_errno;
@@ -2519,3 +2520,63 @@ extern "C" void
endhostent (void)
{
}
+
+/* exported as recvmsg: standards? */
+extern "C" int
+cygwin_recvmsg(int s, struct msghdr *msg, int flags)
+{
+ int ret, nb;
+ size_t tot = 0;
+ int i;
+ char *buf, *p;
+ struct iovec *iov = msg->msg_iov;
+
+ for(i = 0; i < msg->msg_iovlen; ++i)
+ tot += iov[i].iov_len;
+ buf = (char *) malloc(tot);
+ if (tot != 0 && buf == NULL) {
+ errno = ENOMEM;
+ return -1;
+ }
+ nb = ret = cygwin_recvfrom (s, buf, tot, flags,
+ (struct sockaddr *) msg->msg_name, (int *) &msg->msg_namelen);
+ p = buf;
+ while (nb > 0) {
+ ssize_t cnt = min(nb, iov->iov_len);
+
+ memcpy (iov->iov_base, p, cnt);
+ p += cnt;
+ nb -= cnt;
+ ++iov;
+ }
+ free(buf);
+ return ret;
+}
+
+/* exported as sendmsg: standards? */
+extern "C" int
+cygwin_sendmsg(int s, const struct msghdr *msg, int flags)
+{
+ int ret;
+ size_t tot = 0;
+ int i;
+ char *buf, *p;
+ struct iovec *iov = msg->msg_iov;
+
+ for(i = 0; i < msg->msg_iovlen; ++i)
+ tot += iov[i].iov_len;
+ buf = (char *) malloc(tot);
+ if (tot != 0 && buf == NULL) {
+ errno = ENOMEM;
+ return -1;
+ }
+ p = buf;
+ for (i = 0; i < msg->msg_iovlen; ++i) {
+ memcpy (p, iov[i].iov_base, iov[i].iov_len);
+ p += iov[i].iov_len;
+ }
+ ret = cygwin_sendto (s, buf, tot, flags,
+ (struct sockaddr *) msg->msg_name, msg->msg_namelen);
+ free (buf);
+ return ret;
+}
diff --git a/winsup/cygwin/security.cc b/winsup/cygwin/security.cc
index 77ea8fbcc..6bacfdef0 100644
--- a/winsup/cygwin/security.cc
+++ b/winsup/cygwin/security.cc
@@ -779,6 +779,7 @@ create_token (cygsid &usersid, cygsid &pgrpsid)
free (my_grps);
my_grps = NULL;
}
+ CloseHandle (my_token);
}
/* Create list of groups, the user is member in. */
diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc
index ef70fa232..bfe5f9901 100644
--- a/winsup/cygwin/sigproc.cc
+++ b/winsup/cygwin/sigproc.cc
@@ -228,7 +228,7 @@ pid_exists (pid_t pid)
BOOL __stdcall
proc_exists (_pinfo *p)
{
- return p && !(p->process_state & (PID_INITIALIZING | PID_EXITED));
+ return p && !(p->process_state & PID_EXITED);
}
/* Return 1 if this is one of our children, zero otherwise.
diff --git a/winsup/cygwin/speclib b/winsup/cygwin/speclib
index ac7cc28fa..a5ce7f46b 100755
--- a/winsup/cygwin/speclib
+++ b/winsup/cygwin/speclib
@@ -15,8 +15,9 @@ esac
lib=$1; shift
nm=$1; shift
dlltool=$1; shift
+as=$1; shift
def=$1; shift
trap "rm /tmp/$$.def" 0 1 2 15
(echo "LIBRARY cygwin1.dll
EXPORTS"; $nm --extern-only --defined-only $* | sed -e '/^[ ]*$/d' -e '/:$/d' -e 's/^.* _\(.*\)/\1/' | grep $v -f - -w $def |egrep -vi '^library|exports|^$' | sort) > /tmp/$$.def
-exec $dlltool -d /tmp/$$.def -l "$lib" -D /dev/null
+exec $dlltool --as=$as -d /tmp/$$.def -l "$lib"
diff --git a/winsup/cygwin/sync.h b/winsup/cygwin/sync.h
index a32dadb97..d546b71e5 100644
--- a/winsup/cygwin/sync.h
+++ b/winsup/cygwin/sync.h
@@ -48,9 +48,9 @@ extern muto muto_start;
/* Use a statically allocated buffer as the storage for a muto */
#define new_muto(__inh, __name) \
({ \
- static __attribute__((section(".data_cygwin_nocopy"))) muto __mbuf; \
+ static volatile __attribute__((section(".data_cygwin_nocopy"))) muto __mbuf; \
(void) new ((void *) &__mbuf) muto (__inh, __name); \
__mbuf.next = muto_start.next; \
- muto_start.next = &__mbuf; \
- &__mbuf; \
+ muto_start.next = (muto *) &__mbuf; \
+ (muto *) &__mbuf; \
})
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index c7693ae81..a8b2eb2e3 100644
--- a/winsup/cygwin/syscalls.cc
+++ b/winsup/cygwin/syscalls.cc
@@ -1816,7 +1816,7 @@ ptsname (int fd)
}
/* FIXME: what is this? */
-extern "C" int
+extern "C" int __declspec(dllexport)
regfree ()
{
return 0;
@@ -2102,6 +2102,7 @@ setegid (gid_t gid)
return -1;
}
myself->gid = gid;
+#if 0 // Setting the primary group in token here isn't foolproof enough.
if (allow_ntsec)
{
cygsid gsid;
@@ -2123,6 +2124,7 @@ setegid (gid_t gid)
}
}
}
+#endif
}
}
else